I have a problem while i am trying to update records in Zoho CRM using the contact id. I get the contact id using getSearchRecordsByPDC because i only have the contact email.
$urlObtenerId='https://crm.zoho.com/crm/private/xml/Contacts/getSearchRecordsByPDC?';
$criterioObtenerId='apikey='.$zoho_api.'&ticket='.$ticket.'&selectColumns=Contacts(Id)&searchColumn=email&searchValue='.$email;
//echo $urlObtenerId.$criterioObtenerId;
$ch0 = curl_init();
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_POST, true);
curl_setopt($ch0, CURLOPT_POSTFIELDS, $criterioObtenerId);
curl_setopt($ch0, CURLOPT_URL, $urlObtenerId);
$result0 = curl_exec($ch0);
//echo $result0;
$error0=curl_error($ch0);
if($error0) throw Exception_ForUser('Error al realizar la búsqueda del registro en Zoho CRM');
curl_close($ch0);
$id=$result0;
echo $id;
//Información a enviar
$xml= getZohoXML($first_name,$last_name,$email,$phone);
//Creamos la url con los datos
$zoho_url='https://crm.zoho.com/crm/private/xml/Contacts/updateRecords?';
$data='newFormat=1&apikey='.$zoho_api.'&ticket='.$ticket.'&xmlData='.$xml.'&id='.$id;
//echo $zoho_url.$data;
//Realizamos la llamada
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_URL, $zoho_url);
$result = curl_exec($ch);
echo $result;
$error=curl_error($ch);
if($error) throw Exception_ForUser('Error al modificar el registro');
curl_close($ch);
The getSearchRecordsByPDC returns the id correctly but when I execute the updateRecords, always returns error "
4600
Unable to process your request. Please verify if the name and value is appropriate for the "id" parameter".