相关列表元数据

目的

获取特定模块的相关列表数据。

请求URL

https://www.zohoapis.com.cn/crm/v2/settings/related_lists

请求方法

GET

范围

scope=ZohoCRM.settings.related_lists.read
(或)
scope=ZohoCRM.settings.related_lists.all
(或)
scope=ZohoCRM.settings.all

参数

参数名称数据类型描述
module (必填)字符串指定所需模块的API名称。例如,线索,联系人,客户,商机等等。将检索指定模块的相关列表数据。

可能的错误

HTTP状态错误码消息原因
400INVALID_MODULEThe module name given seems to be invalid无效的模块名称或没有模块权限,或者模块可能已从已机构的模块中删除
400INVALID_MODULEThe given module is not supported in API当前API不支持文档和项目等模块。(一旦支持了这些模块,就不会显示此错误。)

备注:

必须在URL中使用响应中的"href"属性来调用相关列表API。例如,调用相关列表API的URL必须为:
https://www.zohoapis.com.cn/crm/v2/Leads/{ENTITYID}/Notes

示例请求


				curl "https://www.zohoapis.com.cn/crm/v2/settings/related_lists?module=Leads"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"			

示例响应


				{
    "related_lists": [
        {
            "sequence_number": "1",
            "display_label": "Notes",
            "api_name": "Notes",
            "module": "Notes",
            "name": "Notes",
            "action": null,
            "id": "3652397000000015122",
            "href": "Leads/{ENTITYID}/Notes",
            "type": "default"
        },
        {
            "sequence_number": "2",
            "display_label": "Attachments",
            "api_name": "Attachments",
            "module": "Attachments",
            "name": "Attachments",
            "action": null,
            "id": "3652397000000003771",
            "href": "Leads/{ENTITYID}/Attachments",
            "type": "default"
        },
        {
            "sequence_number": "3",
            "display_label": "Products",
            "api_name": "Products",
            "module": "Products",
            "name": "Products",
            "action": null,
            "id": "3652397000000003773",
            "href": "Leads/{ENTITYID}/Products",
            "type": "default"
        },
        {
            "sequence_number": "4",
            "display_label": "Open Activities",
            "api_name": "Activities",
            "module": "Activities",
            "name": "Activities",
            "action": null,
            "id": "3652397000000003769",
            "href": "Leads/{ENTITYID}/Activities",
            "type": "default"
        },
        {
            "sequence_number": "5",
            "display_label": "Closed Activities",
            "api_name": "Activities_History",
            "module": "Activities",
            "name": "Activities History",
            "action": null,
            "id": "3652397000000003767",
            "href": "Leads/{ENTITYID}/Activities_History",
            "type": "default"
        },
        {
            "sequence_number": "6",
            "display_label": "Invited Events",
            "api_name": "Invited_Events",
            "module": "Events",
            "name": "Invited Events",
            "action": null,
            "id": "3652397000000062001",
            "href": "Leads/{ENTITYID}/Invited_Events",
            "type": "default"
        },
        {
            "sequence_number": "6",
            "display_label": "Emails",
            "api_name": "Emails",
            "module": "Emails",
            "name": "Emails",
            "action": null,
            "id": "3652397000000014410",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "7",
            "display_label": "Zoho Desk",
            "api_name": "Zoho_Support",
            "module": null,
            "name": "Zoho Support",
            "action": null,
            "id": "3652397000000209001",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "8",
            "display_label": "Campaigns",
            "api_name": "Campaigns",
            "module": "Campaigns",
            "name": "Campaigns",
            "action": null,
            "id": "3652397000000040017",
            "href": "Leads/{ENTITYID}/Campaigns",
            "type": "default"
        },
        {
            "sequence_number": "9",
            "display_label": "Social",
            "api_name": "Social",
            "module": "Social",
            "name": "Social",
            "action": null,
            "id": "3652397000000065003",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "10",
            "display_label": "Checklists",
            "api_name": "CheckLists",
            "module": "CheckLists",
            "name": "CheckLists",
            "action": null,
            "id": "3652397000000141005",
            "href": "Leads/{ENTITYID}/CheckLists",
            "type": "default"
        },
        {
            "sequence_number": "11",
            "display_label": "Zoho Survey",
            "api_name": "Zoho_Survey",
            "module": null,
            "name": "Zoho Survey",
            "action": null,
            "id": "3652397000000209037",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "12",
            "display_label": "Zoho - {1} SalesIQ",
            "api_name": "Visits_Zoho_Livedesk",
            "module": "Visits",
            "name": "Visits - Zoho Livedesk",
            "action": null,
            "id": "3652397000000213048",
            "href": "Leads/{ENTITYID}/Visits_Zoho_Livedesk",
            "type": "default"
        },
        {
            "sequence_number": "13",
            "display_label": "Related List Name 1",
            "api_name": "Related_List_Name_1",
            "module": "Accounts",
            "name": "Related List Name 1",
            "action": null,
            "id": "3652397000000381023",
            "href": "Leads/{ENTITYID}/Related_List_Name_1",
            "type": "custom_lookup"
        }
    ]
}			

示例请求


				APIResponse response =
MetaDataAPIHandler.getInstance().getModule("Products");//模块API名称
ZCRMModule module = (ZCRMModule) response.getData();
List<ZCRMModuleRelation> relationList = module.getRelatedLists();			

示例响应


				{
    "related_lists": [
        {
            "sequence_number": "1",
            "display_label": "Notes",
            "api_name": "Notes",
            "module": "Notes",
            "name": "Notes",
            "action": null,
            "id": "3652397000000015122",
            "href": "Leads/{ENTITYID}/Notes",
            "type": "default"
        },
        {
            "sequence_number": "2",
            "display_label": "Attachments",
            "api_name": "Attachments",
            "module": "Attachments",
            "name": "Attachments",
            "action": null,
            "id": "3652397000000003771",
            "href": "Leads/{ENTITYID}/Attachments",
            "type": "default"
        },
        {
            "sequence_number": "3",
            "display_label": "Products",
            "api_name": "Products",
            "module": "Products",
            "name": "Products",
            "action": null,
            "id": "3652397000000003773",
            "href": "Leads/{ENTITYID}/Products",
            "type": "default"
        },
        {
            "sequence_number": "4",
            "display_label": "Open Activities",
            "api_name": "Activities",
            "module": "Activities",
            "name": "Activities",
            "action": null,
            "id": "3652397000000003769",
            "href": "Leads/{ENTITYID}/Activities",
            "type": "default"
        },
        {
            "sequence_number": "5",
            "display_label": "Closed Activities",
            "api_name": "Activities_History",
            "module": "Activities",
            "name": "Activities History",
            "action": null,
            "id": "3652397000000003767",
            "href": "Leads/{ENTITYID}/Activities_History",
            "type": "default"
        },
        {
            "sequence_number": "6",
            "display_label": "Invited Events",
            "api_name": "Invited_Events",
            "module": "Events",
            "name": "Invited Events",
            "action": null,
            "id": "3652397000000062001",
            "href": "Leads/{ENTITYID}/Invited_Events",
            "type": "default"
        },
        {
            "sequence_number": "6",
            "display_label": "Emails",
            "api_name": "Emails",
            "module": "Emails",
            "name": "Emails",
            "action": null,
            "id": "3652397000000014410",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "7",
            "display_label": "Zoho Desk",
            "api_name": "Zoho_Support",
            "module": null,
            "name": "Zoho Support",
            "action": null,
            "id": "3652397000000209001",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "8",
            "display_label": "Campaigns",
            "api_name": "Campaigns",
            "module": "Campaigns",
            "name": "Campaigns",
            "action": null,
            "id": "3652397000000040017",
            "href": "Leads/{ENTITYID}/Campaigns",
            "type": "default"
        },
        {
            "sequence_number": "9",
            "display_label": "Social",
            "api_name": "Social",
            "module": "Social",
            "name": "Social",
            "action": null,
            "id": "3652397000000065003",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "10",
            "display_label": "Checklists",
            "api_name": "CheckLists",
            "module": "CheckLists",
            "name": "CheckLists",
            "action": null,
            "id": "3652397000000141005",
            "href": "Leads/{ENTITYID}/CheckLists",
            "type": "default"
        },
        {
            "sequence_number": "11",
            "display_label": "Zoho Survey",
            "api_name": "Zoho_Survey",
            "module": null,
            "name": "Zoho Survey",
            "action": null,
            "id": "3652397000000209037",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "12",
            "display_label": "Zoho - {1} SalesIQ",
            "api_name": "Visits_Zoho_Livedesk",
            "module": "Visits",
            "name": "Visits - Zoho Livedesk",
            "action": null,
            "id": "3652397000000213048",
            "href": "Leads/{ENTITYID}/Visits_Zoho_Livedesk",
            "type": "default"
        },
        {
            "sequence_number": "13",
            "display_label": "Related List Name 1",
            "api_name": "Related_List_Name_1",
            "module": "Accounts",
            "name": "Related List Name 1",
            "action": null,
            "id": "3652397000000381023",
            "href": "Leads/{ENTITYID}/Related_List_Name_1",
            "type": "custom_lookup"
        }
    ]
}			

示例请求


				$zcrmModuleIns = ZCRMModule::getInstance("Leads");
$apiResponse= $zcrmModuleIns->getAllRelatedLists();
$relatedLists =$apiResponse->getData(); // 这里的$relatedLists是ZCRMModuleRelatedList实例的数组		

示例响应


				{
    "related_lists": [
        {
            "sequence_number": "1",
            "display_label": "Notes",
            "api_name": "Notes",
            "module": "Notes",
            "name": "Notes",
            "action": null,
            "id": "3652397000000015122",
            "href": "Leads/{ENTITYID}/Notes",
            "type": "default"
        },
        {
            "sequence_number": "2",
            "display_label": "Attachments",
            "api_name": "Attachments",
            "module": "Attachments",
            "name": "Attachments",
            "action": null,
            "id": "3652397000000003771",
            "href": "Leads/{ENTITYID}/Attachments",
            "type": "default"
        },
        {
            "sequence_number": "3",
            "display_label": "Products",
            "api_name": "Products",
            "module": "Products",
            "name": "Products",
            "action": null,
            "id": "3652397000000003773",
            "href": "Leads/{ENTITYID}/Products",
            "type": "default"
        },
        {
            "sequence_number": "4",
            "display_label": "Open Activities",
            "api_name": "Activities",
            "module": "Activities",
            "name": "Activities",
            "action": null,
            "id": "3652397000000003769",
            "href": "Leads/{ENTITYID}/Activities",
            "type": "default"
        },
        {
            "sequence_number": "5",
            "display_label": "Closed Activities",
            "api_name": "Activities_History",
            "module": "Activities",
            "name": "Activities History",
            "action": null,
            "id": "3652397000000003767",
            "href": "Leads/{ENTITYID}/Activities_History",
            "type": "default"
        },
        {
            "sequence_number": "6",
            "display_label": "Invited Events",
            "api_name": "Invited_Events",
            "module": "Events",
            "name": "Invited Events",
            "action": null,
            "id": "3652397000000062001",
            "href": "Leads/{ENTITYID}/Invited_Events",
            "type": "default"
        },
        {
            "sequence_number": "6",
            "display_label": "Emails",
            "api_name": "Emails",
            "module": "Emails",
            "name": "Emails",
            "action": null,
            "id": "3652397000000014410",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "7",
            "display_label": "Zoho Desk",
            "api_name": "Zoho_Support",
            "module": null,
            "name": "Zoho Support",
            "action": null,
            "id": "3652397000000209001",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "8",
            "display_label": "Campaigns",
            "api_name": "Campaigns",
            "module": "Campaigns",
            "name": "Campaigns",
            "action": null,
            "id": "3652397000000040017",
            "href": "Leads/{ENTITYID}/Campaigns",
            "type": "default"
        },
        {
            "sequence_number": "9",
            "display_label": "Social",
            "api_name": "Social",
            "module": "Social",
            "name": "Social",
            "action": null,
            "id": "3652397000000065003",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "10",
            "display_label": "Checklists",
            "api_name": "CheckLists",
            "module": "CheckLists",
            "name": "CheckLists",
            "action": null,
            "id": "3652397000000141005",
            "href": "Leads/{ENTITYID}/CheckLists",
            "type": "default"
        },
        {
            "sequence_number": "11",
            "display_label": "Zoho Survey",
            "api_name": "Zoho_Survey",
            "module": null,
            "name": "Zoho Survey",
            "action": null,
            "id": "3652397000000209037",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "12",
            "display_label": "Zoho - {1} SalesIQ",
            "api_name": "Visits_Zoho_Livedesk",
            "module": "Visits",
            "name": "Visits - Zoho Livedesk",
            "action": null,
            "id": "3652397000000213048",
            "href": "Leads/{ENTITYID}/Visits_Zoho_Livedesk",
            "type": "default"
        },
        {
            "sequence_number": "13",
            "display_label": "Related List Name 1",
            "api_name": "Related_List_Name_1",
            "module": "Accounts",
            "name": "Related List Name 1",
            "action": null,
            "id": "3652397000000381023",
            "href": "Leads/{ENTITYID}/Related_List_Name_1",
            "type": "custom_lookup"
        }
    ]
}			

示例请求


				def get_all_relatedlists(self):
    try:
        module_ins=ZCRMModule.get_instance('Accounts') #module API Name
        resp=module_ins.get_all_relatedlists()
        print resp.status_code
        relatedlist_instances=resp.data
        for relatedlist_instance in relatedlist_instances:
            print "\n\n:::MODULE RELATEDLIST DETAILS:::"
            print relatedlist_instance.api_name
            print relatedlist_instance.module
            print relatedlist_instance.display_label
            print relatedlist_instance.is_visible
            print relatedlist_instance.name
            print relatedlist_instance.id
            print relatedlist_instance.href
            print relatedlist_instance.type
    except ZCRMException as ex:
        print ex.status_code
        print ex.error_message
        print ex.error_code
        print ex.error_details
        print ex.error_content			

示例响应


				{
    "related_lists": [
        {
            "sequence_number": "1",
            "display_label": "Notes",
            "api_name": "Notes",
            "module": "Notes",
            "name": "Notes",
            "action": null,
            "id": "3652397000000015122",
            "href": "Leads/{ENTITYID}/Notes",
            "type": "default"
        },
        {
            "sequence_number": "2",
            "display_label": "Attachments",
            "api_name": "Attachments",
            "module": "Attachments",
            "name": "Attachments",
            "action": null,
            "id": "3652397000000003771",
            "href": "Leads/{ENTITYID}/Attachments",
            "type": "default"
        },
        {
            "sequence_number": "3",
            "display_label": "Products",
            "api_name": "Products",
            "module": "Products",
            "name": "Products",
            "action": null,
            "id": "3652397000000003773",
            "href": "Leads/{ENTITYID}/Products",
            "type": "default"
        },
        {
            "sequence_number": "4",
            "display_label": "Open Activities",
            "api_name": "Activities",
            "module": "Activities",
            "name": "Activities",
            "action": null,
            "id": "3652397000000003769",
            "href": "Leads/{ENTITYID}/Activities",
            "type": "default"
        },
        {
            "sequence_number": "5",
            "display_label": "Closed Activities",
            "api_name": "Activities_History",
            "module": "Activities",
            "name": "Activities History",
            "action": null,
            "id": "3652397000000003767",
            "href": "Leads/{ENTITYID}/Activities_History",
            "type": "default"
        },
        {
            "sequence_number": "6",
            "display_label": "Invited Events",
            "api_name": "Invited_Events",
            "module": "Events",
            "name": "Invited Events",
            "action": null,
            "id": "3652397000000062001",
            "href": "Leads/{ENTITYID}/Invited_Events",
            "type": "default"
        },
        {
            "sequence_number": "6",
            "display_label": "Emails",
            "api_name": "Emails",
            "module": "Emails",
            "name": "Emails",
            "action": null,
            "id": "3652397000000014410",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "7",
            "display_label": "Zoho Desk",
            "api_name": "Zoho_Support",
            "module": null,
            "name": "Zoho Support",
            "action": null,
            "id": "3652397000000209001",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "8",
            "display_label": "Campaigns",
            "api_name": "Campaigns",
            "module": "Campaigns",
            "name": "Campaigns",
            "action": null,
            "id": "3652397000000040017",
            "href": "Leads/{ENTITYID}/Campaigns",
            "type": "default"
        },
        {
            "sequence_number": "9",
            "display_label": "Social",
            "api_name": "Social",
            "module": "Social",
            "name": "Social",
            "action": null,
            "id": "3652397000000065003",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "10",
            "display_label": "Checklists",
            "api_name": "CheckLists",
            "module": "CheckLists",
            "name": "CheckLists",
            "action": null,
            "id": "3652397000000141005",
            "href": "Leads/{ENTITYID}/CheckLists",
            "type": "default"
        },
        {
            "sequence_number": "11",
            "display_label": "Zoho Survey",
            "api_name": "Zoho_Survey",
            "module": null,
            "name": "Zoho Survey",
            "action": null,
            "id": "3652397000000209037",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "12",
            "display_label": "Zoho - {1} SalesIQ",
            "api_name": "Visits_Zoho_Livedesk",
            "module": "Visits",
            "name": "Visits - Zoho Livedesk",
            "action": null,
            "id": "3652397000000213048",
            "href": "Leads/{ENTITYID}/Visits_Zoho_Livedesk",
            "type": "default"
        },
        {
            "sequence_number": "13",
            "display_label": "Related List Name 1",
            "api_name": "Related_List_Name_1",
            "module": "Accounts",
            "name": "Related List Name 1",
            "action": null,
            "id": "3652397000000381023",
            "href": "Leads/{ENTITYID}/Related_List_Name_1",
            "type": "custom_lookup"
        }
    ]
}			

示例请求


				ZCRMModule moduleIns = ZCRMModule.GetInstance("Leads"); //模块API名称
BulkAPIResponse<ZCRMModuleRelation> response = moduleIns.GetRelatedLists();
List<ZCRMModuleRelation> relatedLists = response.BulkData; //relatedLists - ZCRMModuleRelation实例列表		

示例响应


				{
    "related_lists": [
        {
            "sequence_number": "1",
            "display_label": "Notes",
            "api_name": "Notes",
            "module": "Notes",
            "name": "Notes",
            "action": null,
            "id": "3652397000000015122",
            "href": "Leads/{ENTITYID}/Notes",
            "type": "default"
        },
        {
            "sequence_number": "2",
            "display_label": "Attachments",
            "api_name": "Attachments",
            "module": "Attachments",
            "name": "Attachments",
            "action": null,
            "id": "3652397000000003771",
            "href": "Leads/{ENTITYID}/Attachments",
            "type": "default"
        },
        {
            "sequence_number": "3",
            "display_label": "Products",
            "api_name": "Products",
            "module": "Products",
            "name": "Products",
            "action": null,
            "id": "3652397000000003773",
            "href": "Leads/{ENTITYID}/Products",
            "type": "default"
        },
        {
            "sequence_number": "4",
            "display_label": "Open Activities",
            "api_name": "Activities",
            "module": "Activities",
            "name": "Activities",
            "action": null,
            "id": "3652397000000003769",
            "href": "Leads/{ENTITYID}/Activities",
            "type": "default"
        },
        {
            "sequence_number": "5",
            "display_label": "Closed Activities",
            "api_name": "Activities_History",
            "module": "Activities",
            "name": "Activities History",
            "action": null,
            "id": "3652397000000003767",
            "href": "Leads/{ENTITYID}/Activities_History",
            "type": "default"
        },
        {
            "sequence_number": "6",
            "display_label": "Invited Events",
            "api_name": "Invited_Events",
            "module": "Events",
            "name": "Invited Events",
            "action": null,
            "id": "3652397000000062001",
            "href": "Leads/{ENTITYID}/Invited_Events",
            "type": "default"
        },
        {
            "sequence_number": "6",
            "display_label": "Emails",
            "api_name": "Emails",
            "module": "Emails",
            "name": "Emails",
            "action": null,
            "id": "3652397000000014410",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "7",
            "display_label": "Zoho Desk",
            "api_name": "Zoho_Support",
            "module": null,
            "name": "Zoho Support",
            "action": null,
            "id": "3652397000000209001",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "8",
            "display_label": "Campaigns",
            "api_name": "Campaigns",
            "module": "Campaigns",
            "name": "Campaigns",
            "action": null,
            "id": "3652397000000040017",
            "href": "Leads/{ENTITYID}/Campaigns",
            "type": "default"
        },
        {
            "sequence_number": "9",
            "display_label": "Social",
            "api_name": "Social",
            "module": "Social",
            "name": "Social",
            "action": null,
            "id": "3652397000000065003",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "10",
            "display_label": "Checklists",
            "api_name": "CheckLists",
            "module": "CheckLists",
            "name": "CheckLists",
            "action": null,
            "id": "3652397000000141005",
            "href": "Leads/{ENTITYID}/CheckLists",
            "type": "default"
        },
        {
            "sequence_number": "11",
            "display_label": "Zoho Survey",
            "api_name": "Zoho_Survey",
            "module": null,
            "name": "Zoho Survey",
            "action": null,
            "id": "3652397000000209037",
            "href": null,
            "type": "default"
        },
        {
            "sequence_number": "12",
            "display_label": "Zoho - {1} SalesIQ",
            "api_name": "Visits_Zoho_Livedesk",
            "module": "Visits",
            "name": "Visits - Zoho Livedesk",
            "action": null,
            "id": "3652397000000213048",
            "href": "Leads/{ENTITYID}/Visits_Zoho_Livedesk",
            "type": "default"
        },
        {
            "sequence_number": "13",
            "display_label": "Related List Name 1",
            "api_name": "Related_List_Name_1",
            "module": "Accounts",
            "name": "Related List Name 1",
            "action": null,
            "id": "3652397000000381023",
            "href": "Leads/{ENTITYID}/Related_List_Name_1",
            "type": "custom_lookup"
        }
    ]
}