BACK_TO_COURSE
How APIs Work
Ask and Answer: The Whole Idea
A Door for Software
A website is how a person uses a system. An API is how another program uses it. Same data, no buttons.
Every exchange is a request and a response. A request has four parts:
| Part | Example | What it says |
|---|---|---|
| Method | GET |
What you want to do |
| Address | /v1/calls?from=2026-11-01 |
What you want to do it to |
| Headers | Authorization: Bearer ... |
Who you are |
| Body | usually JSON | The data you're sending, if any |
The methods mostly mean what they sound like: GET reads, POST creates or triggers something, PUT and PATCH change, DELETE deletes. Mostly. Some APIs use POST for a big search, so check the docs.
The response comes back with a status code and usually some JSON. JSON is just labeled data:
{
"id": "call_1001",
"started_at": "2026-11-29T14:05:00Z",
"direction": "inbound",
"result": "answered",
"talk_seconds": 184
}
Status Codes: The First Digit Tells You Whose Problem It Is
| Code | Meaning | Your move |
|---|---|---|
| 2xx | It was accepted | Check that the data is what you expected |
| 4xx (except 429) | Something is wrong with the request | Fix it; sending it again unchanged rarely helps |
| 429 | You're asking too fast | Slow down and try again |
| 5xx | Their side broke | Wait, then try again if it's safe to |
WARNING
A 200 means the server answered. It does not mean the answer is complete or right. Most bad integrations are full of 200s.
QUIZ
Your integration gets a `400` error. What should it do?
Sign in to track lesson progress and earn a certificate.SIGN IN TO SAVE PROGRESS