Generating access token

With your API client you can now generate access token. 

In order to do that you need to send a POST request on
https://<your_traffit_name>.traffit.com/oauth2/token including following parameters:

client_id:
 It's your client name which you have created before. 

client_secret:
 It's a Client Secret generated by Traffit for a client which you have created before. 

grant_type:
 You need to type a password here 

username:
 Your Traffit username which you use for logging into Traffit system.

password:
 Your Traffit password which you use for logging into Traffit system.

scope:
 One of the scopes which you chose for a client.
 Example: employee

Example cURL request: 

curl -X POST \
 
https://<your_traffit_name>.traffit.com/oauth2/token \
  -F client_id=
<your_client_name> \
  -F client_secret=
<your_client_secret> \
  -F grant_type=
password \
  -F username=<
your_Traffit_username> \
  -F password=<
your_Traffit_password> \
  -F scope=employee

The response will contain an access token which is valid for one hour.

Example response:
{
    "access_token": "<
your_access_token>",
    "expires_in": 3600,
    "token_type": "Bearer",
    "scope": "employee",
    "refresh_token": "<
your_refresh_token>"
}

From now on,  you can start using our integration API. 

Did this answer your question?