Skip to main content

Seller channel clients authentication

How to obtain the Distribution API and API Catalog OAuth2 access token for a sales channel

With the new API-KEY authentication system you can get the Oauth token for a sales channel more easily

  • The Url where to do the request is https://oauth2-pre.oneboxtickets.net/oauth/token

  • Next, we are going to prepare the required headers.

    • Content-Type: application/x-www-form-urlencoded
  • Finally, we indicate the request parameters to obtain the authoritation's token:

    • grant_type: client_credentials
    • channel_id: [channel_id_provided]
    • client_id: seller-channel-client
    • client_secret: [api_key_provided]

For example with curl:

curl --location --request POST 'https://oauth2.oneboxtds.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'channel_id=123' \
--data-urlencode 'client_id=seller-channel-client' \
--data-urlencode 'client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

If all it's correct, OAuth returns a structure as this:

{
"access_token": "xxxxxxxxxxxxxxxxx",
"token_type": "bearer",
"refresh_token": "xxxxxxxxxxxxxxx",
"expires_in": 43199,
"scope": "api-channels-all api-gateway",
"authInfo": "xxxxxxxxxxxxxx",
"jti": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
access_token is our token with a limit of 12 hours of expire. Congralutions!.