Skip to main content

Postman collection

If you work in Postman, this collection gives you a runnable version of the core API patterns, with test scripts that chain state between requests: the auth token, your sandbox floor, the occupancy polling cursor, and the analytics paging offset are all stored in the environment automatically.

Download and import

Download collectionDownload environment template

  1. Download both files with the buttons above.
  2. In Postman, choose Import and add both files.
  3. Select the XY Sense Api User environment and fill in coreApiKey and coreApiSecret with your API key. A ReadPublicApi key runs every request except Generate Occupancy Changes, which needs WritePublicApi.

Run order

Run the Getting started folder first:

  • Fetch Auth Token stores the bearer token in the environment. Tokens last about 15 minutes, so re-run this request when you start seeing 401 responses.
  • Fetch Space Data lists your floors and spaces, and stores the id of a floor named API Test Floor for the sandbox flow. If you don't have a floor with that name, the request still shows your portfolio and every other folder works normally.

Then explore the folders in any order:

FolderWhat it demonstrates
OccupancyThe full polling loop: generate sandbox events (dev-mode floors only), fetch the latest occupancy, then poll with a moving from cursor. Each run of the cursor request advances it, just like a production poller.
AnalyticsoccupancyPerHour with skip/take paging. Defaults to yesterday (UTC), and re-running the request pages through the results.
Space sensorsCapability and unit discovery, then the latest readings across your sensors.
Sensor healthActive area sensor installations with serial numbers and connection status.
WebhooksLists your registered webhooks and their delivery configuration.

Prerequisites

  • Each folder needs its feature enabled for your organisation.
  • Generate Occupancy Changes needs a dev-mode floor and a WritePublicApi key. See Test data without live sensors.
  • Analytics data becomes available the day after collection, so a brand-new sandbox returns an empty analytics page until it has a day of history.

The collection lives alongside these docs and is updated with them, so re-download it if the schema has moved since you imported it.