Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant
Ask AI
Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant
Body
-
Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token.
-
A 34 character string that uniquely identifies this OAuth App.
-
The credential for confidential OAuth App.
-
JWT token related to the authorization code grant type.
-
The redirect uri
-
The targeted audience uri
-
JWT token related to refresh access token.
-
The scope of token
POST
/v1/token
curl \
--request POST 'https://oauth.twilio.com/v1/token' \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'ClientId=OQ7cda1a615f05a95634e643aaaf7081d7&ClientSecret=sUWblrQ4wx_aYkdAWjHXNvHinynkYOgBoiRyEQUeEntpgDEG47qnBFD98yoEzsTh&GrantType=client_credentials&RedirectUri=&Audience=&Code=&RefreshToken=refresh_token&Scope=scope'
Request example
{"ClientId" => "OQ7cda1a615f05a95634e643aaaf7081d7", "ClientSecret" => "sUWblrQ4wx_aYkdAWjHXNvHinynkYOgBoiRyEQUeEntpgDEG47qnBFD98yoEzsTh", "GrantType" => "client_credentials", "RedirectUri" => "", "Audience" => "", "Code" => "", "RefreshToken" => "refresh_token", "Scope" => "scope"}
Response examples (201)
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"refresh_token": "ghjbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"id_token": "eyJhbdGciOiIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"expires_in": 1438315200000,
"token_type": "bearer"
}