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.

https://images.ctfassets.net/vwq10xzbe6iz/5sBH4Agl614xM7exeLsTo7/9e84dce01735f155911e611c42c9793f/rest-api.png

API Endpoints :

Collection: a group of resources such as /api/profiles/users

Subcollection:

refers to collection within a particular resource

/api/users/{user_id}/settings

Gateway:

Microservices:

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

Standard web API Types

Restful API:

API consumer can request resources from API endpoints, which is a URL for interacting with part of API

api-gateway-diagram.svg

Acronym CRUD

Stands for Create, Read, Update and Delete



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

Some Common Headers from that it’s high probability that it could be RESTful API

  1. Authorization: used to pass the token or credentials to the API Providers
Authorization: Bearer Abdf123Ab
  1. Content-type

used to indicate the type of media being transferred these diff from Accept, which states the media type you want to receive.