API authentication & token

Here's the method in order to retrieve an access token.

1. Account creation

First, you need to create a PIM account that will be used to authenticate. Authentication with this account will return an access token.
This account must be created with the help of an administrator account or from any account that has sufficient permission to create a user.
The username and password should be used for a unique job, as every authentication will remove older access token.

2. Login and access token delivery

In order your job to retrieve an access token, here's the call that need to be done :

curl --location --request POST 'https://PIM_INSTANCE.quable.com/api_1.php/sessions' \
--header 'Content-Type: application/json' \
--data-raw '{
    "signin" : {
        "username" : "API_JOB_USER",
        "password" : "API_JOB_PASSWORD"
    }
}'

If successful, the response http header will be 201
The response body will contain several information but access token can be found through this path : *oauth.access_token

{
  ...,
  "oauth":{
    "access_token": "94fa500c0fbd121480e46690e733453f",
    "expires_in": 3600,
    "refresh_token": null
  }
}

Once this token is retrieved, it should be used as a Bearer Access Token.
Examples in this cookbook are using those tokens and will be shown in cUrl examples as parameter:

-H "Authorization:Bearer OAUTH_ACCESS_TOKEN" \