Add Tags to a Specific Record
Purpose
To add tags to a specific record.
Request URL
https://www.zohoapis.com/crm/v2/{module_api_name}/{record_id}/actions/add_tags?tag_names={tag1},{tag2}
Scope
module_api_name - The api name of the module
record_id - The unique ID of the tag
Request Method
POST
Scope
scope=ZohoCRM.modules.all
(or)
scope=ZohoCRM.modules.{module_name}.{operation_type}
Possible module names | Possible operation types |
---|---|
leads, accounts, contacts, deals, campaigns, tasks, cases, events, calls, solutions, products, vendors, pricebooks, quotes, salesorders, purchaseorders, invoices, and custom | ALL - Full data access WRITE - Edit tag data CREATE - Create tag data |
Parameters
Parameter Name | Data Type | Description |
---|---|---|
tag_names (mandatory) | String | Specify the names of the tags to be added. |
over_write | Boolean | Specify if existing tags are to be overwritten. Default value is false. |
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v2/Contacts/2445013000000402006/actions/add_tags?tag_names=From Email,High Priority&over_write=true"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
CopiedZCRMRecord recordIns = ZCRMRecord.getInstance("Leads", 3719520000000329001L);//Module Api Name , 3719520000000329001 record id
List<String> tagNames = new ArrayList<String>();
tagNames.add("From Webforms");
tagNames.add("High Priority");
APIResponse response = recordIns.addTags(tagNames); //tagNames is array
ZCRMRecord record = (ZCRMRecord)response.getData();
Copied def add_tags(self):
try:
tag_names = ["2", "3"]
resp = ZCRMRecord.get_instance("Leads", "3719520000000320001").add_tags(tag_names)
print(resp.details)
print(resp.status)
print(resp.message)
print(resp.code)
print(resp.data.entity_id)
for tag in resp.data.tag_list:
print(tag.name)
except ZCRMException as ex:
print(ex.status_code)
print(ex.error_message)
print(ex.error_code)
print(ex.error_details)
print(ex.error_content)
Copied/** Add Tags to a Specific record */
$zcrmRecordIns = ZCRMRecord::getInstance("Leads","3372164000001254034"); //Module Api Name , 3372164000001254034 tag id
$tagNames = array("Name5","Name6");
$apiResponse = $zcrmRecordIns->addTags($tagNames); //$tagNames is array
$record = $apiResponse->getData(); //$record - ZCRMRecord instances
CopiedZCRMRecord recordIns = ZCRMRecord.GetInstance("Leads", 3372164000001600009);//Module Api Name , 3372164000001254034 record id
List<string> tagNames = new List<string>{ "Name5", "Name6" };
APIResponse response = recordIns.AddTags(tagNames); //tagNames is array
ZCRMRecord record = (ZCRMRecord)response.Data;
Sample Response
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "3719520000000329001L",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Sample Response
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "3719520000000329001L",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Sample Response
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "3719520000000329001L",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Sample Response
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "3719520000000329001L",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "2445013000000402006",
"tags": [
"From Webforms",
"High Priority"
]
},
"message": "tags updated successfully",
"status": "success"
}
]
}