[POST] Client Credentials Access Token

Use this request to obtain an access token to authenticate against the SmartDocumentor API.

We use the client credentials OAuth2.0 flow for authentication with external client applications.

To find out how you can obtain your own Client ID / Client Secret pair, check the Create Secrets section.

Re-using access tokens

While the API allows you to request as many access tokens as necessary, it is recommended to cache the access token for performance. Only request a new token once the previous one expires.

Client Credentials Access Token

POST /connect/token

Body

Name
Type
Description

grant_type

client_credentials

The grant type used to request the token. Always "client_credentials" as per the client credentials flow

scope

WebAPI

Age The scope(s) used to request access. MUST always be "WebAPI".

client_id

{your Client ID}

Your Client ID, tied to your organization.

client_secret

{your Client Secret}

Your Client Secret, tied to your Client ID.

Example Request

curl --location 'https://cloud.smartdocumentor.net/connect/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'grant_type=client_credentials'
--data-urlencode 'scope=WebAPI'
--data-urlencode 'client_id={your Client ID}'
--data-urlencode 'client_secret={your Client Secret}'

Responses

{
    "access_token": "your access token",
    "expires_in": 3600,
    "token_type": "Bearer",
    "scope": "WebAPI"
}

Response Body AccessTokenResponse

Name
Type
Description

access_token

string

Your new access token. Add this to future requests as a Bearer token to perform authenticated requests against the API.

expires_in

integer

Tokens have a default expiration time of 3600 seconds (1 hour).

token_type

string

The type of token you issued. Always "Bearer".

scope

string

The scopes your access token has access to, seperated by spaces. Will always be "WebAPI".

Getting invalid_client errors?

Check if your Client ID and Client Secret pair is correct and has not expired. Head to the Create Secrets section to learn more.

Last updated