Reading an API automation script
Read a short script that calls an application programming interface (API), picks values out of the reply, chains requests and runs a table of cases, in Python or Java.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a scripted phone call. Imagine a call centre script that every agent reads. Ask the same questions in the same order. Mark each answer: right or wrong. Anyone can run the call, and the notes look the same each time.
An application programming interface () script is a call to an application programming interface, the way programs talk to Daily List. Leo shows Tom a script. It asks the app to create a task. It checks that the reply says "created". Then it asks for that task back and checks the title.
Tom reads it like a script: the question, the expected answer, the mark. He does not need to write it. He needs to see what each line asks and what it checks.
There is also a table of calls: a good title, an empty title, no sign-in. The same call runs for each row. Each row has an expected code.
The picture has limits. A phone script is spoken. An API script is typed, and a small slip, such as a wrong key name, fails silently.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Reading an application programming interface () script as a scripted call: ask, expect a code, check the body, carry a value forward.
- Find the request
- Find the expected code
- Find the body checks
- Find what is carried forward
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The call script | The application programming interface (API) script |
| The question | The request |
| The marked answer | The status code and body checks |
| Writing down a reference number for the next call | Request chaining |
WHERE THIS PICTURE STOPS
- A phone call is spoken. A script is typed.
- A caller can say sorry. A script fails with a code.
- A reference number is read by a person. A script reads it from a reply.
HOOK
Ask, expect, check, carry on.
REMEMBER IT THIS WAY
A sequence: the real steps, in order.
For each line of a script, find the question it asks, the code it expects, and the body it checks.
| In the trick | What it stands for |
|---|---|
| Question | it asks the app to create a task |
| Code | the reply says created, an expected code |
| Body | asks for that task back and checks the title |
TELL A FRIEND
A call script asks fixed questions and marks the answers. An application programming interface () script sends fixed requests and checks the replies.
OFTEN MIXED UP WITH Designing API tests. The design lesson chooses cases. This lesson reads the script that runs them.
PRACTISE AND KEEP
Sources for this topic — 9 sources
- Market practice
Quickstart (Requests documentation) ↗ — Python Requests · Read the status code, call json() to decode the body, raise_for_status() raises on 4xx and 5xx codes, and a decoded body does not mean the call succeeded (search excerpt, page not opened)
Primary publisher body opened and relevant sections read on 6 November 2026; selected-section reading, not a claim every page or external link was read. See docs/research/v16-testing-automation-literacy-audit-20261106.md for exact sections, version and limitations.
- Market practice
How to parametrize fixtures and test functions (pytest documentation) ↗ — pytest · The parametrize marker defines several argument sets so one test function runs once per set (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. 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
Usage (Representational State Transfer (REST) Assured library wiki) ↗ — Representational State Transfer (REST) Assured project (GitHub wiki) · given, when and then chains with Hamcrest matchers; REST Assured's JSON path follows Groovy GPath, not Jayway JsonPath (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. 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. V27 supplement, 6 November 2026: relevant primary page sections actually opened; implementation-specific current product guidance, not universal standard. See full V27 audit for version and access scope.
- Market practice
JSONPath: query expressions for JSON (Request for Comments 9535) ↗ — IETF · JSONPath is a query language for picking values out of JSON (search excerpt, page not opened)
Original 18 October 2026 record was based on search excerpts. On 7 November 2026 the RFC Editor publication page, abstract and Status of This Memo were opened to verify Proposed Standard/Standards Track status. This taxonomy update does not certify a complete syntax, implementation or errata review; lesson-specific source locators identify separately read technical sections.
- Market practice
HyperText Transfer Protocol (HTTP) response status codes (Mozilla developer docs) ↗ — Mozilla (developer documentation) · HTTP response status codes: 2xx success, 4xx client error, 5xx server error (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. 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
Write scripts to test API response data in Postman (Postman Learning Center) ↗ — Postman · Postman test scripts check response data (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. 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
Store and reuse values using variables (Postman Learning Center) ↗ — Postman · Code form from a DEV Community Postman token tutorial (search excerpt, page not opened); registry sources describe pm variables and test scripts. Not run in Postman in this sweep.
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. 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
Automatically set access tokens in Postman after login (DEV Community) ↗ — DEV Community · Code form from a DEV Community Postman token tutorial (search excerpt, page not opened); registry sources describe pm variables and test scripts. Not run in Postman in this sweep.
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
ISTQB Certified Tester Advanced Level Test Automation Engineering (CTAL-TAE) Syllabus v2.0 ↗ — International Software Testing Qualifications Board (ISTQB) · Section 8.1.1 (printed page 48): schema validation of API responses and database fields; example of six mandatory string elements replacing separate assertions; version 2.0 of 2024-05-03, mirror copy of the publisher PDF, version checked against front matter, opened
Primary publisher body opened and relevant sections read on 6 November 2026; selected-section reading, not a claim every page or external link was read. See docs/research/v16-testing-automation-literacy-audit-20261106.md for exact sections, version and limitations.
V52 additionally read actual publisher PDF7 November 2026: version 2.0,3 May 2024 front/introduction and all substantivechapters 1–8/29 learning objectives, throughprintedp 53 and selectedreferences. Not every appendix or cited book. §3.1.5 says interface substitution; Martin’s original calls it Interface Segregation. Preserve the source discrepancy separately. No unrestricted commercial image permission established.
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.