IsraelOrtuno / pipedrive

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

Unable to get custom fields data using API #74

Closed thisishassan closed 5 years ago

thisishassan commented 5 years ago

I was going through your API client, trying to use it to get custom fields from organizations and their related data. But i dont see any implementation for getting those fields.

mrzainulabideen commented 5 years ago

If you use the quick start example you will get an organization which contains all of the fields that are available with the given organization if there are any custom fields attached to it, it would show in the object of stdClass

Request :

$token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx';
$pipedrive = new Pipedrive($token);

$organization = $pipedrive->organizations->find(1);
var_dump($organization->getData());

Response :

---- left for visibility -----
public $d48caf6cf00a588cafc592ba35b282c32d9c4d32 =>
NULL
public $26262a38965841d3030c1b5774b9006bd634eaa5 =>
NULL
public $c74c687eab83ffbc68625dfcda16798a4c2436de =>
NULL
---- left for visibility -----

This response contains some of the custom fields of an organization.

I think you can also try this and it would work. :100: Enjoy!!!

IsraelOrtuno commented 5 years ago

Yup! I don't know why Pipedrive does not develop a proper EAV system (or whatever) to make the attribute names more intuitive...