Generating access token

All endpoints are protected by a bearer access token passed through the Authorization header. The token endpoint is where apps make a request to get an access token using both Client ID and Secret.

To generate the Client ID and Secret, go to the Applications page and click on 'Security credentials' tab:

Then click on 'Create API credentials' and give a name to your credentials:

Click on 'Save and close' and you will be able to use the token endpoint below.

Note: when fetching the token by calling the endpoint below, make sure that the client id and secret are encoded in base64.

post
Get access token

https://incognia.inloco.com.br/api/v1/token
Uses the client_id and client_secret to generate an API token. It's important to realize that this token lasts 20 minutes, and you'll have to call this route again when it is expired.
Request
Response
Request
Headers
Content-type
required
string
application/x-www-form-urlencoded
Authorization
required
string
Basic Base64(client_id:client_secret)
Response
202: Accepted
Token successfully generated. Default expiration time: 20 minutes
{“access_token”: “<token>”, “expires_in”:“1200", “token_type”:“Bearer”}

Or you can simply use the following cURL command, replacing client_id and client _secret

curl -XPOST -u '<cliend_id>:<client_secret>' -H "Content-type: application/x-www-form-urlencoded" "https://incognia.inloco.com.br/api/v1/token"