Skip to main content
POST
Exchange auth code or refresh token for access token
client_idclient_secret 必须在请求体中传递,不支持 Basic Auth Header。

使用场景

1. 用授权码换取 Token

用户在授权页面同意后,你的 redirect_uri 会收到 code 参数。用它换取 access token:

2. 用 Refresh Token 续期

Access token 有效期 1 小时。过期后用 refresh token 获取新的 token 对:
Refresh token 每次使用后会自动轮换(rotation),旧 token 立即失效。请务必保存响应中返回的新 refresh_token

常见错误

请求体

application/json
grant_type
enum<string>
必填
可用选项:
authorization_code,
refresh_token
client_id
string
必填

Application UUID

client_secret
string
必填

Application secret

code
string

Authorization code (required for authorization_code grant)

redirect_uri
string

Must match the original authorization request

refresh_token
string

Refresh token (required for refresh_token grant)

响应

Token pair issued

access_token
string
必填
token_type
string
必填
示例:

"Bearer"

expires_in
number
必填
示例:

3600

refresh_token
string
必填
scope
string
必填