Hi,
I am having trouble using Webhooks with Backand. I created the following webhook:
{
"event": "get_bell_object",
"url": "{{BACKAND_API_URL}}/objects/bells",
"requestType": "GET",
"headers": {
"AnonymousToken": "{{BACKAND_ANONYMOUS_TOKEN}}"
},
"query": {
"filter": "[{\"fieldName\":\"{{device_type}}\",\"operator\":\"equals\",\"value\":\"{{device_id}}\"}]"
},
"mydevices": true,
"noDefaults": true,
"rejectUnauthorized": false
}
I subscribe and publish the event as follows:
Particle.subscribe("hook-response/get_bell_object", getBellObject, MY_DEVICES);
Particle.publish("get_bell_object", "{\"BACKAND_API_URL\":\"https://api.backand.com/1\", \"BACKAND_ANONYMOUS_TOKEN\":\"1234567890987654321\", \"device_type\":\"particle_bell_id\", \"device_id\":\"1234567890987654321\"}", 60, PRIVATE);
The problem is that the event handler never gets called. Using particle subscribe mine
I do not see anything else than the event publishing. So I am not even sure the request is even sent. For sure there is no reply from Backend.
I tried to send the request to a requestb.in and it works. The query is well formatted and the event handler is called. I tried to call the Backand API with Postman and it also works.
Any clues?
Thanks,
Guillaume