pipedrive / client-nodejs

Pipedrive API client for NodeJS
MIT License
205 stars 82 forks source link

Add followers in bulk? #134

Closed MelMacaluso closed 4 years ago

MelMacaluso commented 4 years ago

Hi guys, any way to add followers in bulk?

I have a webhook on deal updated that is called every time a deal is updated, and a deal is updated every time I add a follower...supposedly if I add them in bulk I will just trigger the webhook (so the lambda function...) once!

At the moment being I have a nasty:

[...]
  for (const user of users) {
    const input = {
      id: dealId,
      userId: user.id,
    }
    try {
      await pipedrive.DealsController.addAFollowerToADeal(input)
    } catch (error) {
      throw new Error(`--- Users could not be added as followers to deal: ${dealId} ---`)
    }
  }

would be amazing to have instead...(providing it doesn't exist, but I couldn't find it...).

try {
    await pipedrive.DealsController.addAFollowersBulk(ids)
} catch (error) {
    throw new Error(`--- Users could not be added as followers to deal: ${dealId} ---`)
}
ziimk commented 4 years ago

Hey, the only way is to add them one by one. Pipedrive API does not support bulk adding of followers.