4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using survey create API.
15 function survey_create_example() {
17 'title' => 'survey title',
18 'activity_type_id' => '30',
19 'max_number_of_contacts' => 12,
20 'instructions' => 'Call people, ask for money',
24 $result = civicrm_api3('survey', 'create', $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 survey_create_expectedresult() {
49 $expectedResult = array(
57 'title' => 'survey title',
59 'activity_type_id' => '30',
60 'recontact_interval' => '',
61 'instructions' => 'Call people, ask for money',
62 'release_frequency' => '',
63 'max_number_of_contacts' => '12',
64 'default_number_of_contacts' => '',
68 'created_date' => '2013-07-28 08:49:19',
69 'last_modified_id' => '',
70 'last_modified_date' => '',
72 'bypass_confirm' => '',
73 'thankyou_title' => '',
74 'thankyou_text' => '',
80 return $expectedResult;
84 * This example has been generated from the API test suite.
85 * The test that created it is called
88 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
90 * You can see the outcome of the API tests at
91 * https://test.civicrm.org/job/CiviCRM-master-git/
93 * To Learn about the API read
94 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
96 * Browse the api on your own site with the api explorer
97 * http://MYSITE.ORG/path/to/civicrm/api/explorer
99 * Read more about testing here
100 * http://wiki.civicrm.org/confluence/display/CRM/Testing
102 * API Standards documentation:
103 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards