我正在使用 Push Woosh 发送推送通知。我正在对其进行测试并尝试通过 Ajax Post 创建一条新消息,但我收到了错误的请求错误。
这是我的代码:
data = {
"request": {
"application": "5D6E8-2E383",
"auth": "...",
"notifications": [
{
"send_date": "now",
"ignore_user_timezone": true,
"content": "este es un test de ajax",
"platforms": [3],
"apns_trim_content": 1,
"android_root_params": {
"key": "APA91bHuRB56xKAdocTZubHC1BtvNogDE_YswmluQ0mDpOSz9nRhdMbPYXngNckloqik9PEb_MqXJd1BoGpqMjwo9ntcgKOeDA4sH1IxwEl2ZJcx94FTdk22KR86FZMYogbXrtCA8U1KC3oShPab13B3NvkSu2Bphw"
},
"android_header": "Este es el titulo",
"devices": [
"APA91bHuRB56xKAdocTZubHC1BtvNogDE_YswmluQ0mDpOSz9nRhdMbPYXngNckloqik9PEb_MqXJd1BoGpqMjwo9ntcgKOeDA4sH1IxwEl2ZJcx94FTdk22KR86FZMYogbXrtCA8U1KC3oShPab13B3NvkSu2Bphw"
]
}
]
}
};
$.ajax({
type: "POST",
url: "https://cp.pushwoosh.com/json/1.3/createMessage",
data: data,
dataType: "json",
error: function(data){
console.log(data);
},
success: function(data){
console.log(data);
}
});