API Reference

PURPOSE

Thanks to the APIs for managing your marketing communications, proposed by the HubMessage program, you will be able to :

  • Referencing and making available your marketing campaigns,
  • Structure and categorize your different marketing messages (sport, classification, model code present, …),
  • Associate your messages with the content sent whatever the sending platform (Salesforce, …),
  • Associating and grouping marketing messages within campaigns,
  • Search and retrieve the list of campaigns and their details according to different search criteria.

All these APIs are mainly used to expose Data though APIs and the datalake and also provide the Corporate dashboard for Marketing performance monitoring here : Marketing Dashboard

What you can do ?

For that, we created specific APIs, which are:

  • List the different contents available in the different platforms
  • Create / update / delete a message
  • Get the detailed information of a message
  • Search and get messages by specifying criterias
  • Create / update / delete, get a source (Salesforce, …)
  • Create / update / delete a campaign (agreggate of several messages)
  • Get the detailed information of a campaign (agreggate of several messages)
  • Search and get campaign (agreggate of several messages) by specifying criterias

If your application already exists in the API Portal, go directly to the section : “FINAL STEP : CAMPAIGN MANAGEMENT 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 : CAMPAIGN MANAGEMENT SUBSCRIPTION

As you have now an offical application on the API Portal, you can search for “CAMPAIGN MANAGEMENT” and subscribe to our API : “[Marketing] Campaign Management API”

Direct Access

API Portal Campaign Management Preproduction access

API Portal Campaign Management 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)