I’m using the Rest PHP SDK, and have been successful in adding Contacts and updating Contacts when their email matches. I’m using this call…
$result = $infusionsoft->contacts()->create($contact, true);
But I also need to be able to update the account if the email address has been entered incorrectly. I have been able to update contacts with the XML portion by first searching for a Contact’s id and then updating like this…
$returnResult = $infusionsoft->data->query(‘Contact’, 10, 0, [’_MemberNumber’ => $memberNumber], [ ‘ID’], ‘Email’, true);
$id = $returnResult[0][‘ID’];
$result = $infusionsoft->contacts()->create([ ‘id’ => $id, ‘custom_fields’ => $newCustom, ‘email_addresses’ => [$email1], “opt_in_reason” => “Paid Member”]);
Is there not a simple way to use the Rest Create option and look for more than a duplicate email address?
Thanks!