I am currently experiencing the same. Looks like my endpoint is not receiving the challenge POST. How did you construct your backend? Mine is Node JS with a few exposed endpoints:
The first two routers (subscribe and unsubscribe) are receiving request from the custom trigger and are working just fine. The 3rd one was meant to be an endpoint to receive request from a webhook I am trying to insert from my backend into a board.
Thank you very much. I am creating the webhook via an endpoint in my backend. Using custom triggers I have 4 endpoint for this feature (subscribe, unsubscribe, webhookaction and recipeaction).
The subscribe and unsubscribe endpoint are working fine. It looks like the webhookaction endpoint never receives the request (nothing in the console.log). Any ideas?
Thanks to @kamescg and amazing @dipro I managed to get this working. The webhook post (including the initial challenge) does not contain the app signing secret and therefore the authenticationMiddleware will reject the request.
Modified:
router.post("/autoid/webhookaction", authenticationMiddleware, autoIdController.webhookAction);
To:
router.post("/autoid/webhookaction", autoIdController.webhookAction);
resolved the issue. My code inserts the webhook (create_item) that now posts to my endpoint.
Not sure I fully understand your question. How did you create the webhook on your board, is it by code or through the UI? Are you sure the webhook is fired and how does the event look like? If there is no challenge in the event apparently the monday side (where the webhook gets triggered) already “trust” your side (where you process the request) and you can use the data in the event. The challenge handshake will only take place on the first request generated by the triggered webhook.
I am trying to create webhook using API v2 mutation request,So while registering they will send a challenge to our endpoint to verify ,we need to return it back as repsonse.
I am returning the response but webhook is not getting created and it is returning null instead of webhook id.
then they sent a challenge to the custom url for verification {challenge:SOME_CODE}
Now for successful creation of webhook we need to return this challenge from our CUSTOM_URL
So you got the challenge in the first request? Looks like your are returning the full body.event as a response, where monday only expects the challenge (req.body.challenge). Therefore you always need to do something like this:
check if there is a challenge in the request
– if so, return the challenge (not the full body)
–if not, do whatever you want with the event