hello good, I'm using the api, it works perfectly, I put any field and write it well, but the one that interests me the "id" or "ContactID" as it is, I create one randomly automatically, I want to assign one to me .. no me I fuck it ??? .. some solution ??? I leave the code below--
$postFields = json_encode(array(
'id' => '5634563456',
));
$url = "crm.fvmediterraneo.com/api/v1/Contact";
$httpMethod = "POST";
$httpHeaders = [];
$httpHeaders['Authorization'] = 'Basic ' . base64_encode('admin:80803ss24');
$httpHeaders["Content-type"] = "application/json";
$curlOptions = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_CUSTOMREQUEST => $httpMethod
);
$curlOptions[CURLOPT_POST] = true;
$curlOptions[CURLOPT_POSTFIELDS] = $postFields;
$curlOptions[CURLOPT_URL] = $url;
$curlOptHttpHeader = array();
foreach ($httpHeaders as $key => $value) {
$curlOptHttpHeader[] = "{$key}: {$value}";
}
$curlOptions[CURLOPT_HTTPHEADER] = $curlOptHttpHeader;
$ch = curl_init();
curl_setopt_array($ch, $curlOptions);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$responceHeader = substr($response, 0, $headerSize);
$responceBody = substr($response, $headerSize);
$resultArray = null;
if ($curlError = curl_error($ch)) {
throw new Exception($curlError);
} else {
$resultArray = json_decode($responceBody, true);
}
curl_close($ch);
$postFields = json_encode(array(
'id' => '5634563456',
));
$url = "crm.fvmediterraneo.com/api/v1/Contact";
$httpMethod = "POST";
$httpHeaders = [];
$httpHeaders['Authorization'] = 'Basic ' . base64_encode('admin:80803ss24');
$httpHeaders["Content-type"] = "application/json";
$curlOptions = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_CUSTOMREQUEST => $httpMethod
);
$curlOptions[CURLOPT_POST] = true;
$curlOptions[CURLOPT_POSTFIELDS] = $postFields;
$curlOptions[CURLOPT_URL] = $url;
$curlOptHttpHeader = array();
foreach ($httpHeaders as $key => $value) {
$curlOptHttpHeader[] = "{$key}: {$value}";
}
$curlOptions[CURLOPT_HTTPHEADER] = $curlOptHttpHeader;
$ch = curl_init();
curl_setopt_array($ch, $curlOptions);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$responceHeader = substr($response, 0, $headerSize);
$responceBody = substr($response, $headerSize);
$resultArray = null;
if ($curlError = curl_error($ch)) {
throw new Exception($curlError);
} else {
$resultArray = json_decode($responceBody, true);
}
curl_close($ch);