3 * Test Generated example demonstrating the Profile.submit API.
8 function profile_submit_example() {
12 'first_name' => 'abc2',
13 'last_name' => 'xyz2',
14 'email-primary' => 'abc2.xyz2@gmail.com',
15 'phone-1-1' => '022 321 826',
16 'country-1' => '1013',
17 'state_province-1' => '1000',
21 $result = civicrm_api3('Profile', 'submit', $params);
23 catch (CiviCRM_API3_Exception
$e) {
25 $errorMessage = $e->getMessage();
26 $errorCode = $e->getErrorCode();
27 $errorData = $e->getExtraParams();
30 'error_message' => $errorMessage,
31 'error_code' => $errorCode,
32 'error_data' => $errorData,
40 * Function returns array of result expected from previous function.
45 function profile_submit_expectedresult() {
55 'contact_type' => 'Individual',
56 'contact_sub_type' => '',
63 'legal_identifier' => '',
64 'external_identifier' => '',
65 'sort_name' => 'xyz2, abc2',
66 'display_name' => 'Mr. abc2 xyz2 II',
70 'preferred_communication_method' => '',
71 'preferred_language' => 'en_US',
72 'preferred_mail_format' => 'Both',
73 'hash' => '67eac7789eaee00',
75 'first_name' => 'abc2',
76 'middle_name' => 'J.',
77 'last_name' => 'xyz2',
81 'communication_style_id' => '',
82 'email_greeting_id' => '1',
83 'email_greeting_custom' => '',
84 'email_greeting_display' => 'Dear abc1',
85 'postal_greeting_id' => '1',
86 'postal_greeting_custom' => '',
87 'postal_greeting_display' => 'Dear abc1',
88 'addressee_id' => '1',
89 'addressee_custom' => '',
90 'addressee_display' => 'Mr. abc1 J. xyz1 II',
95 'deceased_date' => '',
96 'household_name' => '',
97 'primary_contact_id' => '',
98 'organization_name' => '',
100 'user_unique_id' => '',
101 'created_date' => '2013-07-28 08:49:19',
102 'modified_date' => '2012-11-14 16:02:35',
107 return $expectedResult;
111 * This example has been generated from the API test suite.
112 * The test that created it is called "testProfileSubmit"
113 * and can be found at:
114 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
116 * You can see the outcome of the API tests at
117 * https://test.civicrm.org/job/CiviCRM-master-git/
119 * To Learn about the API read
120 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
122 * Browse the api on your own site with the api explorer
123 * http://MYSITE.ORG/path/to/civicrm/api
125 * Read more about testing here
126 * http://wiki.civicrm.org/confluence/display/CRM/Testing
128 * API Standards documentation:
129 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards