- 调用格式说明
- Postman模板使用说明
- 第三方小程序应用密钥使用说明
- 第三方小程序应用上传资源
- 第三方小程序应用上传资源V2
- 授权
- 域名
- 模板管理
- 代商家管理小程序
- 代商家入驻抖音开放平台
获取授权小程序接口调用凭据V2
收藏
我的收藏接口说明
该接口用于获取授权小程序接口调用凭据。
授权小程序接口调用凭据 authorizer_access_token 是服务商代授权小程序调用开放接口的必要参数。
使用限制
- authorizer_access_token 有效期 2 小时。
- 通过该接口获取到的 authorizer_access_token 为V2版authorizer_access_token,与 V1 版 authorizer_access_token 不可混用;
- 各 OpenAPI 使用的 authorizer_access_token 类型需要参考接口文档里 access-token 参数的说明,只有特别标注使用该接口获取到的 authorizer_access_token 才可以使用本接口获取到的 authorizer_access_token 进行调用;
- 后续新增的小程序相关接口都只支持通过 V2 版 authorizer_access_token 进行调用;
- 存量的接口会逐步推出和V2 版 authorizer_access_token 相匹配的新接口,存量接口仍可用,但建议开发者迁移使用新接口;
基本信息
名称 | 描述 |
---|---|
HTTP URL | https://open.douyin.com/api/tpapp/v2/auth/get_auth_token/ |
HTTP Method | GET |
Scope | thirdparty.dev.auth |
请求头
名称 | 字段类型 | 是否必填 | 示例 | 描述 |
---|---|---|---|---|
access-token | String | 是 | clt.05efxxxxxxxxxqPf9pWBo0IKVHmSKce5EvKX |
请求参数
Query
名称 | 字段类型 | 是否必填 | 示例 | 描述 |
---|---|---|---|---|
grant_type | String | 是 | 获取方式 通过授权码方式获取填写固定字符串:app_to_tp_authorization_code 通过刷新令牌方式获取填写固定字符串:app_to_tp_refresh_token | |
authorization_code | String | 否 | 授权码 通过授权码方式获取必填 | |
authorizer_refresh_token | String | 否 | 刷新令牌 authorizer_refresh_token 通过刷新令牌方式获取必填 |
请求示例
curl --location 'https://open.douyin.com/api/tpapp/v2/auth/get_auth_token?grant_type=app_to_tp_authorization_code&authorization_code=xxxxxxxxxxxx' \
--header 'access-token: clt.eafxxxxxxxxxxxxxxxxxxZcVHzh79g1qS2Tol9kCT'
响应参数
Body
名称 | 字段类型 | 是否必填 | 示例 | 描述 |
---|---|---|---|---|
err_msg | String | 是 | ||
err_no | Int32 | 是 | ||
log_id | String | 是 | ||
data | Struct | 否 |
响应示例
正常响应示例
{
"err_no": 0,
"log_id": "2023101312022744C2A2666DB7BC00832B",
"data": {
"authorizer_access_token": "isvact.5dafax837bb9937cdxxxxxx200fO2Eh5YgvG4pFmj6nSf8NGr6j8Yfg",
"authorizer_appid": "xxxxxx",
"authorizer_refresh_token": "isvrft.d016bb817070xxxxxtUS9BNtfJ174uhFNFUnW",
"expires_in": 7200,
"refresh_expires_in": 2592000,
"authorize_permission": [
{
"category": "开发管理权限",
"description": "帮助小程序进行基础功能开发及配置开发所需信息",
"id": 1
},
{
"category": "基本信息设置权限",
"description": "帮助小程序管理名称、头像、简介、服务类目等信息",
"id": 2
}
]
},
"err_msg": ""
}
异常响应示例
{
"err_no": 28001008,
"err_msg": "access_token过期,请刷新或重新授权",
"log_id": "202402231601203A85A7BDF409E505D210"
}
错误码
http状态码 | 错误码 | 错误码描述 | 排查建议 |
---|---|---|---|
200 | 40001 | 参数错误 | |
200 | 40002 | 缺少参数 | |
200 | 40003 | 找不到相关第三方小程序应用 | |
200 | 40004 | 找不到相关授权小程序 | |
200 | 40018 | 第三方小程序应用 authorization_code 不正确或者已过期 | |
200 | 40040 | 无效的 grant_type | |
200 | 40045 | 生成 token 失败,请重试 | |
200 | 28001008 | access-token过期 |
该文档是否有帮助?
点击纠错