Closed jeffreyflynt closed 9 months ago
Hey @jeffreyflynt , the parameters for the function should be snake_case like the following
let opts = pipedrive.AddWebhookRequest.constructFromObject({
subscription_url: `https://api.example.com/webhook`,
event_action: "create",
event_object: "deal",
version: "2.0",
});
and note that you can't use version 2.0 with "event_action" : "updated"
, you can find more about the v2 webhooks here https://pipedrive.readme.io/docs/guide-for-webhooks-v2
@youssef-saber-3 Thanks for that!
To clarify, when I see the properties on the docs page: https://github.com/pipedrive/client-nodejs/blob/master/docs/AddWebhookRequest.md I should always use snake case in my code?
Hey, Yeah, i can see how that can be confusing. we'll work on improving that. i typically refer to the API docs to find the parameter names and descriptions https://developers.pipedrive.com/docs/api/v1/Webhooks#addWebhook
I can also suggest to try out the TypeScript SDK version that we're testing out. it should prevent issues like this where it will provide strong typing for function parameters. this release is still in alpha stage and we'd apreciate any feedback you have if you decide t to give it a try https://www.npmjs.com/package/pipedrive/v/22.3.1-rc.4
When following the example to add a webhook, I get the following error:
Missing the required parameter 'subscription_url' when calling addWebhook
. Is the below code, the correct way to add a webhook using this library?Using Pipedrive
22.5.0
.