2

Can someone please verify that the API for contact>duplicatecheck is actually working?

In my case the UI will return 8 dupes, but the API will not return any.

It seems to be broken as of late. From what I understand, running duplicatecheck without any parameters from the API explorer "should" return all duplicate contacts using the default unsupervised rule (for individuals). I have checked the official sandbox for drupal and it does not appear to work either.

If you can get it working, can you please supply the PHP code that worked?

Thanks!

1

Here is a piece of code that works :

$res = civicrm_api3('Contact', 'duplicatecheck',
  array(
    'match' => array(
      'contact_type' => 'Individual',
      'first_name' => 'Jane',
      'last_name' => 'Doe',
      'email' => 'jane@example.org',
    ),
  )
);

Return :

Array
(
    [is_error] => 0
    [version] => 3
    [count] => 1
    [id] => 810
    [values] => Array
        (
            [810] => Array
                (
                )

        )

)

Note that :

  • contact_type is really important because it help the api choose the proper rule and CiviCRM won't give you any error if you omit it
  • I'm not sure if it's possible to test it from the api explorer because match is an array and i have no clue how to put an array in this context...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.