REST API
The most common style of web API: things have URLs and you act on them with HTTP verbs.
A REST API is an API designed around a simple idea: everything the system knows about is a resource with its own URL, and you use the standard verbs of HTTP to act on it. GET /orders/42 reads order 42, POST /orders creates a new one, PUT /orders/42 replaces it and DELETE /orders/42 removes it. The answer usually comes back as JSON.
The style was described by Roy Fielding in his 2000 doctoral thesis, and the name stands for REpresentational State Transfer. One of its rules is that each request is stateless: it carries everything the server needs to answer it, so the server does not have to remember previous requests. That makes REST APIs easy to spread over many servers and to cache.
Every answer also brings a status code, a three-digit number that says how it went: 200 means OK, 201 created, 404 not found, 401 you are not logged in, 500 the server failed. Because it reuses what the web already has, REST became the default way apps, websites and companies talk to each other. When people say "the Stripe API" or "the GitHub API", they usually mean a REST API.
Keep in mind
- Each thing has a URL; the HTTP verb says what to do with it.
- GET reads, POST creates, PUT or PATCH updates, DELETE removes.
- Requests are stateless: each one stands on its own.
- Status codes like 200, 404 and 500 tell you how it went.