Customer API / Get started

Quickstart with Postman

Create a restricted integration, import its generated package, discover authorized data, and send one aggregate request.

In this article

Before you begin

You need access to Dashboard > Settings > Customer API and permission to create or download a package for an integration. Install Postman on Linux, Windows, or macOS.

Treat a generated package as a secret. Do not commit it, paste its JWT into a ticket, or send it through chat. Request a replacement package when needed.

Import the package

  1. Open Dashboard > Settings > Customer API.
  2. Create an integration and restrict it to only the required sites and lines.
  3. Download the ZIP and import both the collection and environment JSON files into Postman.
  4. Use Postman's environment selector to select IOTSnap Customer API. Selecting only the collection is not enough.
  5. Open a request and inspect Variables. Values such as {{siteId}}, {{lineId}}, and {{pageSize}} must resolve from the imported environment.

Remove conflicting global or collection variables instead of copying the JWT into them. The imported environment is the intended owner of generated values.

Discover authorized data

Send Discover reachable hierarchy and exportable tags first. A successful response fills the site, line, machine, tag, and machine-queue environment values used by later requests.

Discovery also stores every authorized machine in machineTargets. The Read every discovered machine request uses machineIndex to repeat itself in Collection Runner. Selecting Send executes only the currently selected machine.

Send an aggregate request

Open the aggregate data request populated by discovery and select Send. A successful response has an aggregation object, one or more logical series, and time-varying values in each series' points array.

Edit the imported environment when changing reusable values such as from, to, aggregationIntervalSeconds, or pageSize. Keep request URLs in {{variableName}} form and rerun discovery after scope or hierarchy changes.

Verify the result

Confirm that the response status is 200, aggregation.method is timeWeightedLocf, and every returned tagGuid came from discovery. A null nextCursor means the current traversal is complete.

Troubleshoot an unresolved Postman variable

If Postman displays {{siteId}} in the outgoing URL, confirm that IOTSnap Customer API is selected. Open the environment, verify that the variable has a current value, and rerun discovery.

Remove a same-named global or collection variable if it overrides the generated environment value. Do not resolve the conflict by pasting a JWT into a request, collection, or global variable.

Next steps

Read integrate with the Customer API for shared request formats, paging, and limits. Use the aggregate data API reference for complete parameter and response semantics.