Skip to content

Instantly share code, notes, and snippets.

@rotten77
Created September 26, 2014 07:45
Show Gist options
  • Save rotten77/a18dc2b59652ecbd14f9 to your computer and use it in GitHub Desktop.
Save rotten77/a18dc2b59652ecbd14f9 to your computer and use it in GitHub Desktop.
Campaign Monitor - update multi-options of custom field
/**
*=====================================================================
* Campaign Monitor API
* PHP library: http://campaignmonitor.github.io/createsend-php/
*/
define('API_KEY', '');
define('LIST_ID', '');
include_once dirname(__FILE__) . "/createsend-php/csrest_lists.php";
$wrap = new CS_REST_Lists(LIST_ID, API_KEY);
$values = array(
"Value 1",
"Value 2",
"Value 3",
"Value 4",
"Value 5",
);
$keepExisting = false;
$result = $wrap->update_field_options('[CustomColumnName]', $values, $keepExisting);
if($result->was_successful()) {
echo 'OK';
var_dump($result);
} else {
echo 'ERR CODE: '.$result->http_status_code;
var_dump($result->response);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment