4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using activity get API.
11 * demonstrates _high filter (at time of writing doesn't work if contact_id is set
16 function activity_get_example() {
18 'source_contact_id' => 1,
19 'filter.activity_date_time_high' => '20120101000000',
24 $result = civicrm_api3('activity', 'get', $params);
26 catch (CiviCRM_API3_Exception
$e) {
28 $errorMessage = $e->getMessage();
29 $errorCode = $e->getErrorCode();
30 $errorData = $e->getExtraParams();
32 'error' => $errorMessage,
33 'error_code' => $errorCode,
34 'error_data' => $errorData,
42 * Function returns array of result expected from previous function.
47 function activity_get_expectedresult() {
49 $expectedResult = array(
57 'activity_type_id' => '51',
58 'subject' => 'Make-it-Happen Meeting',
59 'activity_date_time' => '2011-01-01 00:00:00',
61 'location' => 'Pennsylvania',
62 'details' => 'a test activity',
67 'is_current_revision' => '1',
69 'source_contact_id' => '1',
74 return $expectedResult;
78 * This example has been generated from the API test suite.
79 * The test that created it is called
80 * testGetFilterMaxDate
82 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
84 * You can see the outcome of the API tests at
85 * https://test.civicrm.org/job/CiviCRM-master-git/
87 * To Learn about the API read
88 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
90 * Browse the api on your own site with the api explorer
91 * http://MYSITE.ORG/path/to/civicrm/api/explorer
93 * Read more about testing here
94 * http://wiki.civicrm.org/confluence/display/CRM/Testing
96 * API Standards documentation:
97 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards