Try the Catalog API
Run a local API and follow the illustrated request and response examples.
The Catalog API supplies the sample products, inventory relationships, tokens, orders, cookies, events, and binary data used in the screenshots. It runs locally and uses only Node.js built-ins.
Start the demo API
Save catalog.mjs and catalog-preview.png in the same folder. Run the script with Node.js.
node catalog.mjsIf port 8787 is taken, start it with another port, such as PORT=8790 node catalog.mjs. Keep it running while you work through the examples. In Schemo, create an environment called Catalog · local, set baseUrl to http://127.0.0.1:8787, and select that environment. You can also paste the full address into a request.
Try the endpoints
| Method or protocol | Address | What to try |
|---|---|---|
| GET | {{baseUrl}}/products?category=audio | Edit query parameters. |
| POST | {{baseUrl}}/products | Send a JSON body and check for 201 Created. |
| POST | {{baseUrl}}/attachments | Upload an image and a label and confirm the received byte count. |
| GET | {{baseUrl}}/inventory | Follow a JSON:API relationship. |
| GET | {{baseUrl}}/session | Inspect a session cookie. |
| GET | {{baseUrl}}/account | Send an API key. |
| SSE | {{baseUrl}}/events | Watch stock updates arrive one at a time. |
| GET | {{baseUrl}}/catalog.bin | Open Hex and save the response. |
| GET | {{baseUrl}}/preview.png | Preview an image and switch between Fit and 100%. |
| POST | {{baseUrl}}/token | Get a JWT with the client credentials below and decode it. |
| GET | {{baseUrl}}/orders/o-3207 | Send the token as a Bearer token and chain the requests. |
| GET | {{baseUrl}}/products.xml | Read an XML response. |
| GET | {{baseUrl}}/slow | Wait 1.5 seconds and find the call with the Slow filter. |
| GET | {{baseUrl}}/openapi.json | Import the API as a collection. |
The POST example returns the new product in its response. The list endpoint continues to serve the original five products.
Get a token
POST /token accepts the OAuth 2.0 client credentials grant with client ID catalog-docs and secret catalog-secret. Send them as a form, as Basic credentials, or as a JSON body:
{
"grant_type": "client_credentials",
"client_id": "catalog-docs",
"client_secret": "catalog-secret"
}The token is valid for an hour. GET /orders/o-3207 returns 401 Unauthorized without it. To have Schemo fetch the token for you, follow the OAuth client credentials walkthrough.