3 * Test Generated example of using contact get API.
8 function contact_get_example() {
10 'email' => 'man2@yahoo.com',
14 $result = civicrm_api3('contact', 'get', $params);
16 catch (CiviCRM_API3_Exception
$e) {
18 $errorMessage = $e->getMessage();
19 $errorCode = $e->getErrorCode();
20 $errorData = $e->getExtraParams();
22 'error' => $errorMessage,
23 'error_code' => $errorCode,
24 'error_data' => $errorData,
32 * Function returns array of result expected from previous function.
37 function contact_get_expectedresult() {
39 $expectedResult = array(
47 'contact_type' => 'Individual',
48 'contact_sub_type' => '',
49 'sort_name' => 'man2@yahoo.com',
50 'display_name' => 'man2@yahoo.com',
57 'legal_identifier' => '',
58 'external_identifier' => '',
62 'preferred_communication_method' => '',
63 'preferred_language' => 'en_US',
64 'preferred_mail_format' => 'Both',
71 'communication_style_id' => '',
76 'deceased_date' => '',
77 'household_name' => '',
78 'organization_name' => '',
80 'contact_is_deleted' => 0,
81 'current_employer' => '',
83 'street_address' => '1 my road',
84 'supplemental_address_1' => '',
85 'supplemental_address_2' => '',
87 'postal_code_suffix' => '',
91 'state_province_id' => '',
94 'phone_type_id' => '',
97 'email' => 'man2@yahoo.com',
102 'worldregion_id' => '',
103 'world_region' => '',
104 'individual_prefix' => '',
105 'individual_suffix' => '',
106 'communication_style' => '',
108 'state_province_name' => '',
109 'state_province' => '',
116 return $expectedResult;
120 * This example has been generated from the API test suite.
121 * The test that created it is called
122 * testContactGetEmail
123 * and can be found in
124 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
126 * You can see the outcome of the API tests at
127 * https://test.civicrm.org/job/CiviCRM-master-git/
129 * To Learn about the API read
130 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
132 * Browse the api on your own site with the api explorer
133 * http://MYSITE.ORG/path/to/civicrm/api
135 * Read more about testing here
136 * http://wiki.civicrm.org/confluence/display/CRM/Testing
138 * API Standards documentation:
139 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards