PIM Akeneo Integration API Authorization

For PIM version v4 or newer, we can follow the below steps:

  1. Log into your favorite PIM.
  2. Depending on the version you use, go to the System/Connections menu (before the v6) or the Connect/Connection settings menu.
  3. Click on Create.
  4. Input a label for your connection, ERP for example.
  5. Select a type flow. 
  6. Click on Save.

The Client Id , secret, user name and password will be created.

The API call to get the token:

curl -X POST http://your-host/api/oauth/v1/token 
        -H "Content-Type: application/json" 
        -H "Authorization: Basic YOUR_BASE_64_CLIENT_ID_AND_SECRET" 
        -d '{
            "grant_type": "password",
            "username": "your_API_username",
            "password": "its_password"
        }'
    

Response sample:

HTTP/1.1 200 OK
    
    {
        "access_token": "NzFiYTM4ZTEwMjcwZTcyZWIzZTA0NmY3NjE3MTIyMjM1Y2NlMmNlNWEyMTAzY2UzYmY0YWIxYmUzNTkyMDcyNQ",
        "expires_in": 3600,
        "token_type": "bearer",
        "scope": null,
        "refresh_token": "MDk2ZmIwODBkYmE3YjNjZWQ4ZTk2NTk2N2JmNjkyZDQ4NzA3YzhiZDQzMjJjODI5MmQ4ZmYxZjlkZmU1ZDNkMQ"
    }
  • access_token must be included in every request to the REST API for the client application to be authorized (see the example below).
  • expires_in is the token lifespan (in seconds). By default, it lasts 1 hour.
  • refresh_token is a special token used only to refresh your access_token after it expired.

Leave a comment

Your email address will not be published. Required fields are marked *