Related Lists Meta Data
Purpose
To get the related list data of a particular module.
Request Details
Request URL
https://www.zohoapis.com/bigin/v1/settings/related_lists
Scope
scope=ZohoBigin.settings.related_lists.READ
(or)
scope=ZohoBigin.settings.related_lists.ALL
(or)
scope=ZohoBigin.settings.ALL
Parameters
- modulestring, mandatory
Specify the API name of the required module. For example Contacts, Deals, and so on.
The "href" attribute in the response must be used in the URL to call the related list API. For example, the URL for calling the related list API must be: https://www.zohoapis.com/bigin/v1/Contacts/{ENTITYID}/Notes.
Sample Request
Copiedcurl "https://www.zohoapis.com/bigin/v1/settings/related_lists?module=Contacts"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
CopiedAPIResponse response =
MetaDataAPIHandler.getInstance().getModule("Products");//module api name
ZCRMModule module = (ZCRMModule) response.getData();
BulkAPIResponse relationList = module.getRelatedLists();
Copied$zcrmModuleIns = ZCRMModule::getInstance("Leads");
$apiResponse= $zcrmModuleIns->getAllRelatedLists();
$relatedLists =$apiResponse->getData(); // Here $relatedLists is the array of ZCRMModuleRelatedList instance
Copieddef 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)
CopiedZCRMModule moduleIns = ZCRMModule.GetInstance("Leads"); //module api name
BulkAPIResponse<ZCRMModuleRelation> response = moduleIns.GetRelatedLists();
List<ZCRMModuleRelation> relatedLists = response.BulkData; //relatedLists - list of ZCRMModuleRelation instance
Copiedresponse = invokeurl
[
url: "https://www.zohoapis.com/crm/v2/settings/related_lists?module=Leads"
type: GET
connection:"crm_oauth_connection"
];
info response;
Possible Errors
- INVALID_MODULEHTTP 400
The module name given seems to be invalid
Resolution: You have specified an invalid module name or there is no tab permission, or the module could have been removed from the available modules. Specify a valid module API name. - INVALID_MODULEHTTP 400
The given module is not supported in API
Resolution: The modules such as Documents and Projects are not supported in the current API. (This error will not be shown, once these modules are been supported). Specify a valid module API name.
Sample Response
Copied{
"related_lists": [
{
"sequence_number": "1",
"display_label": "Notes",
"api_name": "Notes",
"module": "Notes",
"name": "Notes",
"action": null,
"id": "529793000000002762",
"href": "Contacts/{ENTITYID}/Notes",
"type": "default"
},
{
"sequence_number": "2",
"display_label": "Open Activities",
"api_name": "Activities",
"module": "Activities",
"name": "Activities",
"action": null,
"id": "529793000000002758",
"href": "Contacts/{ENTITYID}/Activities",
"type": "default"
},
{
"sequence_number": "3",
"display_label": "Emails",
"api_name": "Emails",
"module": "Emails",
"name": "Emails",
"action": null,
"id": "529793000000002776",
"href": null,
"type": "default"
},
{
"sequence_number": "4",
"display_label": "Social",
"api_name": "Social",
"module": "Social",
"name": "Social",
"action": null,
"id": "529793000000048005",
"href": null,
"type": "default"
},
{
"sequence_number": "5",
"display_label": "Deals",
"api_name": "Deals",
"module": "Deals",
"name": "Potentials",
"action": null,
"id": "529793000000002764",
"href": "Contacts/{ENTITYID}/Deals",
"type": "default"
},
{
"sequence_number": "6",
"display_label": "Attachments",
"api_name": "Attachments",
"module": "Attachments",
"name": "Attachments",
"action": null,
"id": "529793000000002760",
"href": "Contacts/{ENTITYID}/Attachments",
"type": "default"
},
{
"sequence_number": "10",
"display_label": "Closed Activities",
"api_name": "Activities_History",
"module": "Activities",
"name": "Activities History",
"action": null,
"id": "529793000000002756",
"href": "Contacts/{ENTITYID}/Activities_History",
"type": "default"
}
]
}