Public mirror of Unit21's API documentation.
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.
There is a Postman collection available, which includes a calls that cannot be tested on the site (e.g. bulk event creation).
-
Download the file at openapi.yaml.
-
Run
openapi preview-docs openapi.yaml. -
Open the local server in your browser.
-
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:
hostwith your sandbox environment, for examplesandbox2-api.unit21.comorsandbox1-api.unit21.com.protocolshould behttps.u21-keywith the API developer key.orgNamewith your organization name (passed to you by a Unit21 team member), for exampleunit_21.
- To run a new test that avoids ID collisions, change the
randIdcollection variable to a new value. For more convenience, you could create a collection-level script that automatically setsrandIdto 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 LOCKEDresponses 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 2 Srequests are included in the collection to avoid424 LOCKEDresponses when running the collection requests in quick succession i.e. using Postman Collection Runner.
