CommandersAct API (2.0.0)

Download OpenAPI specification:Download

Information

This is the CommandersAct API Documentation.
This API uses JSONAPI specification to fetch, create and modify the resources, and to format responses.

It is highly recommended that you send multiple objects in one HTTP request. This API allows streaming using newline separated JSON format or ndjson

Rate-limits

  • You may send up to 30 requests per second
  • You may have up to 30 concurrent connections
  • If you send many conversions/products/etc. in bulk, the upload speed will be limited to 30 conversions/products/etc. per second

    Rate limiting examples

  • If you send 1 conversion per request you will be limited to 30 requests per second
  • If you send 90 conversions in one request your upload will be completed in about 3 seconds
  • If you send 40 requests, each with one conversion in the same second, 30 of them will be processed and 10 of them will be rejected
  • If you send 3 requests, each with 100 conversions they will be completed in 10 seconds

Date formats

Use the long format with timezone for passing ISO-8601 dates. The following formats are accepted:

  • "2019-04-29T13:47:47.315Z"
  • "2019-04-29T13:47:47Z"
  • "2019-04-29T13:47:47.315+02:00"
  • "2019-04-29T13:47:47+02:00"

Errors

Errors are always returned as an array of objects in the top-level "errors" property.

Errors in bulk operations

For bulk operations you may have "errors" and "data" properties at the same time since some objects may have errors while others may not. Bulk errors are aggregated which means there won't be an error for each instance of an error but one error for each type of error with the number of occurrences and some examples of line numbers or ids.

{
  "errors": [
    {
      "code": "YOU_CAN_CHECK_THIS_IN_CODE",
      "detail": "This explains the error",
      "meta": {
        "context_property_example": "value_example",
        "error_count": 3,
        "line_numbers": [34, 45],
        "ids": [
          "c9017b85-8016-4f13-88b4-18d57c67b866",
          "12e0c3cb-7e8d-462f-9232-f7c61a900738"
        ]
      }
    }
  ]
  "data": {
    "accepted_object_count": 4,
    "rejected_object_count": 3
  }
}

Error object

Error objects have the following properties

Property Type Required Description
code string true Always present and contains error code that can be checked programmatically
detail string true Human readable message that explains the problem. You should not check the value of this property programmatically because it may change
meta object false Error specific object that contains details about what generated the error

Authentication

UserAuthentication

This authenticate user to use the API You MUST send the token for each request in the Authorization header. The token MUST be preceeded by Bearer.

    GET https://api.commander1.com/v2/{siteId}/users HTTP/1.1
    Host: api.commander1.com
    Authorization: Bearer {mySecretToken}

You should replace "{mySecretToken}" in example with your Token.

You should replace "{siteId}" in example with your Site ID.

Security Scheme Type HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

DataAuthentication

This authenticate Data Account to use the API The API uses Token to authenticate its user. You MUST send the token for each request in the Authorization header. The token MUST be preceeded by Bearer.

    GET https://api.commander1.com/v2/{siteId}/users HTTP/1.1
    Host: api.commander1.com
    Authorization: Bearer {mySecretToken}

You should replace "{mySecretToken}" in example with your Token.

You should replace "{siteId}" in example with your Site ID.

Security Scheme Type HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

Sources

List source categories

Usage

List source categories

Authorizations:

Responses

Request samples

http GET https://api.commander1.com/v2/REPLACE_SITEID/source-categories \
  Authorization:'Bearer REPLACE_BEARER_TOKEN'

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

List Catalog Sources

Usage

List Catalog Sources

Authorizations:
query Parameters
include
Array of strings
Items Value: "categories"
Example: include=categories

Relation available: categories

Responses

Request samples

http GET 'https://api.commander1.com/v2/REPLACE_SITEID/source-catalog?include=SOME_ARRAY_VALUE' \
  Authorization:'Bearer REPLACE_BEARER_TOKEN'

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

List Sources

Usage

List Sources

Authorizations:
query Parameters
include
Array of strings
Items Enum: "connector" "environment" "health"
Example: include=connector,environment,health

Relation available: connector - environment

Responses

Request samples

http GET 'https://api.commander1.com/v2/REPLACE_SITEID/sources?include=SOME_ARRAY_VALUE' \
  Authorization:'Bearer REPLACE_BEARER_TOKEN'

Response samples

Content type
application/vnd.api+json
{
  • "data": [
    ]
}

Create Source

Usage

Create Source

Authorizations:
Request Body schema: application/vnd.api+json
object

Responses

Request samples

Content type
application/vnd.api+json
{
  • "data": {