@Dave & @bryce/@bwkahle : you guys are probably already aware of this & are best suited to answer.
A lot of IoT stuff we do passes mostly JSON around but I am having issues getting it to work using the Particle web hooks properly.
Ideally I would like to be able to use {{PARTICLE_EVENT_VALUE}} to grab the data (pre-formatted in escaped JSON by the Electron/Proton etc) and send it to a server by using an integration like:
{
"event": "[[event_name]]",
"url": "[[SERVER]]",
"requestType": "POST",
"mydevices": true,
"body": "{"device": "{{PARTICLE_DEVICE_ID}}", "timestamp": "{{PARTICLE_PUBLISHED_AT}}", "data": {{PARTICLE_EVENT_VALUE}}}"
}
The reason I use "body" is because I have found a number of references around about it, but it does seem undocumented/deprecated. One of my sources of information is this github on particle webhooks
That github also mentions a lot about Mustache substitutions/conditionals and arrays. I could make a really complex object up using that I suppose but it basically ends up being a computational copy from source JSON into target JSON.
There are quite a few topics on this in the discussions board already but none seem to have a definitive answer:
Webhooks with JSON arrays or nested objects escaping quotes
Particle.publish and JSON escaped data
{{SPARK_EVENT_VALUE}} gets HTML encoded
Any update on this? is it possible/too much?