4 Function demonstrates getting asignee_contact_id & using it to get the contact
6 function activity_get_example(){
11 'return.assignee_contact_id' => 1,
12 'api.contact.get' => array(
13 'id' => '$value.source_contact_id',
17 $result = civicrm_api( 'activity','get',$params );
23 * Function returns array of result expected from previous function
25 function activity_get_expectedresult(){
27 $expectedResult = array(
35 'activity_type_id' => '46',
36 'subject' => 'test activity type id',
37 'activity_date_time' => '2011-06-02 14:36:13',
39 'location' => 'Pensulvania',
40 'details' => 'a test activity',
45 'is_current_revision' => '1',
47 'assignee_contact_id' => array(
50 'source_contact_id' => '17',
51 'api.contact.get' => array(
59 'contact_type' => 'Individual',
60 'contact_sub_type' => '',
62 'display_name' => 'Test Contact',
69 'legal_identifier' => '',
70 'external_identifier' => '',
74 'preferred_mail_format' => '',
75 'first_name' => 'Test',
77 'last_name' => 'Contact',
81 'deceased_date' => '',
82 'household_name' => '',
83 'organization_name' => '',
85 'contact_is_deleted' => 0,
86 'current_employer' => '',
88 'street_address' => '',
89 'supplemental_address_1' => '',
90 'supplemental_address_2' => '',
92 'postal_code_suffix' => '',
96 'state_province_id' => '',
97 'state_province_name' => '',
98 'state_province' => '',
102 'phone_type_id' => '',
110 'worldregion_id' => '',
111 'world_region' => '',
120 return $expectedResult ;
125 * This example has been generated from the API test suite. The test that created it is called
127 * testActivityGetGoodID1 and can be found in
128 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ActivityTest.php
130 * You can see the outcome of the API tests at
131 * http://tests.dev.civicrm.org/trunk/results-api_v3
133 * To Learn about the API read
134 * http://book.civicrm.org/developer/current/techniques/api/
136 * and review the wiki at
137 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
139 * Read more about testing here
140 * http://wiki.civicrm.org/confluence/display/CRM/Testing
142 * API Standards documentation:
143 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards