获取访问 Token
curl --request POST \
--url https://api.aichs365.com/api/v1/getAccessToken \
--header 'Content-Type: application/json' \
--data '
{
"app_id": "app id+中文",
"signature": "5e63696a5f377471c2aa32b21605852d",
"sign_ver": "1.0",
"timestamp": 1788062400123
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
app_id: 'app id+中文',
signature: '5e63696a5f377471c2aa32b21605852d',
sign_ver: '1.0',
timestamp: 1788062400123
})
};
fetch('https://api.aichs365.com/api/v1/getAccessToken', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.aichs365.com/api/v1/getAccessToken"
payload = {
"app_id": "app id+中文",
"signature": "5e63696a5f377471c2aa32b21605852d",
"sign_ver": "1.0",
"timestamp": 1788062400123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"requestId": "01HZY8QK5W6N7P8R9S0T1U2V3W",
"path": "/api/v1/getAccessToken",
"success": true,
"message": "请求成功",
"code": 200,
"data": {
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.example"
}
}
应用鉴权
获取访问 Token
signature 为 APP_ID、APP_SECRET、sign_ver=1.0、毫秒 timestamp 按键名升序并按 PHP http_build_query RFC1738 编码后的小写 MD5。APP_SECRET 不发送到 API。
POST
/
api
/
v1
/
getAccessToken
获取访问 Token
curl --request POST \
--url https://api.aichs365.com/api/v1/getAccessToken \
--header 'Content-Type: application/json' \
--data '
{
"app_id": "app id+中文",
"signature": "5e63696a5f377471c2aa32b21605852d",
"sign_ver": "1.0",
"timestamp": 1788062400123
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
app_id: 'app id+中文',
signature: '5e63696a5f377471c2aa32b21605852d',
sign_ver: '1.0',
timestamp: 1788062400123
})
};
fetch('https://api.aichs365.com/api/v1/getAccessToken', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.aichs365.com/api/v1/getAccessToken"
payload = {
"app_id": "app id+中文",
"signature": "5e63696a5f377471c2aa32b21605852d",
"sign_ver": "1.0",
"timestamp": 1788062400123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"requestId": "01HZY8QK5W6N7P8R9S0T1U2V3W",
"path": "/api/v1/getAccessToken",
"success": true,
"message": "请求成功",
"code": 200,
"data": {
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.example"
}
}
Body
application/json
Response
200 - application/json
业务响应;请同时检查 success 与 code
- Option 1
- Option 2
本次请求的唯一追踪 ID,用于排查问题。
本次请求命中的 API 路径。
Allowed value:
"/api/v1/getAccessToken"Token 是否生成成功;成功响应固定为 true。
Token 生成结果的中文提示信息。
业务状态码;应与 success 一并判断。