A public mirror of U21's API documentation, with a Postman collection.
Unit21's API documentation uses the openAPI specification. The API reference is hosted on an interactive website, where you can explore calls to different endpoints.
As the OAS spec is very portable, Unit21 has made a copy of it available in this repo. For most customers, the interactive site is the best way to explore the documentation. However, some customers might find it useful to have a spec on hand, to do things like create a mock server, or simply explore the API using a different parser.
Additionally, there's also a Postman collection available, which includes a few calls that cannot be tested on the site (e.g. bulk event creation).
Just download the file at openapi.yaml. Note that this is a copy of an internal version. It's not guaranteed to be as up-to-date as the version found on https://guide.unit21.ai/ .
-
Download the collection in this repo.
-
In Postman, select Import and import the collection JSON file (in v2.1 format).
-
Configure collection variables. Click on options for the imported collection and select "Edit".
-
Populate the collection variables:
baseURL
with your sandbox environment (should end with/v1
u21-key
with the API key that you generated from the Unit21 dashboard.orgName
with your organization name configured (passed to you by a Unit21 team member)
- To run a new test that avoids ID collisions, change the
randId
collection variable to a new value. For more convenience, you could create a collection-level script that automatically setsrandId
to be a random string upon running the first request in the collection e.g.
if (pm.info.requestName == 'create userA') {
var uuid = require('uuid')
randId = uuid();
pm.collectionVariables.set('randId', randId);
}
- If you encounter
423 LOCKED
responses from the API on update or get API requests, the requested object is still being processed. Retrying the request after a delay should result in a successful request.- The
(OPTIONAL) Sleep 5 S
requests are included in the collection to avoid424 LOCKED
responses when running the collection requests in quick succession i.e. using Postman Collection Runner.
- The