An API is an application programming interface - it’s a set of rules that lets programs talk to each other, exposing data and functionality across the internet in a consistent format.
- operating systems API
API that can specify the interface between an application and the operating system.
- linux shell commands like ls, ps.
- windows cmd commands like dir, ping.
- remote API
Remote APIs allow developers to manipulate remote resources through protocols like TCP, specific standards for communication that allow different technologies to work together, regardless of language or platform.
- JDBC (Java Database Connectivity API),
- RPC(Remote Procedure Call)
- web API
web APIs allow developers to manipulate remote resources through protocols like HTTP, specific standards for communication that allow different technologies to work together, regardless of language or platform.
- SOAP web service
- REST API
REST stands for Representational State Transfer. REST API means API accessed via HTTP protocol at a predefined set of URLs.
- url
- http mehtod
- GET - query
- PUT - update
- POST - create
- DELETE - delete
- http status code
- 2xx Success
- 200 OK
- 201 Created
- 4xx Client Error
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 5xx Server Error
- 500 Internal Server Error
- 2xx Success
- resource