Update Multiple Tags
Purpose
To update multiple tags simultaneously.
Request URL
https://www.zohoapis.com/crm/v2/settings/tags?module={module_api_name}
module_api_name - The API name of the module
Request Method
PUT
Scope
scope=ZohoCRM.settings.all
(or)
scope=ZohoCRM.settings.tags.{operation_type}
| Possible operation types |
|---|
| ALL - Full data access WRITE - Edit tag data UPDATE - Update tag data |
Parameters
| Parameter Name | Data Type | Description |
|---|---|---|
| module (mandatory) | String | Specify the API name of the module such as Leads, Contacts, Accounts, Deals, etc,. |
Sample Request
In the input, @multipletagupdate.json contains the sample input data.
curl "https://www.zohoapis.com/crm/v2/settings/tags?module=Contacts"
-X PUT
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@multipletagupdate.json" Sample Input
{
"tags": [
{
"id": "410888000000482039",
"name": "Chems"
},
{
"id": "410888000000482040",
"name": "Agricultural"
}
]
} Sample Response
{
"tags": [
{
"code": "SUCCESS",
"message": "tags updated successfully",
"status": "success",
"details": {
"created_by": {
"id": "2000000030444",
"name": "Chems"
},
"created_time": "2017-03-24T11:08:23+05:30",
"id": "2000000088041",
"modified_by": {
"id": "2000000030784",
"name": "Medical"
},
"modified_time": "2017-03-24T11:08:23+05:30"
}
},
{
"code": "SUCCESS",
"message": "tags updated successfully",
"status": "success",
"details": {
"created_by": {
"id": "2000000030344",
"name": "Agricultural"
},
"created_time": "2017-03-24T11:08:23+05:30",
"id": "2000000088041",
"modified_by": {
"id": "2000000038764",
"name": "Rural"
},
"modified_time": "2017-03-24T11:08:23+05:30"
}
}
]
} Sample Request
ZCRMModule modulesIns = ZCRMModule.getInstance("Leads");
List<ZCRMTag> tags = new ArrayList<ZCRMTag>();
ZCRMTag tag1 = ZCRMTag.getInstance(3719520000000459011L);
tag1.setName("Name3");
ZCRMTag tag2 = ZCRMTag.getInstance(3719520000000470002L);
tag2.setName("Name4");
tags.add(tag1);
tags.add(tag2);
BulkAPIResponse response = modulesIns.updateTags(tags); //tags - list of ZCRMTag instances filled with required data for update.
List<ZCRMTag> updatedtags = (List<ZCRMTag>) response.getData(); //tags - list of ZCRMTag instances
List<EntityResponse> entityResponses = response.getEntityResponses(); //entityResponses - list of EntityResponse instance Sample Input
{
"tags": [
{
"id": "3719520000000459011",
"name": "Chems"
},
{
"id": "3719520000000470002",
"name": "Agricultural"
}
]
} Sample Response
{
"tags": [
{
"code": "SUCCESS",
"message": "tags updated successfully",
"status": "success",
"details": {
"created_by": {
"id": "2000000030444",
"name": "Chems"
},
"created_time": "2017-03-24T11:08:23+05:30",
"id": "2000000088041",
"modified_by": {
"id": "2000000030784",
"name": "Medical"
},
"modified_time": "2017-03-24T11:08:23+05:30"
}
},
{
"code": "SUCCESS",
"message": "tags updated successfully",
"status": "success",
"details": {
"created_by": {
"id": "2000000030344",
"name": "Agricultural"
},
"created_time": "2017-03-24T11:08:23+05:30",
"id": "2000000088041",
"modified_by": {
"id": "2000000038764",
"name": "Rural"
},
"modified_time": "2017-03-24T11:08:23+05:30"
}
}
]
} Sample Request
def update_tags(self):
try:
tag_ins_array = []
tag1 = ZCRMTag.get_instance("3719520000000531002", "Sample4")
tag2 = ZCRMTag.get_instance("3719520000000533002", "Sample5")
tag_ins_array.append(tag1)
tag_ins_array.append(tag2)
resp = ZCRMModule.get_instance("Leads").update_tags(tag_ins_array)
print(resp.status_code)
tag_created = resp.data
for tag_ins in tag_created:
print(tag_ins.id)
print(tag_ins.name)
print(tag_ins.created_by.id)
print(tag_ins.created_by.name)
print(tag_ins.modified_by.id)
print(tag_ins.created_by.id)
print(tag_ins.created_time)
print(tag_ins.modified_time)
entity_responses = resp.bulk_entity_response
for entity_response in entity_responses:
print(entity_response.details)
print(entity_response.status)
print(entity_response.message)
print(entity_response.code)
except ZCRMException as ex:
print(ex.status_code)
print(ex.error_message)
print(ex.error_code)
print(ex.error_details)
print(ex.error_content) Sample Input
{
"tags": [
{
"id": "410888000000482039",
"name": "Chems"
},
{
"id": "410888000000482040",
"name": "Agricultural"
}
]
} Sample Response
{
"tags": [
{
"code": "SUCCESS",
"message": "tags updated successfully",
"status": "success",
"details": {
"created_by": {
"id": "2000000030444",
"name": "Chems"
},
"created_time": "2017-03-24T11:08:23+05:30",
"id": "2000000088041",
"modified_by": {
"id": "2000000030784",
"name": "Medical"
},
"modified_time": "2017-03-24T11:08:23+05:30"
}
},
{
"code": "SUCCESS",
"message": "tags updated successfully",
"status": "success",
"details": {
"created_by": {
"id": "2000000030344",
"name": "Agricultural"
},
"created_time": "2017-03-24T11:08:23+05:30",
"id": "2000000088041",
"modified_by": {
"id": "2000000038764",
"name": "Rural"
},
"modified_time": "2017-03-24T11:08:23+05:30"
}
}
]
} Sample Request
/** Multiple Tag updates */
$zcrmModuleIns=ZCRMModule::getInstance("Leads");
$tagsArray= array();
$tag = ZCRMTag::getInstance("3372164000001597013");
$tag->setName("Name3");
array_push($tagsArray, $tag);
$tag = ZCRMTag::getInstance("3372164000001585002");
$tag->setName("Name4");
array_push($tagsArray, $tag);
$bulkAPIResponse = $zcrmModuleIns->updateTags($tagsArray); //$tagsArray - array of ZCRMTag instances
$tags = $bulkAPIResponse->getData(); //$tags - array of ZCRMTag instances Sample Input
{
"tags": [
{
"id": "410888000000482039",
"name": "Chems"
},
{
"id": "410888000000482040",
"name": "Agricultural"
}
]
} Sample Response
{
"tags": [
{
"code": "SUCCESS",
"message": "tags updated successfully",
"status": "success",
"details": {
"created_by": {
"id": "2000000030444",
"name": "Chems"
},
"created_time": "2017-03-24T11:08:23+05:30",
"id": "2000000088041",
"modified_by": {
"id": "2000000030784",
"name": "Medical"
},
"modified_time": "2017-03-24T11:08:23+05:30"
}
},
{
"code": "SUCCESS",
"message": "tags updated successfully",
"status": "success",
"details": {
"created_by": {
"id": "2000000030344",
"name": "Agricultural"
},
"created_time": "2017-03-24T11:08:23+05:30",
"id": "2000000088041",
"modified_by": {
"id": "2000000038764",
"name": "Rural"
},
"modified_time": "2017-03-24T11:08:23+05:30"
}
}
]
} Sample Request
ZCRMModule modulesIns = ZCRMModule.GetInstance("Leads");
List<ZCRMTag> tags = new List<ZCRMTag>();
ZCRMTag tag1 = ZCRMTag.GetInstance(3372164000001536001);
tag1.Name = "Name3";
ZCRMTag tag2 = ZCRMTag.GetInstance(3372164000001536002);
tag2.Name = "Name4";
tags.Add(tag1);
tags.Add(tag2);
BulkAPIResponse<ZCRMTag> response = modulesIns.UpdateTags(tags); //tags - list of ZCRMTag instances filled with required data for update.
List<ZCRMTag> updatedtags = response.BulkData; //tags - list of ZCRMTag instances
List<EntityResponse> entityResponses = response.BulkEntitiesResponse; //entityResponses - list of EntityResponse instance Sample Input
{
"tags": [
{
"id": "410888000000482039",
"name": "Chems"
},
{
"id": "410888000000482040",
"name": "Agricultural"
}
]
} Sample Response
{
"tags": [
{
"code": "SUCCESS",
"message": "tags updated successfully",
"status": "success",
"details": {
"created_by": {
"id": "2000000030444",
"name": "Chems"
},
"created_time": "2017-03-24T11:08:23+05:30",
"id": "2000000088041",
"modified_by": {
"id": "2000000030784",
"name": "Medical"
},
"modified_time": "2017-03-24T11:08:23+05:30"
}
},
{
"code": "SUCCESS",
"message": "tags updated successfully",
"status": "success",
"details": {
"created_by": {
"id": "2000000030344",
"name": "Agricultural"
},
"created_time": "2017-03-24T11:08:23+05:30",
"id": "2000000088041",
"modified_by": {
"id": "2000000038764",
"name": "Rural"
},
"modified_time": "2017-03-24T11:08:23+05:30"
}
}
]
}