/home/techb158/workloadmatch.com
Edit: /home/techb158/workloadmatch.com/postPersons.php (1875B)
$name,
'email' => $mail,
'phone' => $phone
);
// ================================== //
// API PERSONS domain
// ================================== //
$url = 'https://' . $company_domain . '.pipedrive.com/api/v1/persons?api_token=' . $api_token;
// ================================== //
// CURL access
// ================================== //
$ch1 = curl_init();
curl_setopt($ch1, CURLOPT_URL, $url);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch1, CURLOPT_POST, true);
curl_setopt($ch1, CURLOPT_POSTFIELDS, $persons);
echo 'Sending USER request...' . '
';
$output1 = curl_exec($ch1);
curl_close($ch1);
// ================================== //
// API array data convert to JSON format
// ================================== //
$result1 = json_decode($output1, true);
// ================================== //
// Check if an ID came back and print it
// ================================== //
if (!empty($result1['data']['id'])) {
echo 'Person was added successfully!' .$result1['data']['id']. '
';
}
else {
echo 'ERROR adding person';
}