Authentication OAuth2 for event and channel managers
OAuth2: How to obtain the access token for Event and Channel Managers
If you are a Event or Channel Manager you may need to manage the Events and Channel of your entity, in order to can do this you can get the Oauth token for access to Api Management in the following way:
The Url where to do the request for pre environment is https://oauth2-pre.oneboxtickets.net/oauth/token . See environments
Next, we are going to prepare the required headers.
- Content-Type:
application/x-www-form-urlencoded
- Content-Type:
Finally, we indicate the request parameters to obtain the authorization's token:
- grant_type:
client_credentials
- client_id:
onebox-client
- client_secret: [api_key_provided]
- grant_type:
For example with curl:
curl --location --request POST 'https://oauth2-pre.oneboxtickets.net/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=onebox-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"
}