Objective: Test the conversation behind the page: send real requests, read the status code AND the body, and check the returned values against the business rules — including authentication behaviour in both directions.
⏱ ≈70 min full lesson · Simulated FreshNest booking API (api.freshnest.example — a training system) · English edition — Español · العربية · বাংলা in translation
🧽 The practice business: FreshNest Home Cleaning — a fictional local cleaning company (owner: Maya Torres) invented for this course. Every example and exercise uses FreshNest, so you learn on a complete, realistic business without ever touching a real one.
When you click 'Get my quote' on the FreshNest site, the page quietly sends a request to an API and displays whatever comes back. If the API returns a wrong price, the prettiest page in the world will confidently show a wrong price. API testing checks that conversation directly: send a request, read the response, compare both halves against the rules.
The status code tells you the category of outcome — 201 created, 400 the request broke the rules, 401 prove who you are, 404 that thing doesn't exist, 500 the server fell over. The body tells you the detail, and data checks are the real test: a Standard 2-bed quote is $140; Deep is 1.5× Standard; ±$30 per bedroom from the $140 base; Move-Out is never priced — it comes back 'quoted individually'. A 201 with the wrong price inside is a failure wearing a success costume.
Authentication gets tested in both directions: a private endpoint must refuse a request with no credentials (401) and with wrong ones — and must still work with the right ones, or you have blocked the owner along with the attackers. The trade-off: API tests are fast and stable, so you can run many — but they cannot see layout or readability. Pair them with the web tests of PQA-07; neither layer replaces the other. And drop the misconception now: 'the status code was 200, so the test passed.' Status codes report that the server coped, not that it answered correctly.