开放平台
交换、刷新令牌或签发机器人令牌
POST /v1/oauth2/token
POST
/v1/oauth2/tokenConfidential client 使用 HTTP Basic 或请求体 client_id/client_secret,二者不可同时使用;不接受 Cookie。body 支持 form-urlencoded 或全字符串 JSON,最大 16KiB,重复字段拒绝。授权码交换必须提交 S256 code_verifier;刷新令牌轮换,重放撤销整族。 绑定机器人的审核应用可使用 client_credentials 申请短期机器人 access token;该 grant 不签发 refresh token。
客户端凭据(HTTP Basic 或请求体)
请求体 必填
bodyobject
bodyobject方案 1 · object
client_idstring可选client_secretstring可选grant_typestring必填可选值
"authorization_code"codestring必填redirect_uristring必填格式:uri
code_verifierstring必填格式:^[A-Za-z0-9._~-]{43,128}$
方案 2 · object
client_idstring可选client_secretstring可选grant_typestring必填可选值
"refresh_token"refresh_tokenstring必填scopestring可选方案 3 · object
client_idstring可选client_secretstring可选grant_typestring必填可选值
"client_credentials"scopestring可选返回值
成功
access_tokenstring必填token_typestring必填可选值
"Bearer"expires_ininteger必填refresh_tokenstring可选scopestring必填接口信息
接口: POST /v1/oauth2/token
operationId: exchangeOAuthToken
Confidential client 使用 HTTP Basic 或请求体 client_id/client_secret,二者不可同时使用;不接受 Cookie。body 支持 form-urlencoded 或全字符串 JSON,最大 16KiB,重复字段拒绝。授权码交换必须提交 S256 code_verifier;刷新令牌轮换,重放撤销整族。 绑定机器人的审核应用可使用 client_credentials 申请短期机器人 access token;该 grant 不签发 refresh token。
参数:
bodyclient_idbodyclient_secretbodygrant_typebodycodebodyredirect_uribodycode_verifierbodyrefresh_tokenbodyscope