I'm using this on a webform to capture a lead and it works great to capture a lead, but if the lead is already in the system, how do I update that lead? I'd like to add a comment or just append to the description of the lead in Espo if they're already in the system but right now it just doesn't do anything.
Code:
require_once(__DIR__.'/EspoApiClient.php');
$client = new EspoApiClient($url);
$formData = [
'salutationName' => $data['user_salutation'],
'firstName' => $data['user_first'],
'lastName' => $data['user_last'],
'accountName' => $data['user_organization'],
'title' => $data['user_title'],
//'phoneNumber' => $data['user_phone'],
'emailAddress' => $data['user_email'],
'description' => '(ID#'.$data['geoid'].')',
];
$client->request('POST', 'LeadCapture/' . $apiKey, $formData);

Comment