Get an access token
Send aPOST to the token URL:
Your tool may ask for the client ID and client secret as form fields instead of a header. The token URL accepts
client_id and client_secret in the body too. Use one or the other.The response
200 OK
Reuse a token until it expires
An access token works for an hour. Keep it and reuse it for every request in that hour. Don’t ask for a new one before each request: the token URL is rate limited. There are no refresh tokens. When a token expires, or a request answers401, ask for a new token the same way.
Ask for fewer scopes
Withoutscope, a token carries every scope the client secret holds. To get a token that can do less, name the scopes you want:
Send the access token
Send the token in theAuthorization header of every request:
401.
When the token URL refuses
The token URL answers errors in the OAuth 2.0 shape, which differs from the rest of the API:401 Unauthorized