2017-03-16 53 views
0

我試圖使用countly API發送通知傳送推,使用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

整個系統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也可以省略第一個請求。