malte.huener
malte.huener5mo ago

Facebook webhook

Hi there.. I am trying to set up a facebook webhook.. Facebooks webhook is sending the folling data: { "originalUrl": "/fbWebhook?hub.mode=subscribe&hub.challenge=1325&hub.verify_token=5f7c9a2d0e7c4baf4a76d6f7a5e34c65e0fb7c4a2b7f9c0d1e", "body": {}, "host": "7b442q.buildship.run", "hostname": "7b442q.buildship.run", "path": "/fbWebhook", "ip": "::ffff:169.254.1.1", "querystring": "hub.mode=subscribe&hub.challenge=1325&hub.verify_token=5f7c9a2d0e7c4baf4a6f7a5e34c65e0fb7c4a2b7f9c0d1e", "ips": [], "subdomains": [ "7blo2q" ], "protocol": "http", "method": "GET", "query": { "hub.challenge": "1325", "hub.verify_token": "0e34a6f7a5e34c65e0fb7c4a2b7f9c0d1e", "hub.mode": "subscribe" } } As a response for authentication the webhook expected the value from query.hub.challenge. And here is already my problem: How to send back that value back as a response? I encouter multiple errors and think that is has something to with the dot notation of the key "hub.challenge".. Error "Cannot read properties of undefined (reading 'challenge')" Can you help me?
Solution:
Hey @malte.huener, you can use the WhatsApp Bot verification Bot template in this case, it has a Token verification node, which has the logic implementation of verification using mode, token, and challenge.
Jump to solution
2 Replies
Solution
Gaurav Chadha
Gaurav Chadha5mo ago
Hey @malte.huener, you can use the WhatsApp Bot verification Bot template in this case, it has a Token verification node, which has the logic implementation of verification using mode, token, and challenge.
malte.huener
malte.huener5mo ago
@Gaurav Chadha That works, thank you very much!