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();
29 'error' => $errorMessage,
30 'error_code' => $errorCode,
31 'error_data' => $errorData,
39 * Function returns array of result expected from previous function.
44 function profile_submit_expectedresult() {
46 $expectedResult = array(
54 'contact_type' => 'Individual',
55 'contact_sub_type' => '',
62 'legal_identifier' => '',
63 'external_identifier' => '',
64 'sort_name' => 'xyz2, abc2',
65 'display_name' => 'Mr. abc2 xyz2 II',
69 'preferred_communication_method' => '',
70 'preferred_language' => 'en_US',
71 'preferred_mail_format' => 'Both',
72 'hash' => '67eac7789eaee00',
74 'first_name' => 'abc2',
75 'middle_name' => 'J.',
76 'last_name' => 'xyz2',
80 'communication_style_id' => '',
81 'email_greeting_id' => '1',
82 'email_greeting_custom' => '',
83 'email_greeting_display' => 'Dear abc1',
84 'postal_greeting_id' => '1',
85 'postal_greeting_custom' => '',
86 'postal_greeting_display' => 'Dear abc1',
87 'addressee_id' => '1',
88 'addressee_custom' => '',
89 'addressee_display' => 'Mr. abc1 J. xyz1 II',
94 'deceased_date' => '',
95 'household_name' => '',
96 'primary_contact_id' => '',
97 'organization_name' => '',
99 'user_unique_id' => '',
100 'created_date' => '2013-07-28 08:49:19',
101 'modified_date' => '2012-11-14 16:02:35',
106 return $expectedResult;
110 * This example has been generated from the API test suite.
111 * The test that created it is called "testProfileSubmit"
112 * and can be found at:
113 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
115 * You can see the outcome of the API tests at
116 * https://test.civicrm.org/job/CiviCRM-master-git/
118 * To Learn about the API read
119 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
121 * Browse the api on your own site with the api explorer
122 * http://MYSITE.ORG/path/to/civicrm/api
124 * Read more about testing here
125 * http://wiki.civicrm.org/confluence/display/CRM/Testing
127 * API Standards documentation:
128 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards