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

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free