3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * This api exposes CiviCRM tags.
15 * Tags are used to classify CRM entities (including Contacts, Groups and Actions).
17 * @note this api is for working with tags themselves. To add/remove tags from
18 * a contact or other entity, use the EntityTag api.
20 * @package CiviCRM_APIv3
24 * Create or update a tag.
26 * Tags are used to classify CRM entities (including Contacts, Groups and Actions).
28 * @param array $params
29 * Array per getfields metadata.
34 function civicrm_api3_tag_create($params) {
35 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'Tag');
39 * Specify Meta data for create.
41 * Note that this data is retrievable via the getfields function
42 * and is used for pre-filling defaults and ensuring mandatory requirements are met.
44 * @param array $params
46 function _civicrm_api3_tag_create_spec(&$params) {
47 $params['used_for']['api.default'] = 'civicrm_contact';
48 $params['name']['api.required'] = 1;
49 $params['id']['api.aliases'] = ['tag'];
53 * Delete an existing Tag.
55 * @param array $params
60 function civicrm_api3_tag_delete($params) {
61 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
67 * This api is used for finding an existing tag.
68 * Either id or name of tag are required parameters for this api.
70 * @param array $params
71 * Array per getfields metadata.
76 function civicrm_api3_tag_get($params) {
78 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);