在命令行用curl调试Push API v3接口出现errorcode1002

smallbird
2017-09-09 01:49 2k 0

极光大神:
在命令行用curl调试Push API v3接口出现errorcode1002,我是直接从https://docs.jiguang.cn/jpush/server/push/rest_api_v3_push/拷贝出来的示例调用命令,只是把示例中的AppKey和MasterSecret改成我自己的而已。

curl --insecure -X POST -v https://api.jpush.cn/v3/push 
-H "Content-Type: application/json" 
-u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1" 
-d '{"platform":"all","audience":"all",
"notification":{"alert":"Hi,JPush !",
"android":{"extras":{"android-key1":"android-value1"}},
"ios":{"sound":"sound.caf","badge":"+1","extras":{"ios-key1":"ios-value1"}}}}'

调用后返回的完整错误信息如下:

* upload completely sent off: 174 out of 174 bytes
* schannel: client wants to read 16384 bytes
* schannel: encdata_buffer resized 17408
* schannel: encrypted data buffer: offset 0 length 17408
* schannel: encrypted data got 405
* schannel: encrypted data buffer: offset 405 length 17408
* schannel: decrypted data length: 327
* schannel: decrypted data added: 327
* schannel: decrypted data cached: offset 327 length 16384
* schannel: encrypted data buffer: offset 0 length 17408
* schannel: decrypted data buffer: offset 327 length 16384
* schannel: schannel_recv cleanup
* schannel: decrypted data returned 327
* schannel: decrypted data buffer: offset 0 length 16384
< HTTP/1.1 400 BAD REQUEST
< Server: nginx
< Date: Sat, 09 Sep 2017 01:42:21 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Rate-Limit-Limit: 600
< X-Rate-Limit-Remaining: 599
< X-Rate-Limit-Reset: 60
< X-JPush-MsgId:
<
{"error": {"message": "Missing parameter", **"code": 1002**}}* Connection #0 to host api.jpush.cn left intact

1个回答

热门排序