API Provides a way for applications to use the functionality and data for application to use the functionality and data of other applications over HTTP to feed a web application GUI with images, tests, and videos.
API consumers have the ability to request resources from API endpoints.
These endpoints represent specific parts of the API and are accessed using URLs. Each of the examples provided represents a distinct API, showcasing different functionalities and resources that can be interacted with.
/api/profiles/users
refers to collection within a particular resource
/api/users/{user_id}/settings
Modular piece of web app that handles a specific function
<aside> 💡 API Doc. might user colon or square bracket or curly bracket /api/v2/:customer_id or /api/v2/[customer_id] or /api/v2/{customer_id}
</aside>
API Contract : said to API Documentation
Restful API:
API consumer can request resources from API endpoints, which is a URL for interacting with part of API
Stands for Create, Read, Update and Delete
Create a process of making new req. accomplished through POST method
Read data retrieval, through GET req.
Update: record modification through POST OR PUT overwritten
Delete: Erasing record through Delete or POST
Restful API depends/ works on 6 Constants, Rest is essentially a set of guidelines for an HTTP resource-based architecture.
RESTful API may be different. It may have different method beyond CRUD It’s our set of authentication requirement, subdomain instead of Endpoint different rate-limit requirement
It can be configured to call their RestAPI without adhering to the standard
An RestAPI GET req. used to find out how many bedsheet are in store inventory
GET /api/v3/inventory item/pillow HTTP/1.1
HOST: googleshop.com
User-Agent: Google/11.0
Accept: application/json
REQUEST
googleshop.com provided all information it had about bedsheet consumer need to filter the response if they need some specific details like only name & value.
The amount of data sent back is depends on how API is being programmed by the API providers
HTTP/1.1 200 OK
Server: RESTful server/0.1
Cache-control: no store
Content-type: application/json
{
"item":{
"id":00101
"name": "bedsheet"
"count": 25
"price":{
"currency": "USD"
"value":"19.99"
}
}
}
RESPONSE
Authorization: Bearer Abdf123Ab
used to indicate the type of media being transferred these diff from Accept, which states the media type you want to receive.