API sandbox
The brass gateway: every request to Shelf passes through here.
Your tasks
A code appears when a task is done – type it into the lesson.
Sign in to see your tasks
Tasks check what you did through the API, so they need your account.
A path on this site, such as /api/orders. The full address and the docs are in Reference.
Response
Press Send. The status, the time, the x-trace-id header and the body appear here.
Ctrl + Enter (⌘ + Enter on a Mac) runs the query. Examples and the schema: GraphQL explorer.
Query + variables
Response
Run the query. Read both parts of the answer: data and errors.
Addresses
Put the base URL into a Postman variable- REST base URL
- /api
- GraphQL endpoint
- /graphql
- OpenAPI 3.1 – import into Postman
- /openapi.json
- GraphQL schema (SDL)
- /schema.graphql
Downloads
Files your lessons ask for- Data file for a Postman run
- categories.csv
- Data file for the Practice run
- categories-practice.csv
- Shelf's evening log
- shelf-evening.log
Your first three requests
1Read the catalog – no token needed
2Ask as yourself – with the token from “Your access”
3The same catalog through GraphQL – only the fields you ask for
How this API answers
REST status codes
200read or changed ·201created, with aLocationheader ·204deleted, no body400the request breaks a rule –error.detailsnames the field401no token or key, or an expired one ·403signed in, but not allowed404not there – or not yours: other students’ data does not exist for you409conflicts with the current state ·422understood, but refused (a coupon, a non-test card)
GraphQL
- A query that ran answers
200– also witherrorsin the body. Read bothdataanderrors. - A query that cannot run (a typo, an unknown field) answers
400. extensions.codesays what went wrong:UNAUTHENTICATED,NOT_FOUND,BAD_USER_INPUT…- An
IDis always a string in GraphQL ("3"); in REST the same id is a number (3). That is by design.
Everywhere
- Lists are paged:
page,page_size,total,total_pages. - Every response has an
x-trace-idheader. Quote it in a bug report. - 300 requests a minute per address; then
429. - Only test cards work; use made-up names and addresses.
Your last requests from this browser, newest first. Nothing leaves your browser; your token is never kept here.