4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using tag getlist API.
11 * Demonstrates use of api.getlist for autocomplete and quicksearch applications
16 function tag_getlist_example() {
18 'input' => 'New Tag3',
25 $result = civicrm_api3('tag', 'getlist', $params);
27 catch (CiviCRM_API3_Exception
$e) {
29 $errorMessage = $e->getMessage();
30 $errorCode = $e->getErrorCode();
31 $errorData = $e->getExtraParams();
33 'error' => $errorMessage,
34 'error_code' => $errorCode,
35 'error_data' => $errorData,
43 * Function returns array of result expected from previous function.
48 function tag_getlist_expectedresult() {
50 $expectedResult = array(
58 'label' => 'New Tag3',
59 'description' => array(
60 '0' => 'This is description for Our New Tag ',
63 'used_for' => 'civicrm_contact',
71 return $expectedResult;
75 * This example has been generated from the API test suite.
76 * The test that created it is called
79 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
81 * You can see the outcome of the API tests at
82 * https://test.civicrm.org/job/CiviCRM-master-git/
84 * To Learn about the API read
85 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
87 * Browse the api on your own site with the api explorer
88 * http://MYSITE.ORG/path/to/civicrm/api/explorer
90 * Read more about testing here
91 * http://wiki.civicrm.org/confluence/display/CRM/Testing
93 * API Standards documentation:
94 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards