I am attempting to use the PHP Wrapper for the Highrise API located here:
https://github.com/ignaciovazquez/Highrise-PHP-Api
I need to set a custom field for a HighrisePerson object. According to the code this should be pretty straightforward...
$person->setCustomField("Field Name", $value); // Pulled almost straight out of the documentation
Unfortunately when I try to save this back to highrise using $person->save();
I get the following error:
Uncaught exception 'Exception' with message 'API for Person returned Status Code: 500 Expected Code: 200'
So the error isn't in the code... Highrise just isn't accepting the custom field. Any ideas as to why this is?
Ok... I figured it out...
In the API the following:
$person->setCustomField("Field Name", $value);
creates a new custom field within Highrise. So if there isn't already a custom field named "Field Name" it would create it. If that field already exists, it returns the 500 error.
To the best of my knowledge there's no way to set the value of an existing field using that wrapper. You can only create new fields, which is kind of jank.
I found a fork off that wrapper that's working pretty well for me. It's hosted here: https://github.com/AppSaloon/Highrise-PHP-Api
The usage in this one is confusing and took me a while to figure out.
Basically you want to do a search for all the custom fields in Highrise. Once you find the one you want, you assign it the requisite value... So the code looks like this:
I hope this helps someone else down the road who runs into the same issue. I discovered the forked PHP wrapper from another Stack Overflow question, but they were never able to get custom fields to work either.