Auth

Retrieve an access token for programmatic access via OAuth2.0 Client Credentials Grant.

Token endpoint for OAuth2.0 Client Credentials Grant using your OAuth2.0 machine-to-machine client credentials for programmatic access to this API. See https://datatracker.ietf.org/doc/html/rfc6749#section-4.4

POSThttps://api.tradeaware.live-eo.com/auth/machine-to-machine-clients/token
Body
grant_type*string

The OAuth2.0 Grant Type that shall be used for authorization. Supported values: 'client_credentials'

Example: "client_credentials"
client_id*string

The client id of your OAuth2.0 machine-to-machine client

Example: "ABCAAAAAAAAAAAAAAAAAAAAAAAAAA123"
client_secret*string

The client secret of your OAuth2.0 machine-to-machine client

Example: "supersecret"
Response
Body
access_token*string

The JSON Web Token to be used for authentication and authorization with the API. See access_token at https://datatracker.ietf.org/doc/html/rfc6749#section-5.1

token_type*string
Example: "Bearer"
expires_in*number
Example: 86400
scopestring
Example: "create:example manage:users read:example"
Request
const response = await fetch('https://api.tradeaware.live-eo.com/auth/machine-to-machine-clients/token', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "grant_type": "client_credentials",
      "client_id": "ABCAAAAAAAAAAAAAAAAAAAAAAAAAA123",
      "client_secret": "supersecret"
    }),
});
const data = await response.json();
Response
{
  "access_token": "text",
  "token_type": "Bearer",
  "expires_in": 86400,
  "scope": "create:example manage:users read:example"
}

Last updated