Answers.Body: <p>Here is a piece of code that works :</p>
  
  <pre><code>$res = civicrm_api3('Contact', 'duplicatecheck',
    array(
      'match' =&gt; array(
        'contact_type' =&gt; 'Individual',
        'first_name' =&gt; 'Jane',
        'last_name' =&gt; 'Doe',
        'email' =&gt; 'jane@example.org',
      ),
    )
  );
  </code></pre>
  
  <p>Return :</p>
  
  <pre><code>Array
  (
      [is_error] =&gt; 0
      [version] =&gt; 3
      [count] =&gt; 1
      [id] =&gt; 810
      [values] =&gt; Array
          (
              [810] =&gt; Array
                  (
                  )
  
          )
  
  )
  </code></pre>
  
  <p>Note that :</p>
  
  <ul>
  <li><code>contact_type</code> is really important because it help the api choose the proper rule and CiviCRM won't give you any error if you omit it</li>
  <li>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...</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-12T22:21:49.750Z
Answers.LastActivityDate: 2018-01-12T22:21:49.750Z
Answers.UserDisplayName: samuelsov
Body: <p>Can someone please verify that the API for contact>duplicatecheck is actually working? </p>
  
  <p>In my case the UI will return 8 dupes, but the API will not return any. </p>
  
  <p>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.</p>
  
  <p>If you can get it working, can you please supply the PHP code that worked?</p>
  
  <p>Thanks!</p>
  
Tags: <api><duplicate-contacts>
Title: API Contact>DuplicateCheck Not Working?
ThreadText: # API Contact>DuplicateCheck Not Working?
  
  (Asked by: username_0 on 2017-11-21)
  
  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!
  
  **Tags:** api, duplicate-contacts
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-01-12. Score: 2
  
  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...
  
  
  ---
  
  