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 _low filter (at time of writing doesn't work if contact_id is set
16 function activity_get_example() {
18 'filter.activity_date_time_low' => '20120101000000',
23 $result = civicrm_api3('activity', 'get', $params);
25 catch (CiviCRM_API3_Exception
$e) {
27 $errorMessage = $e->getMessage();
28 $errorCode = $e->getErrorCode();
29 $errorData = $e->getExtraParams();
31 'error' => $errorMessage,
32 'error_code' => $errorCode,
33 'error_data' => $errorData,
41 * Function returns array of result expected from previous function.
46 function activity_get_expectedresult() {
48 $expectedResult = array(
56 'activity_type_id' => '51',
57 'subject' => 'Make-it-Happen Meeting',
58 'activity_date_time' => '2012-02-16 00:00:00',
60 'location' => 'Pennsylvania',
61 'details' => 'a test activity',
66 'is_current_revision' => '1',
68 'source_contact_id' => '1',
73 return $expectedResult;
77 * This example has been generated from the API test suite.
78 * The test that created it is called
79 * testGetFilterMaxDate
81 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
83 * You can see the outcome of the API tests at
84 * https://test.civicrm.org/job/CiviCRM-master-git/
86 * To Learn about the API read
87 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
89 * Browse the api on your own site with the api explorer
90 * http://MYSITE.ORG/path/to/civicrm/api/explorer
92 * Read more about testing here
93 * http://wiki.civicrm.org/confluence/display/CRM/Testing
95 * API Standards documentation:
96 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards