Skip to main content
All CollectionsIntegrationsAPI
How to authenticate API requests
How to authenticate API requests

This article helps you getting started with the API integration

Andreas Viklund avatar
Written by Andreas Viklund
Updated over 2 years ago

We use the OAuth 2.0 protocol for authentication and authorization. To be able to access the API, you need to obtain an access token. The access token is valid for 60 minutes (3600 seconds).

We use different endpoints and API credentials for our staging and production environment:

Credentials

The credentials for the API are found in our Last Mile Platform. Log in to the platform and navigate to 'Account' and 'API Credentials'.

Copy 'Client ID' and 'Client Secret'. This is specific to the account and will be used for all delivery groups on the account. You can easily reset your Client Secret.

POST /oauth/token

{
"audience" : "https://gordonapi.herokuapp.com/",
"client_id" : "<CLIENT_ID>",
"client_secret" : "<CLIENT_SECRET>",
"grant_type" : "client_credentials"
}

Successful response

{
"access_token" : "eyJhb...",
"scope" : "general",
"token_type" : "Bearer",
"expires_in" : 3600
}

Unsuccessful response

{
"error" : "access_denied",
"error_description" : "Unauthorized",
}
Did this answer your question?