Hello beautfiull Particle People
Iām having a hard time making Webhooks work. After reading the documentation I have more questions then hawsers
I want to create a object in my Parse database https://parse.com/docs/rest/guide#objects. The code bellow is the .json file that i have created.
{
"event": "parse",
"url": "https://api.parse.com/1/classes/History",
"requestType": "POST",
"auth": {
"X-Parse-Application-Id": "XXX",
"X-Parse-REST-API-Key": "XXX"
},
"headers": {
"Content-Type": "application/json"
},
"json": {
"accessorieID":"{{accessorieID}}",
"user":"{{user}}"
},
"mydevices": true
}
The code on for the Core is as follow:
#define publish_delay 10000
unsigned int lastPublish = 0;
void setup() {
}
void loop() {
unsigned long now = millis();
if ((now - lastPublish) < publish_delay) {
// it hasn't been 10 seconds yet...
return;
}
Spark.publish("parse", "{ \"accessorieID\": \"tAUJDAEUXK\", \"user\": \"3wEtpxS126\" }", 60, PRIVATE);
lastPublish = now;
}
When I do āparticle subscribe mineā i get no errors from Parse.
{"name":"parse","data":"{ \"accessorieID\": \"tAUJDAEUXK\", \"user\": \"3wEtpxS126\" }","ttl":"60","published_at":"2015-07-05T17:30:18.111Z","coreid":"54ff6a066678574919370667"}
{"name":"parse","data":"{ \"accessorieID\": \"tAUJDAEUXK\", \"user\": \"3wEtpxS126\" }","ttl":"60","published_at":"2015-07-05T17:30:28.110Z","coreid":"54ff6a066678574919370667"}
{"name":"parse","data":"{ \"accessorieID\": \"tAUJDAEUXK\", \"user\": \"3wEtpxS126\" }","ttl":"60","published_at":"2015-07-05T17:30:38.128Z","coreid":"54ff6a066678574919370667"}
{"name":"parse","data":"{ \"accessorieID\": \"tAUJDAEUXK\", \"user\": \"3wEtpxS126\" }","ttl":"60","published_at":"2015-07-05T17:30:48.110Z","coreid":"54ff6a066678574919370667"}
{"name":"parse","data":"{ \"accessorieID\": \"tAUJDAEUXK\", \"user\": \"3wEtpxS126\" }","ttl":"60","published_at":"2015-07-05T17:30:58.114Z","coreid":"54ff6a066678574919370667"}
{"name":"parse","data":"{ \"accessorieID\": \"tAUJDAEUXK\", \"user\": \"3wEtpxS126\" }","ttl":"60","published_at":"2015-07-05T17:31:08.117Z","coreid":"54ff6a066678574919370667"}
{"name":"parse","data":"{ \"accessorieID\": \"tAUJDAEUXK\", \"user\": \"3wEtpxS126\" }","ttl":"60","published_at":"2015-07-05T17:31:18.112Z","coreid":"54ff6a066678574919370667"}
But nothing is being created in the Parse database. I tried a bunch of things but nothing seams to work.
I would be grateful is someone could check the code above and see what might be wrong.
Best.