I’ve been running a project for many months using calls to https://www.pushingbox.com/ and then using that site to post a GET request to a php script on my servers. Now, I want to cut out the middle man and use webhooks to get the job done.
Here’s my json for setting up the webhook:
{
"event": "venus",
"url": "http://mysite.com/v2/notify.php",
"requestType": "GET",
"json": {
"id" : "{{SPARK_EVENT_VALUE}}",
"location" : "{{SPARK_CORE_ID}}"
},
"mydevices": true
}
My webhook call looks like this:
Particle.publish("venus", String(value), 60, PRIVATE);
When I trigger the action on my photon I see this when listening in the terminal:
{"name":"venus","data":"D","ttl":"60","published_at":"2016-04-28T20:47:50.971Z","coreid":"12345678901234567890"}
{"name":"hook-sent/venus","data":"undefined","ttl":"60","published_at":"2016-04-28T20:47:51.036Z","coreid":"particle-internal"}
{"name":"hook-response/venus/0","data":"{\"status\":{\"type\":\"error\",\"value\":\"No JSON value set\"}}","ttl":"60","published_at":"2016-04-28T20:47:51.177Z","coreid":"particle-internal"}
I’ve used hurl.it to make sure the code works on my server. It does. Clearly, there’s something wrong with the way I set up my webhook. What am I doing wrong?
This is what I want the request to look like, ultimately:
http://mysite.com/v2/notify.php?json={"name":"venus","data":"D","ttl":"60","published_at":"2016-04-28T20:47:50.971Z","coreid":"12345678901234567890"}
Thanks in advance for the help. Just ordered two Electrons today and am excited to try this out on them as well!