//Tell CURL we want responses returned to us when we execute.curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

//recommend to use a unique, api only user, so you can trace data changes.//Don't forget to actually add the user in the interface!//This uses HTTP-Auth, which is built into the HTTP Protocol. Curl supports this natively.curl_setopt($ch, CURLOPT_USERPWD, 'api-user@your-domain.com:sekritpassword');

//please ensure you are validating the server certificate to prevent man in the middle security attacks.curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);

//if the contact exists, update them with this info. if they don't, create the contact.'overwrite' => true,

//left hand side of this map represent the column names you used above in the 'contacts' array. //right hand side of this map are the Attribute names in our system. They must match exactly the names in our system. you can find lists of these attributes when you segment by Contact Attributes, be it Custom or Standard. //Note how the properties of the 'contacts' array above exactly match the left hand side properties of this map.'contact_import_mapping' => array('email address' => 'Email Address','visitor_id' => 'Unique Visitor UUID','first' => 'First Name','last' => 'Last Name'),

//leave as an empty array to skip notifications. recommend to leave on while testing'notification_recipients' => array('youraddress@yourdomain.com'),

//list ids to add these contacts to. leave blank like remove_from_lists to do nothing //get list ids from the api EmailList controller, or via interface by hovering the link to edit a list.'add_to_lists' => array(123456,123457),

//We are sending this as POST submission.curl_setopt($ch, CURLOPT_POST, true);

$strResponse = curl_exec($ch);

//recommend to check for curl response code < 400, so that you know if the server encountered an error or if you may safely proceed.if ($strResponse) {//decode response as an array$arrResponse = json_decode($strResponse, true);