Refresh Access Token

The default validity period of an Access Token is 2 hours (7200 seconds), with a maximum of 24 hours (86400 seconds). After expiration, user re-authorization is required to obtain a new Access Token. This step enables automatic renewal of authorization, avoiding the need for users to re-authorize and improving the user experience.

# Request Description

POST https://{your_domain}/api/v1/oauth2/token

# Request Headers

Parameter Name Chinese Name Required Example Value Description
Authorization Authentication Information Required Basic UnFCMNOWk9xWA== Use client_id and client_secret for base64 authentication,
format: base64(client_id:client_secret)
Content-Type Data Type Required application/x-www-form-urlencoded Submit parameters using form format

# Request Example

POST https://{your_domain}/api/v1/oauth2/token

Authorization: Basic UnFCMkhKdGt6bFU...aT0NObkk4NlNOWk9xWA==

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

grant_type=refresh_token&refresh_token=wuGzSMMTjb4YhRUOjXHj-t-QD84

# Request Parameters

Parameter Name Chinese Name Required Example Value Description
grant_type Grant Type Required refresh_token This value is fixed as refresh_token
refresh_token Refresh Token Required wuGzSMMTjb4YhRUOjXHj-t-QD84 The refresh token has a maximum validity of 30 days

# Return Example

Correct Return Example
HTTP Status: 200 OK
{
	"access_token": "Z43T3KWH9lecmy3H1IaCI...XRmsXaA",
	"token_type": "Bearer",
	"refresh_token": "WEAFOmOJ-A4LOhF_I39DvJuqxP0...XkFlFA",
	"expires_in": 7199,
	"scope": "get_user_info"
}

Incorrect grant_type parameter value
HTTP Status: 400 BAD REQUEST
{
	"error": "unsupported_grant_type",
	"error_description": "Unsupported grant type"
}

Incorrect refresh token value
HTTP Status: 400 BAD REQUEST
{
    "error": "invalid_grant",
    "error_description": "Invalid refresh token: wuGzSMMTjb4YhRUOjXHj-t-QD84"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

# Return Parameters

If the return is successful, the Access Token can be obtained from the return information.

Parameter Name Chinese Name Required Example Value Description
access_token Authorization Token Required 3oDi8mk0q9mnTpGxcHu3Gi_vX4o The authorization token returned by the authorization server to the third-party application.
expires_in Validity Period of Authorization Token Required 7199 The validity period of the access ticket returned by the authorization server to the application. Note: The validity period is in seconds.
refresh_token Refresh Token wuGzSMMTjb4YhRUOjXHj-t-QD84
token_type Token Type Required Bearer
scope Authorization Scope Required get_user_info

I am ready. Please provide the Markdown content for translation.