取消链接

目的

删除模块之间的关联。

请求URL

https://www.zohoapis.com.cn/crm/v2/{moduel_api_name}/{record_id}/{related_list_apiname}/{related_record_id}

module_api_name - 模块的API名称

record_id - 记录的唯一ID

related_list_api_name - 相关列表的API名称。要获取相关列表的API名称,请查看相关列表元数据

related_record_id - 相关记录的唯一ID

请求方法

DELETE

范围

scope=ZohoCRM.modules.all
(或)
scope=ZohoCRM.modules.{module_name}.{operation_type}

 
可能的模块名称可能的操作类型
线索,商机,联系人,客户,产品,市场活动和价格表ALL - 完全访问记录
WRITE - 编辑相关记录
DELETE - 删除相关记录

示例请求


				curl "https://www.zohoapis.com.cn/crm/v2/Leads/100014990/Campaigns/100013559"
-X DELETE
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"			

示例响应


				{
    "data": [
       {
            "message": "relation removed",
            "details": {
                "id": "4000000039247"
            },
            "status": "success",
            "code": "SUCCESS"
        }
    ]
}			

示例请求


				ZCRMRecord record = ZCRMRecord.getInstance("Leads", 123456l);//模块API名称和记录ID
ZCRMJunctionRecord relatedRecord = ZCRMJunctionRecord.getInstance("Campaigns", 987654l);
APIResponse response = record.deleteRelation(relatedRecord);
String recStatus = response.getStatus(); //检查删除关系的状态		

示例响应


				{
    "data": [
       {
            "message": "relation removed",
            "details": {
                "id": "4000000039247"
            },
            "status": "success",
            "code": "SUCCESS"
        }
    ]
}			

示例请求


				try{
$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();
}			

示例响应


				{
    "data": [
       {
            "message": "relation removed",
            "details": {
                "id": "4000000039247"
            },
            "status": "success",
            "code": "SUCCESS"
        }
    ]
}			

示例请求


				def remove_relation(self):
    try:
        record=ZCRMRecord.get_instance('Leads',440872000000222019) #module API Name, entityId
        junction_record=ZCRMJunctionRecord.get_instance("Products", 440872000000224005) #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			

示例响应


				{
    "data": [
       {
            "message": "relation removed",
            "details": {
                "id": "4000000039247"
            },
            "status": "success",
            "code": "SUCCESS"
        }
    ]
}			

示例请求


				ZCRMRecord recordIns = ZCRMRecord.GetInstance("Leads", 3372164000001494008);//模块API名称和记录ID
ZCRMJunctionRecord relatedRecord = ZCRMJunctionRecord.GetInstance("Campaigns", 3372164000000266194); //包含相关列表记录ID的相关列表API名称
APIResponse response = recordIns.DeleteRelation(relatedRecord);
String recStatus = response.Status; //检查删除关系的状态		

示例响应


				{
    "data": [
       {
            "message": "relation removed",
            "details": {
                "id": "4000000039247"
            },
            "status": "success",
            "code": "SUCCESS"
        }
    ]
}