Environments
Swap keys and hosts between sandbox and production without rewriting a single request.
Lesson 7 of 10
"The API just stopped working" is never the actual bug. Turning that sentence into a reproducible request is the entire job.
A customer describes an outcome, not a request. Your first job is translating one into the other.
"It just stopped working" could mean a 401, a 429, a 500, or a client-side bug that never reaches your API at all. Before you touch a debugger, get as close as you can to the actual request— method, path, headers, body — that the customer's system sent. Everything downstream depends on starting from something concrete instead of a paraphrase.
Four features turn a one-off request into something reusable and shareable.
Swap keys and hosts between sandbox and production without rewriting a single request.
Group related requests into something shareable — engineering can rerun the exact same calls, not a paraphrase of them.
Compute a signature, timestamp, or auth header automatically before the request goes out.
Assert the response matches what you expect, so rerunning the same request later catches a regression instead of requiring a manual re-read.
Look at the sanitized request/response below, then work through both exercises.
POST /v1/messages HTTP/1.1
Authorization: Bearer <redacted>
Idempotency-Key: 8f14e45f-ceea-467e-bd42-4a6f3d1e9c21
HTTP/1.1 429 Too Many Requests
Retry-After: 30
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1717000000
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after 30 seconds."
}
}Answer in your head first, then click a question to reveal the answer.
Work through the sample request/response and check each item off. Progress is saved in your browser.
These primers are a starting point. Read the primary sources to build real fluency.
What building this project taught me.
HTTP covers the protocol vocabulary — methods, status codes, headers. This lesson is the workflow for using that vocabulary to reproduce a live customer-reported bug, with Postman as the tool.
X-RateLimit-* here is illustrative — some APIs use different header names or a Retry-After-only pattern. Confirm the actual headers in the docs for whichever API you're debugging.