Skip to content

Overview

This section outlines the steps to generate an access token for calling the Mirakl Connect Channel APIs.

Authentication

Requesting the APIs credentials

Before starting, request a client ID and client secret from your Mirakl Partner team contact. Securely store these credentials, as they enable your integration to generate the access token.

Generating and using the access token

This section explains how to use the provided credentials to generate access tokens and call the Mirakl Connect Channel APIs.

Generating the access token

To obtain the access token, call the Mirakl Authentication System as follows:

FieldDescription
MethodPOST
Endpointhttps://auth.mirakl.net/oauth/token
Content-Typeapplication/x-www-form-urlencoded
Parameters- grant_type: must be equal to client_credentials
- client_id: your client ID
- client_secret: your client secret

All parameters are mandatory.

If everything works as expected, the Mirakl Authentication System:

  • Generates an access token
  • Returns a 200 status with a JSON response structured as follows:
{
  "token_type": "Bearer",
  "access_token": "***********",
  "expires_in": 3599,
  "target_app": "",
  "resource_owner": ""
}
FieldDescription
token_typeType of token. In this workflow, the token is always a "Bearer" type token
access_tokenThe Bearer token required to call the Mirakl Connect API
expires_inThe token's Time To Live (TTL), in seconds

Best practice

The access token is valid for a defined period. It is best practice to run this process a few minutes before the expires_in value.

Using the access token

To call the APIs to which you have access, send an "Authorization" HTTP header in the following format: Authorization: Bearer <access-token>

The REST APIs reference provides all the information you need to use the APIs.