All Products
Search
Document Center

Blockchain as a Service:Refresh Token

Last Updated:Mar 21, 2022

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

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

{
  "token_type": "bearer",
  "access_token": "eyJhbGciOi...rk6I",
  "refresh_token": "",
  "expires_in": 3600
}

Error Code

Please refer to Error Code