Rest API and CS-343 are a duo that just sounds right. When trying to give to come up with a blog idea for such a class, I couldn’t picture a clearer GIF than our dear friend Patrick Star
I try my best to not compare but it is hard not to when I compare my blog process to CS-348 and made the sudden realization I have over a hundred ideas for that class.
However, in the short two-minute comparison, I realized that since my class was approaching MS-Billion-Gillion-Trillion in Micrroservice Activity, it would be a great time to take a deep dive into Rest API.
A lot of the articles I had a chance to come across I noticed to have lots of gaps in the information provided. Noticed in some there was missing clarification, simplified introductions, and Chat-GPT “Whats Rest API” money makers. REST API and API in a Nutshell. Deep Diving Into REST API by Krunal Chauhan offered the best of both worlds in offering me a crash course on Rest API and a challenging question started on the advanced side of such a topic.
Crash Course KNOWS:
- Definition of API:
- API stands for Application Programming Interface.
- It acts as a software intermediary allowing communication between different applications or devices.
- Need for API:
- Necessary for communication with various devices and services.
- Enables interaction with web browsers, mobile devices, and third-party software.
- API Explanation (Metaphor):
- Describes API as a mediator, like a waiter in a restaurant, facilitating communication between the client (user) and the backend (kitchen).
- How API Works:
- APIs communicate through rules/protocols.
- Typically works over the internet via HTTP, built on top of the TCP/IP protocol.
- Analogizes API communication to a customer (user) placing an order through a waiter (API) to the kitchen (backend).
- REST API:
- Represents a style of API architecture that uses HTTP and is user-friendly.
- Introduced by Roy Fielding and is considered a standard protocol for web APIs.
- Works with HTTP methods like GET, PUT, POST, and DELETE.
CRASH CROUSE DEEP DIVE:
- Building Blocks of API:
- API Interface Block: Defines specifications for the API, often using HTTP.
- API Controller Block: Manages traffic, and handles authentication, and authorization.
- API Runtime Block: Executes the business logic of the API.
- API Data Bridge Block: Facilitates seamless access to shared data storage.
- API Management:
- Involves designing, publishing, documenting, and analyzing APIs in a secure environment.
- Components include API design, API gateway, API store/developer portal, and API analytics/dashboard.
- Types of API:
- Open APIs (Public API): No restrictions on access.
- Partner APIs: Requires specific rights or licenses.
- Internal APIs (Private APIs): Used within a company for internal purposes.
- REST API Architecture Components:
- REST Client: Code or app accessing REST services.
- REST Server: Offers API and resources.
- REST API: Defines endpoints and methods.
- Endpoint/URI: Specifies where to find a resource.
- REST Request: Includes HTTP method, endpoint, headers, and body.
- REST Response: The server sends a representation of the resource, often in XML or JSON.
I enjoyed reading these types of articles when the reading flow is smooth and coherent to the subject. If you can believe it or even if you check the article yourself, the summary above is my notes for the article and about how 99% of the article flowed.
A good chunk of the reading was a good reminder of things I already learned but there was also a few sections that required me to go back as we have not had the chance to talk in-depth about them.
Specifically, the Rest API Management as this was the first time I ever heard these terms before and was not a section we were able to cover just yet. Out of the article I was able to break down the Rest API Management into 4 sections.
- API Design:
- This block enables users, including developers and partners, to design, publish, and deploy APIs. It includes recording documentation, security policies, descriptions, usage limits, runtime capabilities, and other relevant information.
- API Gateway:
- The API Gateway acts as a gatekeeper for all APIs. It handles tasks such as routing requests, composition, and protocol translation. It enforces relevant API security policies, ensures authorization, and guarantees the security of requests.
- API Store / Developer Portal:
- This component provides a place to keep APIs in a store or catalog, exposing them to internal and/or external stakeholders. The API store serves as a marketplace where users can subscribe to APIs, obtain support from the community, and access other relevant information.
- API Analytics/Dashboard:
- API management solutions offer analytics and dashboards that allow users to monitor API usage, load, transaction logs, historical data, and other metrics. This information helps in understanding the status and success of the available APIs, facilitating data-driven decision-making.
Now I’m not sure why I found this part so interesting and why I found myself watching a 30-minute YouTube video on how API dashboards work and operate, but hey whos going to judge? This is a section I believe we are going to cover/hope we do as it’s been a great experience learning how to build and read complicated APIs. I feel like I am ready to take another step and properly learn how I would manage one of these APIs that I created.
PS: “Advantages of API vs ******** ” (Stay Tuned)
Until Next Time
From the blog CS@Worcester – CS: Start to Finish by mrjfatal and used with permission of the author. All other rights reserved by the author.