API Reference

PURPOSE

Thanks to the APIs for measuring the performance of your Marketing communications, proposed by the HubMessage program, you will be able to :

  • Know and analyze your CRM database and understand your customers,
  • Measure the health and progress of this CRM database on key communication KPIs (means of contacts, sports practitioners, etc…)
  • Measure the distribution of your communication actions and their relevance to users over a chosen period of time,
  • Measure key KPIs in an aggregated way for your perimeter over a chosen period (open rate, click rate, turnover,…),
  • Measure detailed KPIs per campaign / message.

All these APIs are mainly used to provide the Corporate dashboard for Marketing performance monitoring here : Marketing Dashboard

But they also give you all the autonomy you need to feed your own reporting or to integrate some information in existing tools.

What you can do ?

For that, we created specific APIs, which are:

  • List the different filters available in the APIs –> (Dashboard APIs)
  • Get detailed KPIs by campaign or message –> (Dashboard APIs)
  • Get aggregated KPIs from your CRM database –> (Community APIs)
  • Obtain aggregated KPIs from a user’s point of view on received communications –> (Contacted APIs)
  • Obtain aggregated KPIs of the performance of your communications (economic KPIs and relevance KPIs) –> (Performance APIs)

If your application already exists in the API Portal, go directly to the section : “FINAL STEP : COMMUNICATION KPI SUBSCRIPTION” at the bottom of this page.

PREREQUISITE 1 : HAVE A PROJECT DECLARED ON THE FEDERATION IDENTITY

To be able to use our API, you need to have a federation identity account. This account will allow you to authenticate your application in the Decathlon ecosystem.

Follow the steps below after clicking on the link :

  • 1. Go on preprod/prod login for your projects
  • 2. Create a new project and specify its information
  • 3. Create a OAUTH2 connexion type and choose service to service connection
  • 4. The flow is client credentials and add a description for this connection

Then, a page like below appears :

PLEASE BE SURE YOU COPY YOUR CLIENT SECRET (it appears only one time)

Now you have a client id and client secret you can simulate an authentication token in Postman

To do so, you need to encode your “clientID:secret” given above and get a token. Follow this link to encode

#Example for preprod
curl 
  -X POST 
  -H "Authorization: Basic bmV4dDpuZXh0Q2xpZW50U2VjcmV0" 
  -d "grant_type=client_credentials"

  "https://preprod.idpdecathlon.oxylane.com/as/token.oauth2"

In the response, you should get a JSON object containing the following fields:

  • access_token: access token for the user. This value must be secured.
  • token_type: type of token this is, typically just the string “bearer”.
  • Expires_in : number of seconds remaining, from the time it was requested, before the token will expire

    #Response 
    {
    "access_token":"2YotnFZFEjr1zCsicMWpAA",
    "token_type":"Bearer",
    "expires_in":3600,
    }
    

If an error parameter occur, refer to the values listed below.

  • invalid_request: Missing parameter or unsupported one
  • invalid_client: Invalid client ID or secret
  • invalid_grant: The call is invalid or expired, or the redirect URL given in the authorization grant does not match the URL provided in this access token request
  • invalid_scope: Invalid scope value in the request
  • unauthorized_client: This client is not authorized to use the requested grant type
  • unsupported_grant_type: If a grant type is requested that the authorization server doesn’t recognize

Click here for more examples

PREREQUISITE 2 : HAVE AN APPLICATION REFERENCED IN API PORTAL

Now that your application is authenticate in Decathlon ecosystem, you can connect your application to the API management portal in order to access our API

Register now on preprod and prod environment:

API Portal preprod access

API Portal prod access

Bonus: read the best pratices for a preproduction configuration

On header, click on your profile on the top-right corner and select applications

  • 1. Click on the button “+”
  • 2. Follow the steps :
    • Step 1 : Name your application and add a description
    • Step 2 : Define the type of your application and paste your client_id for the right environement (The one you received when you created your project on FEDID)

FINAL STEP : COMMUNICATION KPI SUBSCRIPTION

As you have now an offical application on the API Portal, you can search for “COMMUNICATION KPI” and subscribe to our API : “[Marketing] Communication KPI”

Direct Access

API Portal Communication KPI Preproduction access

API Portal Communication KPI Production access

API conventions

All data is sent and received as JSON

Country codes follow the is norme ISO 3166 with 2 char (ex : FR)
Language codes follow the norme ISO 639-1 with 2 char (ex : NL)