Unable to Create WebHook

Hello,

I am trying to create a webhook using the client library in Node.js. I used client.webhooks.create(‘resourceid’, ‘Target’), then I used express to listen to my target URL for the x-hook-secret. When I get the secret I do send by status code 200 and the secret received using res.status(200).send({‘x-code-secret’ : req.headers[‘x-hook-secret’]});, however I still get an invalid request error. Any help would be appreciated. Thanks!

Hi @Zach3, can you share the error message you receive when you try to create a webhook?

Also, I note in your sample code that you send a header named x-code-secret, but this header should be named x-hook-secret. If this snippet was copied directly from your code, then this is likely the problem.

Hi Joe,

I have resolved my issue, it was because the x-hook-secret has to be part of the header. Using express I did res.header(‘X-Hook-Secret’, req.headers[‘x-hook-secret’]); and that resolved it.