custom fields not loading

I am posting a new subscriber using the csrest_subscribers wrapper.  In my testing, I have been able to insert a new subscriber's email and name but I cannot insert values into the 'State' custom field I created for that list.  Here's the relevant code:

require_once '../../csrest_subscribers.php';

$wrap = new CS_REST_Subscribers('xxxxxxxxxxxxxxx', 'xxxxxxxxxxxxxx');
$result = $wrap->add(array(
    'EmailAddress' => '',
    'Name' => 'xxxxx',
    'CustomFields' => array(
            'Key' => 'State',
            'Value' => 'VA'
    'Resubscribe' => true

i've xed out the API keys and identifiable data for presentation but these are correct and working. 

Does anyone know what might be the problem here?

Many thanks for any help


terryt terryt, 4 years ago

Hi Phil,

You actually want to pass "Virginia" instead of "VA".  Hope that helps!


Terry Tice
Campaign Monitor

Join 150,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free