New Webhook
. Copy the ID & Secret to your app's /env.json
file as WEBHOOK_ID
and WEBHOOK_SECRET
.POST https://myapi.com/webhook
), you can attach Homey ID as query parameter homey
to the webhook.homey
query parameter should be forwarded to that Homey.data
property is not required when registering your webhook using the this.homey.cloud.createWebhook()
function.headers['X-Device-Id']
, note that these properties are case-sensitive. You can use body
, headers
and query
in your Webhook key path filter.data
object provided in this.homey.cloud.createWebhook(id, secret, data)
. For example, an object with { $key: "aaabbbccc" }
has to match the value aaabbbccc
in the data
object.{ $keys: ["aaa", "bbb"] }
then the value in the key path either has to match value aaa
or bbb
.webhook.on('message', ...)
listener.headers['X-Device-Id']
from the example above, and define $key
as an array in the data
object, as follows:headers['X-Device-Id']
with value aaa
(or bbb
) and forward this to that Homey. If the webhook service received value ccc
it will not be forwarded.data
object provided in this.homey.cloud.createWebhook(id, secret, data)
as example 1, you can also define your key path in the body of your webhook HTTP request.data
object provided in this.homey.cloud.createWebhook(id, secret, data)
. For example an object with{ deviceId: "aaabbbccc" }
.device_id
. Our cloud function therefore becomes:true
will receive the webhook in the webhook.on('message', ...)
listener.