SchemoDocs
Download
Browse documentation

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.mjs

If 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 protocolAddressWhat to try
GET{{baseUrl}}/products?category=audioEdit query parameters.
POST{{baseUrl}}/productsSend a JSON body and check for 201 Created.
POST{{baseUrl}}/attachmentsUpload an image and a label and confirm the received byte count.
GET{{baseUrl}}/inventoryFollow a JSON:API relationship.
GET{{baseUrl}}/sessionInspect a session cookie.
GET{{baseUrl}}/accountSend an API key.
SSE{{baseUrl}}/eventsWatch stock updates arrive one at a time.
GET{{baseUrl}}/catalog.binOpen Hex and save the response.
GET{{baseUrl}}/preview.pngPreview an image and switch between Fit and 100%.
POST{{baseUrl}}/tokenGet a JWT with the client credentials below and decode it.
GET{{baseUrl}}/orders/o-3207Send the token as a Bearer token and chain the requests.
GET{{baseUrl}}/products.xmlRead an XML response.
GET{{baseUrl}}/slowWait 1.5 seconds and find the call with the Slow filter.
GET{{baseUrl}}/openapi.jsonImport 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.