TOPIC 12/4020 MINNOT STARTED

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.

  1. Find the request
  2. Find the expected code
  3. Find the body checks
  4. Find what is carried forward
Ask, expect, check, carry on

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The call scriptThe application programming interface (API) script
The questionThe request
The marked answerThe status code and body checks
Writing down a reference number for the next callRequest 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.

What each part of the trick stands for
In the trickWhat it stands for
Questionit asks the app to create a task
Codethe reply says created, an expected code
Bodyasks 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
  1. 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)

    Shows reading the status code, calling json() to decode the body, raise_for_status() for error codes, and that a decoded body does not mean the call succeeded. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-11-06

    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.

  2. 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)

    Says the parametrize marker defines several argument sets so one test function runs once per set, and that fixtures can also be parametrized. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-10-18

    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.

  3. 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)

    Per the search excerpt, a Java library for testing web APIs with a given, when, then layout: given holds the request set-up, when sends the request and then checks the reply. Practitioner guidance, not a standard. · Checked 2026-11-06

    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.

  4. 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)

    RFC 9535, February 2024, defines JSONPath query expressions for selecting JSON values. Its published status is Proposed Standard on the IETF Internet Standards Track; this is distinct from an Internet Standard maturity designation. Technical conformance depends on the selected implementation and standard scope. · Checked 2026-11-07

    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.

  5. 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)

    Per the search excerpt, status codes come in five classes: informational, success, redirection, client error and server error. Pages for 400, 401, 403, 404 and 500 describe each. · Checked 2026-10-18

    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.

  6. 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)

    Per the search excerpt, a test is written with a name and a function; the test fails if any check inside fails. Checks use the Chai expect style. Practitioner guidance, not a standard. · Checked 2026-10-18

    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.

  7. 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.

    Per the search excerpt, variables come in five scopes: global, collection, environment, data and local; the narrowest scope wins. Practitioner guidance, not a standard. · Checked 2026-10-18

    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.

  8. 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.

    Save the login token in a test script and reuse it as a variable. · Checked 2026-10-19

    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.

  9. 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

    Version 2.0 syllabus (3 May 2024), read in full text. Used for the objective ids and levels in chapters 1 to 8, the deployment risks, the verification of the automation solution and the configuration management of testware. Paraphrased, not quoted. · Checked 2026-11-07

    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.