Skip to content

API Client 获取 Token

POST
/v1/auth/token

以 client_credentials 形式用 clientId + clientSecret 换取访问令牌,是 V1 通道唯一可在未持 token 时调用的端点(无需鉴权)。返回的 accessToken 为不透明字符串(非 JWT,勿本地解析),后续请求以 Authorization: Bearer 携带;tenantId 由 clientId 在服务端解码得到并写入响应,后续请求无需再传。该模式下认证态恒为 APP_ONLY。

授权

apiKey
类型
API Key (header: Authorization)

请求体

application/json
JSON
{
  
"clientId": "string",
  
"clientSecret": "string"
}

响应

OK

*/*
JSON
{
  
"code": 0,
  
"data": {
  
  
"accessToken": "string",
  
  
"expiresIn": 0,
  
  
"refreshToken": "string",
  
  
"scopes": [
  
  
  
"string"
  
  
],
  
  
"mode": "string",
  
  
"userId": "string",
  
  
"userName": "string",
  
  
"tenantId": "string",
  
  
"requirePasswordChange": true
  
},
  
"ts": 0,
  
"rid": "string",
  
"msg": "string",
  
"success": true
}

试验场

服务器
授权
主体

示例

技术支持 VitePress OpenAPI