Hey guys im trying to send a push message to my phone using the pushover libary (pushover.net).
Actually I failed pretty fast in fact Im getting a 400 Bad request error from jquery AJAX call.
Here is my code, whats wrong ?
$.ajax({
type: "POST",
url: "https://api.pushover.net/1/messages.json",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: {
"title": title,
"message": message,
"token": CONFIG.API,
"device": CONFIG.DEVICE,
"user": CONFIG.USER,
},
complete: function(data) {
console.log("push sent!");
console.log(data);
}
});
Error: POST https://api.pushover.net/1/messages.json 400 (Bad Request)