Updating Custom Field Values using the API


Any ideas on how to update the values of a custom field using the API? I am currently following this xml-rpc - Keap Developer Portal I am using the PHP SDK trying to add more options to a dropdown custom field.

This is what I have tried:

    $values = array(

        'label' => "TestField", 
        'options' => array(
            "label" => "TestOption"

$infusionsoft->data('xml')->updateCustomField($customFieldId, $values);

But I get this error, which is not very specific on what the problem is:

 [DatabaseError]Error updating custom field 

I tested only updating the name of the custom field, using this code below, which is successful:

$values = array('label' => 'TestField');
$infusionsoft->data('xml')->updateCustomField($customFieldId, $values);

Therefore I assume that it must be the format of the field values is wrong but I can not find any documentation on the correct format to use when updating the field values.

Any help would be greatly apricated.


Okay so I figured out how to do this. Working code below for anyone else who needs it:

$values = array(

        'Label' => "TestField", 
        'Values' => "TestOption"

$infusionsoft->data()->updateCustomField($customFieldId, $values);

Multiple values can be added using comma to separate the values. e.g

  'Values' => "TestOption, TestOption 2, TestOption 3"