3 * Test Generated example demonstrating the Contact.getunique API.
8 function contact_getunique_example() {
12 $result = civicrm_api3('Contact', 'getunique', $params);
14 catch (CiviCRM_API3_Exception
$e) {
16 $errorMessage = $e->getMessage();
17 $errorCode = $e->getErrorCode();
18 $errorData = $e->getExtraParams();
21 'error_message' => $errorMessage,
22 'error_code' => $errorCode,
23 'error_data' => $errorData,
31 * Function returns array of result expected from previous function.
36 function contact_getunique_expectedresult() {
42 'id' => 'UI_external_identifier',
44 'UI_external_identifier' => [],
48 return $expectedResult;
52 * This example has been generated from the API test suite.
53 * The test that created it is called "testContactGetUnique"
54 * and can be found at:
55 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
57 * You can see the outcome of the API tests at
58 * https://test.civicrm.org/job/CiviCRM-Core-Matrix/
60 * To Learn about the API read
61 * https://docs.civicrm.org/dev/en/latest/api/
63 * Browse the API on your own site with the API Explorer. It is in the main
64 * CiviCRM menu, under: Support > Development > API Explorer.
66 * Read more about testing here
67 * https://docs.civicrm.org/dev/en/latest/testing/
69 * API Standards documentation:
70 * https://docs.civicrm.org/dev/en/latest/framework/api-architecture/