3 * Test Generated example of using survey get API
6 function survey_get_example(){
8 'title' => 'survey title',
9 'activity_type_id' => '35',
10 'max_number_of_contacts' => 12,
11 'instructions' => 'Call people, ask for money',
15 $result = civicrm_api3('survey', 'get', $params);
17 catch (CiviCRM_API3_Exception
$e) {
19 $errorMessage = $e->getMessage();
20 $errorCode = $e->getErrorCode();
21 $errorData = $e->getExtraParams();
22 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
29 * Function returns array of result expected from previous function
31 function survey_get_expectedresult(){
33 $expectedResult = array(
41 'title' => 'survey title',
42 'activity_type_id' => '35',
43 'instructions' => 'Call people, ask for money',
44 'max_number_of_contacts' => '12',
47 'created_date' => '2013-07-28 08:49:19',
48 'bypass_confirm' => 0,
54 return $expectedResult;
59 * This example has been generated from the API test suite. The test that created it is called
61 * testGetSurvey and can be found in
62 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
64 * You can see the outcome of the API tests at
65 * https://test.civicrm.org/job/CiviCRM-master-git/
67 * To Learn about the API read
68 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
70 * Browse the api on your own site with the api explorer
71 * http://MYSITE.ORG/path/to/civicrm/api/explorer
73 * Read more about testing here
74 * http://wiki.civicrm.org/confluence/display/CRM/Testing
76 * API Standards documentation:
77 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards