Skip to main content
Skip table of contents

Authentication

You can use the OAuth 2.0 Client Credentials flow to authenticate with the Cyclr API.

There are certain values you need to use in order to make calls to the Cyclr API:

  • API domain {CyclrAPIDomain}

  • Access token {access_token}

  • Account API ID {API_ID}

  • Client ID and Client Secret {client_id}, {client_secret}

  • Service domain {YourServiceDomain}

API domain

The API domain you use to make calls to Cyclr’s API depends on where your Cyclr Console is hosted.

See here for details on how to identify the domain.

Replace {CyclrAPIDomain} in the example calls below with the correct API domain for your Cyclr Partner Console’s location.

Access token

All calls to the Cyclr must provide the access token in the Authorize HTTP request header:

CODE
Authorization: Bearer {access_token}

Tokens expire after 14 days, so remember to generate a new one when necessary.

Request

Once you have a Client ID and Client Secret, you can call the Cyclr API OAuth token endpoint to generate an access token.

CODE
POST https://{CyclrAPIDomain}/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}

Parameters

These are passed in the Request Body:

Parameter

Description

grant_type

Use client_credentials to identify the OAuth flow.

client_id

Enter the Client ID to identify which Cyclr Partner the token is for.

client_secret

Enter the matching Client Secret for the Cyclr Partner.

Example Response

CODE
{
    "token_type": "bearer",
    "access_token": "************",
    "expires_in": 1209599,
    "clientId": "************"
}

Response parameters

Parameter

Description

token_type

The type of token is always bearer.

access_token

The token you can then use to make requests to the Cyclr API.

expires_in

The amount of time in seconds until the access token expires (14 days).

clientId

The Client ID you provided when you made the request.

Account API ID

For calls to Cyclr API endpoints that relate to an account, you need to provide the account’s API ID as an HTTP header in the request:

CODE
X-Cyclr-Account: {API_ID}

To view an account’s API ID in your Cyclr console, go to Accounts > Account Management and select the Settings icon for the account you want to work with.

Account restricted access tokens

You can restrict access tokens to only work for a specific account if you include the API ID in the scope when you make the access token request:

CODE
POST https://{CyclrAPIDomain}/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=abcdefg&client_secret=abcdefghij123&scope=account:{API_ID}

Client ID and Client Secret

To generate a Client ID and Client Secret from your Cyclr console:

  1. Go to Settings > OAuth Client Credentials.

  2. Select Generate Credentials.

  3. Write a description for the credential set, and select Ok.

The table displays the new Client ID next to the time you create it. To view the Client Secret, select the eye icon to the right side of the description.

Cyclr Console OAuth Client Credentials

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.