How to verify requests when subscribed to multiple requests

Hi I am subscribing to webhooks for multiple projects do get events on when tasks are created, updated and deleted.

For example I have project gid: 123 and project gid: 456. I create 2 webhooks and get and store 2 secrets. When I get an incoming webhook how do I know what secret to use to verify the request, my thinking was webhook gid or project gid but these are not included in the payload.

Thanks

Hi @Connor_MacKenzie and welcome to the forum!

Right, the resource (project in your case) gid is not included automatically in the payload but if you send it as a parameter when you create your webhook, you’ll get that same parameter back when you receive the webhook.

I.e. send something like this as your webhook target:

newWebhook.target = "https://myendpoint.com/api/Webhook?projectId=" + projectId;

Then when you get those webhooks, you can just parse the query string for the value of projectId.

1 Like

Thank you!

1 Like