获取 access
该接口用于获取用户授权第三方接口调用的凭证 access_token;该接口适用于抖音/头条授权。
注意:
- 抖音的 OAuth API 以https://open.douyin.com/开头。
- 头条的 OAuth API 以https://open.snssdk.com/开头。
- 西瓜的 OAuth API 以https://open-api.ixigua.com/开头。
- access_token 为用户授权第三方接口调用的凭证,存储在客户端,可能会被窃取,泄漏后可能会发生用户隐私数据泄漏的风险,建议存储在服务端。
- 获取到 access_token 后授权临时票据 (code) 不要再授权刷新,否则会导致上一次获取的 code 过期。
状态码排查
请求地址
POST /oauth/access_token/
请求头
- Content-Type: application/x-www-form-urlencoded
请求参数
Body 请求
参数名称 | 参数类型 | 参数描述 | 参数示例 | 是否必填 |
---|
暂无数据
响应参数
参数名称 | 参数类型 | 参数描述 | 参数示例 | 是否必填 |
---|
暂无数据
响应样例
{
"data": {
"access_token": "access_token",
"description": "",
"error_code": "0",
"expires_in": "86400",
"open_id": "aaa-bbb-ccc",
"refresh_expires_in": "86400",
"refresh_token": "refresh_token",
"scope": "user_info"
},
"message": "<nil>"
}
响应错误样例
{
"data": {
"description": "Parameter error",
"error_code": 2100005
},
"extra": {
"logid": "2020070614111601022506808001045D59",
"now": 1594015876138
}
}
诚邀您对本文档易读易用性进行评价
好用
不好用