我正在尝试使用countly API发送通知,
我在文档中找到了这个:
curl --request POST \ --url 'https://try.count.ly/i/pushes/prepare?args.apps=args.apps&args.platforms=args.platforms&args=args&api_key=api_key'
它说我必须提供args,这是一个 JSON对象,作为未来消息数据的字符串。
他们没有提供关于这个论点应该如何
的任何明确文件任何帮助将不胜感激
答案 0 :(得分:0)
在整个系统中,Countly期望args
参数中的字符串化JSON对象。例如,您可以通过从信息中心发送消息并查看Chrome开发人员工具中的请求来查看其工作原理。但是我们走了:
curl --form 'args={"apps":["57fb679323b5388e28e2c37e"],"platforms":["a"],"tz":false,"test":false}' http://HOST/i/pushes/prepare?api_key=API_KEY
然后
curl --form 'args={"apps":["57fb679323b5388e28e2c37e"],"platforms":["a"],"tz":false,"test":false,"_id":"58cb862e2a16277d4501d787","type":"message","messagePerLocale":{"default":"Message text"},"locales":[{"value":"default","title":"Default","count":1062,"percent":100},{"value":"en","title":"English","count":296,"percent":28},{"value":"ja","title":"Japanese","count":166,"percent":16},{"value":"it","title":"Italian","count":152,"percent":14},{"value":"fr","title":"French","count":152,"percent":14},{"value":"de","title":"German","count":149,"percent":14},{"value":"ko","title":"Korean","count":147,"percent":14}],"sound":"default","source":"dash","date":"2017-03-24T07:00:00.000Z"}' http://HOST/i/pushes/create?api_key=API_KEY
您还可以省略in documentation所述的第一个请求。