Just like the subject states, the REST API orders and contact endpoints do not contain the custom fields for the orders nor is there any documentation on how to include them if that is an option. I get the same result with the UI test as well as the PHP SDK.
What I have tried:
Tried this because of the documentation on the contacts endpoint for retrieve a contact which works
//url: /crm/rest/v1/contacts?access_token=X&optional_properties=custom_fields
$infusionsoft->contacts()->where([‘optional_properties’ => “custom_fields”,])->get() (This one returns an empty array but has the placeholder)
Is there a special way to get custom fields to return and if so what is it? If this is not a feature can we either make it one or remove the bad example from the documentation?
I have also noticed that the ‘company’ property does not actually exist as documented. It only exists as a name on the ‘contact’ and ‘shipping_information’ properties. Also, the ‘contact’ property is very different from the documentation.
No idea why it made me create a new account, but no, I never got anywhere else with this. I honestly just stopped using the REST API for a lot of things because of drawbacks like this. The order model endpoint shows custom field but I don’t see a way to get it through the explorer page, and don’t really have the time to set up a test script to see.
^ where they indicate that you can send the optional property – translate that into the code-
->with([‘custom_fields’])
When learning/using the legacy API – there was this whole page of PHP SDK that was all copy/paste-able plug and play -
like $app->dsFind( etc etc ).
Is there some convention that any REST API works with things like ->with() and if it says it’s an array - then use [ ] inside the ()?
Or is with() and get() and etc all specific to Infusionsoft’s library? If so - any suggestions on where I can better understand what things are available/what works?
Or do you know of any legacy API package available for Laravel 7?
So the ->with() and all those similar pieces are a part of the IFS SDK when using the REST methods. I figured most of them out by just traversing the code; I am not sure if there is much documentation on using those though.
The Github page has some Laravel instructions here
The SDK also still allows you to easily use all of the legacy XML endpoints as well. It would look something like $ifs->data()->query(stuff). It can be a bit confusing but if you look here and choose the PHP option at the top right hand side it will show you SDK examples for each method.