tencent cloud

Tencent WorkBuddy Enterprise

获取企业内部应用 access_token

下载
聚焦模式
字号
最后更新时间: 2026-11-16 11:51:12

接口描述

请求方式:POST
请求地址:登录 企业管理后台,选择指定的自建应用。在 “端点信息”模块,获取应用 “Token 端点”作为请求地址。
本接口用于以应用身份获取 access_token,用于调用应用级数据接口。


输入参数

请求头

名称
类型
必填
描述
Content-Type
string
是
固定值:application/x-www-form-urlencoded

请求体参数

名称
类型
必填
描述
client_id
string
是
自建应用的 Client ID
示例值:i-3f7f5**************************d0
client_secret
string
是
自建应用的 Client Secret
示例值:HydF******************************{lnL
grant_type
string
是
固定值:client_credentials
示例值:client_credentials

输出参数

名称
类型
描述
access_token
string
访问凭证
token_type
string
凭证类型。目前为不记名凭证,即 Bearer
expires_in
int
凭证的有效期,单位:秒。

示例

输入示例

POST https://oauth2.account.tencentid.com/authz/oidc/v2/13580***********30/token
Content-Type: application/x-www-form-urlencoded

client_id=i-3f7f5*************************d0&client_secret={secret}&grant_type=client_credentials

输出示例

{
"access_token": "eyJhb***********************gw",
"token_type": "Bearer",
"expires_in": 1800
}

错误码

说明:
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码。
错误码
描述
invalid_request
缺少 client_id / client_secret,或 grant_type 非 client_credentials
invalid_client
client_id 不存在、应用已禁用,或 secret 不匹配
invalid_grant
应用未启用 client_credentials 授权类型
unsupported_grant_type
grant_type 取值不支持


帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈