Refresh accessToken
The access_token is the credential for calling authorized APIs. Since the access_token has a short validity period, you can use refreshToken to refresh it when the accessToken expires.
The refresh_token has a longer validity period (2 months). When the refresh_token expires, user re-authorization is required.
# Request Specification
HTTP Method: POST + application/json
Request URL: https://${Cloud Domain}/oauth2.0/token?thirdTraceId=${Random String}
# Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| grantType | String | Yes | Authorization mode, fixed value: refresh_token |
| appId | String | Yes | App ID of the self-built application |
| appSecret | String | Yes | App secret of the self-built application |
| refreshToken | String | Yes | The refreshToken returned by the get token API |
# Request Example
{
"grantType": "refresh_token",
"appId": "FSAID_xxxxx",
"appSecret": "982axxxxx",
"refreshToken": "xxxxxx"
}
# Response Parameters
| Parameter | Required | Description |
|---|---|---|
| openUserId | Yes | User's openUserId |
| accessToken | Yes | Authorization token with 2-hour validity |
| refreshToken | Yes | Used to refresh accessToken, valid for 2 months |
| expiresIn | Yes | Expiration time |
# Response Example
{
"openUserId": "FSUID_xxxxx",
"accessToken": "FSTOK_xxxxx",
"refreshToken": "FSREFTOK_xxxxx",
"expiresIn": 7200,
"errorCode": 0,
"errorMessage": "success",
"traceId": "E-O.fkxxxxxx8bd6"
}