我根据此文档尝试为appboy实现REST API客户端: Appboy API documentation
我使用json对象发送了请求,您可以在下面看到,并且收到错误的响应。
我做错了什么?
JSON对象:
{
"app_group_id":"GROUP_ID",
"external_user_ids":null,
"segment_id":"SEGMENT_ID",
"campaign_id":null,
"override_messaging_limits":false,
"recipient_subscription_state":"all",
"schedule":{"time":"2016-09-07T09:00","in_local_time":true,"at_optimal_time":false},
"messages":{
"apple_push":{
"badge":1,
"alert":{"body":"Auditor-in-ChargennAuditor in Charge is for managers.....","title":"Upcoming Event","title_loc_key":null,"title_loc_args":null,"action_loc_key":null,"loc_key":null,"loc_args":null},
"sound":null,
"extra":{"test_sender":"NASBA","test_subject":"Upcoming Event","test_category":"Events"},
"content-available":true,
"category":"messages",
"expiry":null,
"custom_uri":null,
"message_variation_id":null
},
"android_push":{
"alert":"Auditor-in-ChargennAuditor in Charge is for managers.....",
"title":"Upcoming Event",
"extra":null,
"message_variation_id":null,
"priority":0,
"send_to_sync":false,
"collapse_key":null,
"sound":"default",
"custom_uri":null,
"summary_text":"NASBA|Events",
"delay_while_idle":false,
"time_to_live":0,
"notification_id":0,
"push_icon_image_url":null,
"accent_color":0
},
"windows_push":{
"push_type":"toast_text_02",
"toast_text1":"fgjdgfjhtf",
"message_variation_id":null
},
"windows8_push":{
"push_type":"toast",
"toast_title":"fgjrttrfjtej",
"toast_content":"kjtykdty ghjgfhkghk",
"toast_navigation_uri":"myapp://main",
"toast_hash":{"test_sender":"NASBA","test_subject":"Upcoming Event","test_category":"Events"},
"message_variation_id":null
},
"kindle_push":{
"alert":"dfhdfhdf",
"title":"fghth",
"message_variation_id":null
},
"web_push":{
"alert":"fjrtjdrt",
"title":"ksfgjrtj",
"message_variation_id":null
},
"in_app_message":{
"type":"SLIDEUP",
"message":"gkdjrtdyjrty",
"slide_from":"BOTTOM",
"message_close":"SWIPE",
"message_variation_id":null
},
"email":{
"app_id":"APP_ID",
"from":"Display Name <email@address.com>",
"body":"<html></html>",
"message_variation_id":null
},
"webhook":{
"url":"https://test.com",
"request_method":"GET",
"message_variation_id":null
}
}
}
响应:
{
"message": "Invalid windows phone 8 push type cannot be blank"
}
答案 0 :(得分:0)
对于你的“windows”“push_type”字段,必须是“toast”或不存在(Windows Phone 8的MPNS没有像WNS那样的推送模板)