/authenticate/token/login
Once you’ve been issued a client ID and client secret, you will be able to generate a bearer token which you will then use to associate your access with a specific role that has been configured for your account.
Request:
curl 'https://sandbox.vertalo.com/authenticate/token/login?client_id=<client ID>&client_secret=<client secret>'
Response:
{
"token": {
"token_type": "Bearer",
"access_token": "<token>"
},
"roles": {
"data": [
{
"last_name": "example",
"user_role": "account_admin",
"account_type": "broker",
"account_name": "Example",
"user_id": "<UUID>",
"users_account_id": "<UUID>",
"first_name": "admin",
"account_id": "<UUID>",
"slug": "example",
"email": "admin@example.vertalo.com"
}
]
}
}
The data array within the roles object enumerates the account roles to which your API keys have been assigned as a delegate. You will use this information to select a specific account/role (see below) under which you will operate.
/authenticate/token/role
The /token/role endpoint allows you to select a role from a collection of available roles configured for your account. You will assume the rights of the chosen role when performing actions via the API, and the actions available to you will vary depending on the role you have selected. Using the response from the /token/login endpoint, use the values of the access_token and users_account_id fields to construct a request to the /token/role endpoint:
Request:
curl -H 'Authorization: Bearer <access_token>' 'https://sandbox.vertalo.com/authenticate/token/role/<users_account_id\>'
Response:
{
"token": {
"token_type": "Bearer",
"access_token": "<token>"
}
}
If you wish to assume a different account/role to which you have access, re-execute the /token/role call using the appropriate access_token and users_account_id values.