This endpoint allows you to get a access token based on your api key

To invoke one of our API endpoints, you must include the Bearer token in the requests header for authorization. Use the Authorization header with the Bearer <token> value.

The token should be obtained using the login endpoint presented next.

Reference Endpoint

  • POST /login

Success Scenario

  • The Request Payload

The request payload is straightforward, as seen in this example request.

{
    "accessKey" : "986d8167a9b9a15e37db4ab4ad50877b01347a94",
    "secret" : "79bPqahzbeYuIgyod1GBjsBy38wN7KuBBNNmN/emwjFCuAfq"
}
  • The Request Fields
FieldTypeRequiredDescription
accessKeystringtrueThe access key created in the admin portal
secretstringtrueThe secret associated to the key
  • Success Response (201 - Created)
eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9.eyB1aWQiOiI2NWQwZjVjOS03ZmIwLTQ1NWMtOTAzNi05ZTcyZjBhOGQwZjYiLCJhciI6WyJQYXJ0bmVyIiwiUGFydG5lckFkbWluIl0sImFrIjoiNDU3NzFlYTEtYjAxMi00YjgwLThiYTQtNDk4OTFjNWQ4ZDQ3IiwicmVhbG0iOiJQYXJ0bmVyIiwiY2EiOiIwZWE3MDAwMS0wZjU4LTQ0YTItODBhZC05NTM2MzNmZjJjYzciLCJjaWQiOiIyOTI2MzczOS0yY2Y4LTQ4M2QtYWYxNS02MTUxZGM4NDQ4YjQiLCJkb21haW4iOiIvcGFydG5lcnMtaW50IiwiaWF0IjoxNjkxMTUxMjU3LCJleHAiOjE2OTExNTQ4NTd9.wBdfxnNYap0_M-omZUmnor7lB6c3ooVK2AENYtsIcfLzofW5bvkYgQzhaVABtJsU

Failure Scenario (Useful Examples)

Scenario 1: Empty required field (secret)

{
    "accessKey" : "{{api_key}}"
}
  • Failure Response (400 - Bad Request)
{
  "statusCode": "Error",
  "error": {
    "name": "InvalidRequestFormatError",
    "message": "The request body is invalid. See error object `details` property for more info",
    "details": [
      {
        "path": "",
        "code": "required",
        "message": "must have required property 'secret'",
        "info": {
          "missingProperty": "secret"
        }
      }
    ]
  }
}

Scenario 2: Authentication Failure

If the request includes an invalid key or a key in pending or expired state, the following error will be returned.

  • Failure Response (401 - Unauthorized)
{
  "statusCode": "Error",
  "error": {
    "message": "Service was unable to complete your request.",
    "name": "AuthenticationError",
    "code": "AuthenticationError",
    "details": {
      "reason": "AccessKeyUnauthorized"
    }
  }
}