IsraelOrtuno / pipedrive

Complete Pipedrive API client for PHP
MIT License
166 stars 58 forks source link

How to find deal by org_id? #42

Closed pelcomppl closed 6 years ago

pelcomppl commented 6 years ago

Hi

in documentation (https://developers.pipedrive.com/docs/api/v1/#!/Deals/get_deals_find) it is possible to get deal by org_id. How to do it with your library? Pipedrive::deals()->find(['org_id' => 122]); Not works.

IsraelOrtuno commented 6 years ago

To use that endpoint you have to use the findByName method:

Pipedrive::deals()->findByName($term, ['org_id' => 122]);
IsraelOrtuno commented 6 years ago

You can also do it this way:

https://developers.pipedrive.com/docs/api/v1/#!/Organizations/get_organizations_id_deals

Pipedrive::organizations()->deals($organizationId);

https://github.com/IsraelOrtuno/pipedrive/blob/master/src/Resources/Traits/ListsDeals.php#L14-L19