curl --request POST \
--url https://app.trelica.com/connect/token \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'scope=<string>' \
--data 'code=<string>' \
--data 'redirect_uri=<string>' \
--data 'refresh_token=<string>'{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "Users.Read offline_access",
"refresh_token": "8xLOxBtZp8..."
}Request an access token
Exchanges client credentials (or an authorization code / refresh token) for an access token. The client ID and secret are sent via HTTP Basic authentication. The body is application/x-www-form-urlencoded.
- Client Credentials:
grant_type=client_credentials(optionalscope). - Authorization Code:
grant_type=authorization_codewithcodeandredirect_uri. - Refresh:
grant_type=refresh_tokenwithrefresh_token(requires theoffline_accessscope).
curl --request POST \
--url https://app.trelica.com/connect/token \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'scope=<string>' \
--data 'code=<string>' \
--data 'redirect_uri=<string>' \
--data 'refresh_token=<string>'{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "Users.Read offline_access",
"refresh_token": "8xLOxBtZp8..."
}Authorizations
HTTP Basic authentication: the client ID and client secret, joined with a colon and Base64-encoded (RFC 7617).
Body
The OAuth 2.0 grant type.
client_credentials, authorization_code, refresh_token Space-separated scopes to request. Defaults to all scopes configured for the app.
The authorization code (Authorization Code flow).
Must match the redirect URI from the authorization request (Authorization Code flow).
The refresh token (Refresh flow).
Response
The access token.
The access token to send as a bearer token on API requests.
The token type; always Bearer.
The token lifetime in seconds (access tokens expire after ~60 minutes).
The space-separated scopes granted.
A refresh token (Authorization Code flow only, when offline_access was requested).
Was this page helpful?