What are Application Programming Interfaces?
Interacting with a computer application requires some form of interface. When two computer applications need to interact, they do so using an Application Programming Interface (API).
API Architectures
More on API Architectures.
Representational State Transfer (REST)
A REST API call follows four steps:
- The client sends a request.
- The server processes the request.
- The server sends the response.
- Data is transferred.
The REST API architecture is by far the most commonly used and powers much of the modern internet.
Request Methods
GET- retrieves a resourcePOST- submits new data to the serverPUT- updates existing dataDELETE- removes data
These request methods map to CRUD operations.
Key Points on REST
- Maps resources to URLs, and uses HTTP to methods to manipulate those resources.
- For example
/users/{userID}to get a user orPOST /user/{userID}/bookingto create a booking. - If you’re returning large results, you’ll want to use pagination.
More on REST APIs.
Server Sent Events (SSE)
Websockets
gRPC
API Design
More on API Design.