I’ve successfully set up a webhook (with the help of @peekay123 and others in the community) and am sending data to my website which send email and sms messages based on the request. Every time I send a request, though, the script is run 5-6 times (which means 5-6 duplicate email/sms messages). For the life of me, I can’t figure out what’s happening.
Here’s my json file for the webhook.
{
"event": "venus",
"url": "http://mysite.com/notify.php",
"requestType": "GET",
"query": {
"id":"{{SPARK_EVENT_VALUE}}",
"location":"{{SPARK_CORE_ID}}"
},
"mydevices": true
}
Here’s what subscribe looks like in the terminal after single call:
{"name":"venus","data":"A2","ttl":"60","published_at":"2016-04-29T14:56:33.690Z","core id":"9j12345678901234567890"}
{"name":"hook-sent/venus","data":"undefined","ttl":"60","published_at":"2016-04-29T14:56:33.832Z","coreid":"particle-internal"}
{"name":"hook-sent/venus","data":"undefined","ttl":"60","published_at":"2016-04-29T14:56:33.848Z","coreid":"particle-internal"}
{"name":"hook-sent/venus","data":"undefined","ttl":"60","published_at":"2016-04-29T14:56:33.849Z","coreid":"particle-internal"}
{"name":"hook-sent/venus","data":"undefined","ttl":"60","published_at":"2016-04-29T14:56:33.869Z","coreid":"particle-internal"}
{"name":"hook-sent/venus","data":"undefined","ttl":"60","published_at":"2016-04-29T14:56:33.874Z","coreid":"particle-internal"}
{"name":"hook-sent/venus","data":"undefined","ttl":"60","published_at":"2016-04-29T14:56:33.876Z","coreid":"particle-internal"}
{"name":"hook-sent/venus","data":"undefined","ttl":"60","published_at":"2016-04-29T14:56:33.878Z","coreid":"particle-internal"}
{"name":"hook-sent/venus","data":"undefined","ttl":"60","published_at":"2016-04-29T14:56:33.881Z","coreid":"particle-internal"}
{"name":"hook-response/venus/0","data":"404","ttl":"60","published_at":"2016-04-29T14:56:34.235Z","coreid":"particle-internal"}
{"name":"hook-response/venus/0","data":"404","ttl":"60","published_at":"2016-04-29T14:56:34.248Z","coreid":"particle-internal"}
{"name":"hook-response/venus/0","data":"SUCCESS","ttl":"60","published_at":"2016-04-29T14:56:35.613Z","coreid":"particle-internal"}
{"name":"hook-response/venus/0","data":"SUCCESS","ttl":"60","published_at":"2016-04-29T14:56:35.613Z","coreid":"particle-internal"}
{"name":"hook-response/venus/0","data":"SUCCESS","ttl":"60","published_at":"2016-04-29T14:56:35.650Z","coreid":"particle-internal"}
{"name":"hook-response/venus/0","data":"SUCCESS","ttl":"60","published_at":"2016-04-29T14:56:35.665Z","coreid":"particle-internal"}
{"name":"hook-response/venus/0","data":"SUCCESS","ttl":"60","published_at":"2016-04-29T14:56:35.678Z","coreid":"particle-internal"}
{"name":"hook-response/venus/0","data":"SUCCESS","ttl":"60","published_at":"2016-04-29T14:56:35.744Z","coreid":"particle-internal"}
Any suggestions on how to troubleshoot this? What am I missing?
I’ve also uploaded all the files for the project to github if that’s helpful.