All Products
Search
Document Center

Refresh Token

Last Updated: Jun 11, 2020

When Access Token is about to expire, use RefreshToken to get new Access Token.

API

POST /api/v1/token

Request Parameter

Body

Content-Type: application/x-www-form-urlencoded

name type Required Description
grant_type String False Fixed string “client_credentials”
refresh_token String True Refresh credentials
scope String False New Access Token permissions. Multiple permissions are separated by spaces. Default is the full permissions of Refresh credentials.
access_token_lifetime Integer False The valid period of New Access Token,unit is second. Default is 1 hour, and maximum value is 12 hours.

Response

name type Description
token_type String Access Token type, use fixed value “bearer”
access_token String Access Token
expires_in Integer The valid period of New Access, unit is second

Examples

Request Example

  1. curl -X POST "http://gateway.e2ehmfqasth.aliyunbaas.top:31113/api/v1/token" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=refresh_token&scope=&refresh_token=<Your URL Encoded Refresh Token>"

Example of Normal Return

  1. {
  2. "token_type": "bearer",
  3. "access_token": "eyJhbGciOi...rk6I",
  4. "refresh_token": "",
  5. "expires_in": 3600
  6. }

Error Code

Please refer to Error Code