API Lab
A practice API for REST Assured. Every class day of the API part has a page with the addresses to call and three tasks. All data is made up.
How it works
- Base address: this site's address followed by
/api/v1. JSON is the default, XML where a page says so. - Your own copy of the data: send the header
X-Sandbox: your-name(letters, digits, - and _). Without it you share the default sandbox with everybody, and other people's tests will change your data. - A sandbox starts with 12 users and is forgotten after 24 hours.
DELETE /api/v1/sandboxresets yours at once. - Errors always look the same:
{"error": "...", "status": 404}, with anerrorslist for wrong input. - Please keep loops sensible: 300 requests a minute for each visitor, bodies up to 100 KB.
- Files for your tools: the OpenAPI file and the Postman collection.
- Class day 43
HTTP methods and status codes
Every HTTP method on one resource (users), and an address that answers with any status code you ask for.
- Class day 44
POST payloads
Send a JSON body in several ways: text, a Map, a JSONObject, a POJO or a file. The echo address shows what arrived.
- Class day 45
Parameters, headers and cookies
Query parameters, path parameters, request and response headers, cookies, and a search with paging and sorting.
- Class day 46
Parsing a JSON response
A nested JSON answer with lists inside objects: the right size for JsonPath and loops.
- Class day 47
XML, file upload and download
The same books as XML, a file upload that is checked and forgotten, and downloads with a checksum to compare.
- Class day 48
Schemas, serialization and deserialization
A JSON schema and an XML schema (XSD) to validate answers against, and objects that turn into JSON and back.
- Class day 49
Authorization and chaining
Basic, bearer token, API key and OAuth 2 (client credentials), and users and orders to chain together.
- Class day 50 and 51
The API automation framework
The whole API in one place: the target of the framework you build in the last two classes.