I have now managed to target their mock-up server and got the job running
There were some minor adoptions to the JSON format and the webhook definition required
So this is how the JSON should be built
snprintf(outgoing, sizeof(outgoing)
, "[{\"key\":\"temp\", \"value\":\"%.1f\", \"epoch\":%d}"
",{\"key\":\"hum\" , \"value\":\"%.1f\", \"epoch\":%d}"
"]"
, temperature
, Time.now()
, humidity
, Time.now()
);
(epoch
should not be wrapped in double quotes)
And here is the webhook definition
(tripple handlebars instead of double)
as copyable text
{
"event": "test",
"responseTopic": "",
"url": "https://private-anon-083dcd9b5e-initialstateeventsapi.apiary-mock.com/api/events",
"requestType": "POST",
"noDefaults": true,
"rejectUnauthorized": true,
"headers": {
"Content-Type": "application/json",
"X-IS-AccessKey": "1234",
"X-IS-BucketKey": "apiary_bucket",
"accept-version": "~0"
},
"body": "{{{PARTICLE_EVENT_VALUE}}}"
}