Postman Test Scripts for API Responses Explained Line by Line
Write and understand tests for status, schema and values.
The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.
[VERIFY] is an editorial flag, not a blank to fill. Wherever the prompt shows [VERIFY], check that item against a reliable source before you use it.
Write Postman tests for these API responses. Example request and response body (invented or with data removed): [EXAMPLE_REQUEST_AND_RESPONSE]. What the API should guarantee: [GUARANTEES]. Write test scripts that check the status code, a response time threshold, headers, the shape of the JSON (required fields and types), specific values, and error responses, and explain each line in plain words. Show how to save a value from a response into a variable and use it in the next request (for example an ID from a create call) and how to run the collection in order. Mark function names and syntax [VERIFY]. Include negative tests: missing field, wrong type, unauthorised access, not found. Provide a table with Name, What it checks and Expected result. Tests must fail when the API is wrong and pass when it is right; prove it by changing the expected value. Avoid tests that depend on production data or on the order of unrelated tests.
Fill in before use
Optional: type your details and the prompt above updates. Nothing is saved or sent.
Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.