4.2客户授权接口
接口说明
注意: 在调用的时候需要先添加IP白名单
请求路径: /api/open/auth
请求方法: POST
请求参数: sign 签名将 appKey + 时间戳 + 秘钥 拼接做sha256 加密 之后 转十六进制
参数名称 | 类型 | 长度限制 | 是否必填 | 介绍 |
---|---|---|---|---|
appKey | String | 50 | 是 | 客户的appKey |
sign | String | 100 | 是 | 验签,生成办法sha256Hex(appKey + timestamp + appSecret) |
timestamp | String | 50 | 是 | 时间戳 |
{
"appKey": "test1395648658046414850",
"timestamp": "1647920715145",
"sign": "c716b85bb3ad1a65550e9a4c16b756d51567f8f6c4b43998b3eb962e1436e180"
}
返回:
字段名称 | 类型 | 长度限制 | 介绍 |
---|---|---|---|
accessToken | String | 唯一标识 | |
expiration | Long | 过期时间 | |
expiresIn | Date | 有效期单位:分钟 |
{
"code": "0",
"data": {
"accessToken": "OPEN_API.f319b8a8b3f7466e9c36993323f38b08.62428464",
"expiration": "2022-03-29 12:00:36",
"expiresIn": 10080
},
"message": "请求成功",
"success": true
}
错误:
codes | 问题描述 | 解决 |
---|---|---|
10001 | IP 不在白名单 | 请联系烈熊方产品添加白名单 |
10002 | 签名错误 | 1.请检查加密算法 2.请与烈熊方产品核对appId和appKey |
10003 | 客户不存在 | 请联系烈熊方产品核对appKey和appSecret是否正确 |
10004 | 缺少参数 | 具体内容查阅返回的message字段 |