Showing results for 
Search instead for 
Do you mean 

Probleme on Adding Contact Using IE on ACT WEB API Version:

New Member
Posts: 4
Country: France

Probleme on Adding Contact Using IE on ACT WEB API Version:


Hello , 

im tryinng  To add a contact Using the ACT WEB API . i Get variable threw "GET" METHOD FROM AN URL Given  By another Web Application Running only on IE (INTERNET EXPLORER ) .my problem is when i try to add a contact using IE BRowser  I get this RESPONSE FROM THE SERVER :


NULL string(0) "" string(45) "{ "note.contacts[0].id": [ "" ] }"


WHEN I USE ANOTHER BROWSERl like GOOGLE CHROME  i get an normal response and i found my contact in my ACT Data base  


this is my code : 




echo session_status();
if (session_status()==1) 
echo session_status();

if ($_SESSION["barrer"] == NULL)
  $_SESSION["barrer"] = $token;



function get_barrer($auth)

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

$headers = array();
$headers[] = "Authorization: Basic ".$auth;
$headers[] = "Act-Database-Name: WBCC_GROUP";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
curl_close ($ch);
return $result;

echo "<p> $barrer </p>";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "");
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

$headers = array(
'Authorization: Bearer ' .$barrer,
'Content-type: application/json'
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$addcontact= array
    "fullName" => $fullname,
    "emailAddress" => $email,
    "mobilePhone" => $mobile,
    "businessPhone" => $tel ,
    "website" =>$site_int,
    "faxPhone" => $fax,
    "businessAddress" => array(
    "line1" => $adresse,
    "city" => $ville,
    "postalCode" =>$cp,
    "country"=> "France"
    "customFields" => array(
      "code naf" => $codenaf,
       "siret" => $siret,
      "statut" => $status,
     "secteur d'activité bd" => $Activite,
      "effectif" => $effectif


$json = json_encode($addcontact);

curl_setopt($ch, CURLOPT_POSTFIELDS, $json);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
curl_close ($ch);


if (isset($id_contact)) $affichage="Ficher Inseree sur ACT AVEC SUCCES "; else 
 $affichage="Probleme servenue lors de la communication avec APi ( Essaye de rinserer la fiche ) "; 

$ch1 = curl_init();

curl_setopt($ch1, CURLOPT_URL, "");
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch1, CURLOPT_POSTFIELDS, "{\n \n  \"noteText\": \"$commentaire\",\n  \n  \"contacts\": [\n    {\n      \"id\": \"$id_contact\",\n    \n    }\n  ]\n}");
curl_setopt($ch1, CURLOPT_POST, 1);

curl_setopt($ch1, CURLOPT_HTTPHEADER, $headers);

$result1 = curl_exec($ch1);
if (curl_errno($ch1)) {
    echo 'Error:' . curl_error($ch1);
curl_close ($ch1);



Posts: 1,376
Country: United_Kingdom

Re: Probleme on Adding Contact Using IE on ACT WEB API Version:

If you are getting a correct response on one browser, and not on another - it's likely that the issue doesn't come from the response itself but they way your code is interpreting the response. I can't help you with your php script unfortunately, but I'd start by making sure the raw response from the server is as expected before it's handled in anyway.