I am trying to upload a contact via the API and I'd like to also add their Account Number during the upload of the contact. Here is what I've tried with no success:
$custF = ;
$custF = ['account_number' => '12345'];
$contact = new Contact();
$contact->first_name = $_POST['first_name'];
$contact->last_name = $_POST['last_name'];
I thought I read it needs to be in an array but that doesn't seem to work. I also tried:
I cannot find any documentation on this as well.
I appreciate any insight.
Solved! Go to Solution.
It looks like you're using our SDK, so you don't need to JSON encode your content.
You can pass your custom field in by creating a custom field component, setting the values, and then adding it to the contact object.
$customField = new CustomField(); $customField->name = "CustomField1"; $customField->value = "343465"; $contact->addCustomField($customField);
Please give this a try and let me know if you're still seeing issues.
Tier II API Support Engineer