I am trying to add contacts to Constant Contact account using V3 API. Some user data contain accent characters, when I add these it is showing as unicode
characters in constant contact account.
For example First name is GÒKÜL and last name is NÁTH. It is showing in constant contact as Gu00d2Ku00dcL and Nu00c1TH. I want to show these as original.
I think issue is in my curl function to add/update contact. Below is the code
function updateContact($access_token,$contactid,$entry){
$ch = curl_init();
$base = 'https://api.cc.email/v3/';
$url = $base . '/contacts/'.$contactid;
curl_setopt($ch, CURLOPT_URL, $url);
$authorization = 'Authorization: Bearer ' . $access_token;
$ct = 'Content-Type: application/json;';
curl_setopt($ch, CURLOPT_HTTPHEADER, array($authorization, $ct));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, $entry);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
I tried $ct = 'Content-Type: application/json; charset=UTF-8';
and $result = utf8_decode(curl_exec($ch));
But not working.
I think someone can help me..