3 * Test Generated example demonstrating the Activity.get API.
8 function activity_get_example() {
11 'activity_type_id' => '51',
13 'return.custom_1' => 1,
17 $result = civicrm_api3('Activity', 'get', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
25 'error' => $errorMessage,
26 'error_code' => $errorCode,
27 'error_data' => $errorData,
35 * Function returns array of result expected from previous function.
40 function activity_get_expectedresult() {
42 $expectedResult = array(
49 'source_contact_id' => '1',
51 'activity_type_id' => '51',
52 'subject' => 'test activity type id',
53 'location' => 'Pennsylvania',
54 'activity_date_time' => '2011-06-02 14:36:13',
55 'details' => 'a test activity',
57 'activity_name' => 'Test activity type',
58 'status' => 'Completed',
59 'custom_1' => 'custom string',
60 'custom_1_1' => 'custom string',
65 return $expectedResult;
69 * This example has been generated from the API test suite.
70 * The test that created it is called "testActivityGetContact_idCustom"
71 * and can be found at:
72 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
74 * You can see the outcome of the API tests at
75 * https://test.civicrm.org/job/CiviCRM-master-git/
77 * To Learn about the API read
78 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
80 * Browse the api on your own site with the api explorer
81 * http://MYSITE.ORG/path/to/civicrm/api
83 * Read more about testing here
84 * http://wiki.civicrm.org/confluence/display/CRM/Testing
86 * API Standards documentation:
87 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards