I am creating a contact using CiviCRM API, what I have noticed that the duplicate checking looks inaccurate compared to the check done when entering new contacts via the User Interface.
Under the CiviCRM API, it's only a match if the given parameters are exactly the same like "John Smith of [email protected]" does not match "Johnathan Smith of [email protected]", for example, but in the UI, simply entering a matching e-mail address throws a warning.
Is there a way to make the CiviCRM API dupe check behave more like the UI ?
I am passing the parameter dupe_check = true
. The complete call is:
$result = civicrm_api3('Contact', 'create',
array( 'sequential' => 1,
'contact_type' => "Individual",
'first_name' => "raj",
'last_name' => "l",
'dupe_check' => 1,
'api.Email.create' => array('email' => "[email protected]"), )
);
check_permissions: 0
in a call to api.Contact.create. The reason for this is that permissions are taken into account when checking for dupes, so an anonymous user who fills out a form is never going to get matched unless you have very permissive configs. Further note: client-side requests havecheck_permissions
forced to 1, so you may have to get creative if you aren't working in PHP.