I am using REST API and I want to get all the fields value from Infusionsoft including ‘Custom Fields’. I am trying with cURL, below is the code :
$getLeadURL = ‘https://api.infusionsoft.com/crm/rest/v1/contacts/181426?optional_properties=custom_fields,notes&access_token=’;
$chl = curl_init();
curl_setopt($chl, CURLOPT_URL, $getLeadURL);
curl_setopt($chl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($chl, CURLOPT_TIMEOUT, 60);
$content = curl_exec( $chl );
$response = curl_getinfo( $chl );
curl_close ( $chl );
echo $content;
But I am not getting all the fields value. I want some extra fields value, but how can I? I don’t know the all fields name so that’s why I can’t pass the fields on ‘optional_properties’?
I need ‘Previous Booker’ field value on the tab ‘Additional Info’, but I don’t know how can I pass the field name on cUrl url ‘optional_properties’?
And one more thing, if I am passing the field ‘lead_source_id’ on ‘optional_properties’ then it gives only the ID of lead_source, but how can I get the text value of lead source?
You can retrieve a list of all Custom Fields available on the Contact model by querying the /contacts/model endpoint. It returns a list of values showing the Id, Name and related properties of the Custom Fields.
Then, when you Retrieve a Contact and specify optional_properties=custom_fields, the Custom Fields will be attached with their values, related by those Ids.
I would recommend using the Interactive Documentation to run the commands, and verify that they give you a workable result.
So, we did some digging; it looks like those are actually other fields, just relabeled to new names. The actual field names of those four are AssistantName, AssistantPhone, SSN and Birthday.
The REST endpoint represents a “current” model of the Contact, and lacks three of those four fields (only Birthday is supported going forward).
I would normally recommend that you use Custom Fields to supply arbitrary data regarding a Contact, put it appears that your application is currently up against the hard limit of Custom Fields on the Contact object. You may want to identify which fields aren’t adding value to your process and prune them, then create new fields to store this data.