Get tokens
Trade a sign-in code or a refresh token for an access token.
POST
Trades an authorization code, or a refresh token, for an access token and a new refresh token. Apps are public clients, so there's no client secret.
A code works once and for 5 minutes. A refresh token works once: the response has the next one. Sending a used code or refresh token again disconnects the app, since someone else may have a copy.
Each address gets 60 requests a minute.
application/x-www-form-urlencoded- body
grant_type*stringValue in
"authorization_code""refresh_token"client_id*stringcode?stringFor authorization_code.
code_verifier?stringFor authorization_code. The PKCE verifier.
redirect_uri?stringFor authorization_code. The one the code was sent to.
refresh_token?stringFor refresh_token.
resource?stringOptional. When sent, it must be the one the app connected to.
New tokens.
application/json- response
access_token*stringtoken_type*"Bearer"Value in
"Bearer"expires_in*integerSeconds the access token lasts.
refresh_token*stringscope*stringread write for full access, read for read-only.
curl -X POST 'http://localhost:8080/oauth/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=authorization_code&client_id=string'Example Response
{
"access_token": "unm_at_3h9Xk2mQ7vR1tY8wL4pZ6nB0cF5dJ2sA",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "unm_rt_8kP2vN5xQ1mW7tR4yL9zB3cH6dF0sJ2a",
"scope": "read write"
}