管理类API的形式都是一致的,区别仅在传入的参数。
management
POST
xvs-signature
签名字段 xvs-timestamp
签名时间戳 service_code
任务相关的服务码以下是一个管理类api抓包数据
POST /api/20140928/management?service_code=TESTING HTTP/1.1
Host: c.zhiboyun.com
Connection: keep-alive
Content-Length: 149
Accept: application/json, text/javascript, */*; q=0.01
xvs-timestamp: 1444287668837
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36
Origin: http://developer.zhiboyun.com
xvs-signature: d98b0b1fd581c646930d013ee1be19d115cf8587fe13f3a74bee72098672162b
{
"function": "create_user",
"params": {
"service_code": "TESTING",
"user_name": "019",
"password": "19pass"
}
}
以下是返回数据:
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: text/plain
Date: Thu, 08 Oct 2015 07:01:09 GMT
transfer-encoding: chunked
Connection: keep-alive
12
{"ret":0,"id":164}
0
ret
调用结果 0
表示成功,非0
失败。错误代码参考API返回代码表因为管理类API调用形式都是一样的,因此这里只列举POST的数据和返回数据说明
所有POST的参数都是如下形式
{
"function": "create_user",
"params": {
....
}
}