鉴权
# 接口信息
- 接口状态 : 正常
- 请求方式 :
POST
- 返回格式 :
JSON
# 请求地址
https://XXXX/api/v1/auth/
1
# 请求参数
参数名 | 必选 | 类型 | 描述 |
---|---|---|---|
access_key | 是 | string | 开发者唯一标识 |
app_id | 是 | string | 应用 id |
# 响应参数
参数名称 | 类型 | 描述 |
---|---|---|
token | string | token |
expired_time | string | 过期时间 |
# 代码示例
注意 🔔️
没有开发者调用凭证无法调用接口 前往获取开发者凭证 (opens new window)
- 示例一 :Python 调用示例
import requests
import json
def get_auth():
url = 'https://XXXX/api/v1/auth/'
data = {
'access_key': 'Your Access Key',
'app_id': 'Your App Id'
}
response = requests.post(url, data=data)
result = json.loads(response.text)
token = result['token']
expired_time = result['expired_time']
return token, expired_time
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 响应示例
{
"token": "5e9b4b7b-7b7b-4b7b-7b7b-7b7b7b7b7b7b",
"expired_time": "2024-04-26 20:21:58"
}
1
2
3
4
2
3
4