帮助列表 |
https://openapi.aodianyun.com/v4/service
① X-AccessId: 系统分配的访问者身份标识
② X-TimeStamp:时间戳,是1970年一月一日0点到当前的秒数。用于本服务端当前时间比较,超过某一个值后就要返回过期失败。
③ X-SignatureNonce:随机数,请求时候尽量不要重复,至少10分钟内不要重复。
④ X-Signature:签名,用于验证请求合法性。签名生成规则将在后文介绍。
⑤ X-Api:调用方法
⑥ X-Service:调用服务
进行签名前请确保已获取账号 access_id 和 access_key,分别对应X-AccessId、X-AccessKey。
组织明文签名串stringToSign,按如下格式拼接待签名字符串:
stringToSign=
X-AccessId+"\n"+
X-AccessKey+"\n"+
X-SignatureNonce+"\n"+
X-TimeStamp+"\n"+
body
X-Signature=md5(stringToSign),其中md5取32位小写。
示例:
X-AccessId="id11111" ,
X-AccessKey="key22222",
X-SignatureNonce="a234567",
X-TimeStamp=1539084154,
X-Api="lps/create",
X-SaasId="aa",
body="{"user":1233,"age":88,"name":"Tom"}"
则:
stringToSign='id11111\nkey22222\na234567\n1539084154\nlps/create\naa\n{"user":1233,"age":88,"name":"Tom"}'
signature=md5(stringToSign)=a589810bd181755176f93fc202511218
方式:
POST
请求地址:
https://openapi.aodianyun.com/v4/service
请求头:
Content-Type: application/json
X-AccessId:"id11111"
X-Signature:"a589810bd181755176f93fc202511218"
X-TimeStamp: 1539084154
X-SignatureNonce: a234567
X-Api: "createProject"
X-Service: "rtt"
请求体:
'{"uin":1233,"age":88,"name":"Tom"}'
curl请求命令:
curl -X POST -i http://openapi.aodianyun.com/v4/service -d '{"uin":1233,"age":88,"name":"Tom"}' -H "X-AccessId:id11111" -H "X-Signature:a589810bd181755176f93fc202511218" -H "X-TimeStamp: 1539084154" -H "X-SignatureNonce: a234567" -H "Content-Type: application/json" -H "X-Api: createProject" -H "X-Service: rtt"