REST and JSON basics
See how most web APIs are built: things with addresses, a few verbs, replies in JSON and a status code that says if it worked. Includes CRUD and the REST versus SOAP question.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: The paper form. A paper form has labelled boxes: Name, Date, Amount. Both sides know what each box means, so nobody has to guess. A clerk can read it, and so can the person who filled it in.
Many web APIs work like that. Daily List, the to-do app, sends a task as a form with labelled boxes. Sam, the , reads one reply and sees the task's title, due date and status, each with its label.
The form is written in , a text format that holds data as labelled values. The letters stand for JavaScript Object Notation, but you do not need to know JavaScript to read it.
Most web APIs follow a style called (Representational State Transfer). In plain words, each thing has an address, and a few verbs act on it. The task with number seven has an address. You can read it, change it or remove it by using the right verb at that address.
Every reply carries a , a number that says if the request worked. Number two hundred means yes. Number four hundred and four means the thing was not found.
A form has no sense of its own. Both sides must follow its rules, or the labels mean nothing.
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the work.
THE REAL JOB The picture helps a newcomer remember that both sides must follow the same labelled form, and that the says how it went.
- Read the status
- Check the labels
- Check each value
- Note any nulls
- Match to the contract
HOW THE PICTURE MAPS
| In the picture | In the work |
|---|---|
| The labelled boxes on a form | The labels in a JSON reply |
| A filled-in box | A value |
| A clerk who reads the form | The program that reads the reply |
| The stamp that says accepted or rejected | The status code |
| The address of the form on a shelf | The address of a thing in a Representational State Transfer (REST) API |
WHERE THIS PICTURE STOPS
- A form has no sense. If a label is wrong, the clerk may still read it as it is written.
- A paper form has fixed boxes, but JSON can nest one form inside another.
- A clerk can ask what an unclear box means. A program cannot.
HOOK
Same boxes, same labels, same stamp.
REMEMBER IT THIS WAY
A sequence: the real steps, in order.
Check any reply in this order: status, labels, values. A missing label is not the same thing as a null.
| In the trick | What it stands for |
|---|---|
| Status | The status code says accepted or rejected |
| Labels | The labels in a JSON reply |
| Values | A filled-in box holds a value |
TELL A FRIEND
Most web APIs give each thing an address, use a few verbs on it and answer in with a . CRUD is create, read, update and delete.
OFTEN MIXED UP WITH APIs in plain words. That topic shows the menu of requests. This one shows how the form of each request and reply is written.
PRACTISE AND KEEP
Sources for this topic — 11 sources
- Market practice
Hypertext Transfer Protocol (HTTP) request methods (Mozilla developer docs) ↗ — Mozilla (MDN Web Docs) · Hypertext Transfer Protocol (HTTP) request methods (Mozilla developer docs): GET reads, POST submits, PUT replaces and DELETE removes (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
The JavaScript Object Notation (JSON) Data Interchange Format (Request for Comments 8259) ↗ — Internet Engineering Task Force · The JavaScript Object Notation (JSON) Data Interchange Format (Request for Comments 8259): JSON is a text format with objects, arrays, strings and numbers (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. Supplement6November2026: actual RFC8259 sections2–3 opened. RFC8259 is STD90; null is a literal JSON value. Earlier excerpt notes retain their historical scope.
- Market practice
Representational State Transfer (REST) glossary entry (Mozilla developer docs) ↗ — Mozilla (MDN Web Docs) · Representational State Transfer (REST) glossary entry (Mozilla developer docs): REST is a style of web services built on addresses and a small set of verbs (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Simple Object Access Protocol (SOAP) versus Representational State Transfer (REST): two API styles compared (Upwork) ↗ — Upwork · Simple Object Access Protocol (SOAP) versus Representational State Transfer (REST): two API styles compared (Upwork): SOAP wraps XML in an envelope, REST can carry several formats and usually uses JSON, and REST uses the web status codes for errors (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
RFC 9110 — HTTP Semantics ↗ — IETF · Request for Comments 9110, HTTP Semantics: methods, safe and idempotent methods, and the status code classes (registry source; page not opened in this batch)
Internet Standard, June 2022, obsoleting RFC 7230 through 7235.
Cited for method semantics only. "Idempotent" in RFC 9110 is a property of a method: that repeating the request has the same intended effect on the origin server. It is not the same claim as "this payment cannot be duplicated", which is a scheme-level guarantee with its own documents.
Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.
Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.
Read in full from the HTTP Working Group's own publication mirror at httpwg.github.io.
- Simplified educational illustration
Payments Signal editorial teaching models — Payments Signal
What this simplifies: Daily List, its addresses and the people are invented. Real APIs have more verbs, more codes and more rules than shown here. The create, read, update and delete (CRUD) matrix is a common analyst tool with no single standard layout.
Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.
- Market practice
HTTP request methods ↗ — MDN Web Docs · MDN pages (search excerpt, page not opened).
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Idempotency-Key header ↗ — MDN Web Docs · MDN pages (search excerpt, page not opened).
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Common Format and Multipurpose Internet Mail Extensions (MIME) Type for Comma-Separated Values (CSV) Files (Request for Comments 4180) ↗ — IETF · Comparison from MyHalo and Sonra format guides (search excerpts, pages not opened).
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Request for Comments (RFC) 4180, October 2005. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
CSV vs XML vs JSON: which is the best response data format? ↗ — MyHalo · Comparison from MyHalo and Sonra format guides (search excerpts, pages not opened).
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practiceDraft, not in force09, 21 November 2026; expires 25 May 2027
The Idempotency-Key HTTP Header Field — draft-ietf-httpapi-idempotency-key-header-09 ↗ — IETF HTTPAPI Working Group · draft-ietf-httpapi-idempotency-key-header-08,22October2026, §§2.2–2.7,expires25April2027. Opened draft; work in progress, not RFC. §2.6 completion-consistent response; do not claim identical status/body mandatory. Server expiry/fingerprint/duplicate/concurrency rules need explicit contract. Preserve dated local201/200 stand-in observations.
Primary IETF revision 09 §§2.2–2.7 and Appendix A checked 23 November 2026. It is an active Internet-Draft. Section 2.6 describes a response consistent with completion according to user intent. Revision 09 clarifies optional fingerprints, lets each resource define uniqueness, and recommends that resources document behaviour and expiry. The provider contract determines actual payment retry behaviour.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.