Delink Related Records
Purpose
To delete the association between modules.
Request Details
Request URL
https://www.zohoapis.com/bigin/v1/{module_api_name}/{record_id}/{related_list_api_name}/{related_record_id}
To delete multiple related records:
https://www.zohoapis.com/bigin/v1/{module_api_name}/{record_id}/{related_list_api_name}?ids={comma_separated_related_record_ids}
Supported relations
Products - to - Contacts, Deals, Accounts(Companies in Bigin)
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
scope=ZohoBigin.modules.ALL
(or)
scope=scope=ZohoBigin.modules.{module_name}.{operation_type}
Possible module names
Accounts(Companies in Bigin), deals, contacts, products
Possible operation types
ALL - Full access to records
WRITE - Edit related records
DELETE - Delete related records
Parameters
- idsstring, mandatory
when delinking multiple related records.
- Specify comma separated related record IDs.
You can delete a maximum of 100 related records through an API call, that is, you can specify a maximum of 100 related record IDs in the request URL.
Sample Request
Copiedcurl "https://www.zohoapis.com/bigin/v1/Products/3652397000000327001/Deals?ids=3652397000000925128,3652397000000649013"
-X DELETE
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
CopiedZCRMRecord record = ZCRMRecord.getInstance("Leads", 123456l);//module api name with record id
ZCRMJunctionRecord relatedRecord = ZCRMJunctionRecord.getInstance("Campaigns", 987654l);
APIResponse response = record.deleteRelation(relatedRecord);
String recStatus = response.getStatus(); //check status of the delete relation
Copiedtry{
$parentRecord=ZCRMRecord::getInstance("Products", 410405000001446001);
$junctionRecord=ZCRMJunctionRecord::getInstance("Price_Books",
410405000001404743);
$responseIns=$parentRecord->removeRelation($junctionRecord);
echo "HTTP Code:".$responseIns->getHttpStatusCode();
echo "Message:".$responseIns->getMessage();
echo "Code:".$responseIns->getCode();
echo "Details:".$responseIns->getDetails();
}catch (ZCRMException $e)
{
echo $e->getCode();
echo $e->getMessage();
}
Copieddef remove_relation(self):
try:
record = ZCRMRecord.get_instance('Leads', 3719520000000323002) # module API Name, entityId
junction_record = ZCRMJunctionRecord.get_instance("Products",3719520000000450002) # module API Name, entityId
resp = record.remove_relation(junction_record)
print(resp.status_code)
print(resp.code)
print(resp.details)
print(resp.message)
print(resp.status)
except ZCRMException as ex:
print(ex.status_code)
print(ex.error_message)
print(ex.error_code)
print(ex.error_details)
print(ex.error_content)
CopiedZCRMRecord recordIns = ZCRMRecord.GetInstance("Leads", 3372164000001494008);//module api name with record id
ZCRMJunctionRecord relatedRecord = ZCRMJunctionRecord.GetInstance("Campaigns", 3372164000000266194); //RelatedList api name with RelatedList record id
APIResponse response = recordIns.DeleteRelation(relatedRecord);
String recStatus = response.Status; //check status of the delete relation
Copiedresponse = invokeurl
[
url: "https://www.zohoapis.com/crm/v2/Campaigns/3652397000000327001/Contacts?ids=3652397000000925128,3652397000000649013"
type: DELETE
connection:"crm_oauth_connection"
];
info response;
Sample Response
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"id": "3652397000000925128"
},
"message": "relation removed",
"status": "success"
},
{
"code": "SUCCESS",
"details": {
"id": "3652397000000649013"
},
"message": "relation removed",
"status": "success"
}
]
}