I created a php file to send an example notification to my devices:
<?php
$ch = curl_init();
$url = "https://api.usergrid.com/ratnhanhgon/thd/devices/*/notifications";
$send = "payload=exam:hello";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $send);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec ($ch);
echo $out;
?>
But when I run it, i received this error message:
{"error":"web_application","timestamp":1417235590486,"duration":0,"exception":"javax.ws.rs.WebApplicationException"}
May you explain where was I wrong? Did I miss something?
Are you actually calling it with the asterisk in there? You need to provide a device uuid there.
Also, it consumes JSON, so you'll need to POST a JSON object to the
/notifications
endpoint. Something like: