API Authorisation Steps

Prev Next

1. Acquiring Your Admin Bearer Token and Correlation ID

Using the navigation bar, click on your Learn page. Once inside of here, open up Developer Tools in Chrome. Once inside Dev Tools, you're going to want to open up the network tab. You'll then want to look for one of the objects inside of here, I chose user?AuthorityToken. Inside here, you'll then need to scroll and find "Authorization:". Inside here, you'll have to copy the entire value, including Bearer.

Note:

Bearer Tokens expire every 60 minutes.

If you scroll a little further down, you'll see "Correlation-Id:". Again, copy the entire value in this section.

Screenshot of the THRIVE Learn page and Chrome DevTools network panel — left shows the Learn UI, right shows DevTools with a request selected and the Headers panel highlighted displaying an Authorization header containing a Bearer token and a Correlation-Id

2. Acquiring Your API Key

Once you have the two values above, you'll need to use Postman or an API Platform of your choice to run a POST call.

POST URL

Staging: https://tenant.api.learnstaging.link/tenants

Production: https://tenant.api.link/tenants

Body (GraphQL)

mutation {
    generateApiKey (
        tokenType: "permanent", services: ["api-service"]
    ) {
        validUntil,
        apiKey
    }
}

Headers

You'll need to add two headers:

  • Authorization (your Bearer token goes here)

  • correlation-id (your correlation-id goes here)

Postman Headers tab screenshot showing a POST request to a tenant API; table of headers includes Authorization with a Bearer token value and correlation-id with a UUID value

Response Body

The response body will then contain your API Key

3. Authorisation

Once you've obtained your apiKey. Our calls are authorised using Basic Auth (Username & Password).

For the username, you will need your Thrive site tenant ID. To obtain this using the navigation bar, click on your Logo on the top right. Open up Developer Tools in Chrome. Once inside Dev Tools, you're going to want to open up the element tab and look for the following:

<img class="LogoMenuItem-tenantLogo___LoR6e" src="https://tenant.assets.thrivesandbox.com/v2/eu-west-2_xxxxxxx/cxteam.thrivesandbox.com/logo-light.png?16705080401021" alt="CX Team Sandbox logo Homepage Link">

Screenshot showing the Thrive site header on the left and Chrome DevTools Elements pane on the right with the tenant logo IMG element and its src URL highlighted (contains 'eu-west-2_xxxxxxx').

  • Username = Your Tenant ID (eu-west-2_xxxxxxxxx)

  • Password = Your apiKey