特定布局的元数据

目的

获取与模块关联的特定布局的详细信息。

请求URL

https://www.zohoapis.com.cn/crm/v2/settings/layouts/{layout_id}

layout_id - 布局的唯一ID。

请求方法

GET

范围

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

参数

参数名称数据类型描述
module (必填)字符串Specify the API name of the required module. For example, Leads, Contacts, Accounts, Deals, and so on.

可能的错误

HTTP状态错误码消息原因
400INVALID_MODULEThe module name given seems to be invalidInvalid module name or no tab permission, or the module could have been removed from the organized module
400INVALID_MODULEThe given module is not supported in APIThe modules such as Documents and Projects are not supported in the current API. (This error will not be shown, once these modules are supported.)

Sample Request


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

示例响应


				{
    "layouts": [
       {
            "created_by": null,
            "id": "4108880000380019",
            "sections": [
               {
                    "sequence": 1,
                    "name": "Potential Information",
                    "label": "Potential Information",
                    "column_count": 2,
                    "fields": [
                       {
                            "api_name": "Owner",
                            "unique": {},
                            "read_only": false,
                            "visible": true,
                            "pick_list_values": [],
                            "custom_field": false,
                            "lookup": {},
                            "currency": {},
                            "id": "4108880000000515",
                            "data_type": "ownerlookup",
                            "default-value": null,
                            "length": 120,
                            "decimal_place": null,
                            "auto_number": {},
                            "layouts": {
                                "quick_create": false,
                                "edit": true,
                                "view": true,
                                "create": true
                            },
                            "required": false,
                            "field_label": "Potential Owner"
                        }
                    ]
                }
            ],
            "modified_by": "4108880000086001",
            "status": 0,
            "modified_time": "2016-04-22T16:22:32+05:30",
            "name": "Standard",
            "profiles": [
               {
                    "id": "4108880000015972",
                    "default": true,
                    "name": "Administrator"
                },
               {
                    "id": "41088800000015975",
                    "default": true,
                    "name": "Standard"
                }
            ],
            "created_time": null
        }
    ]
}			

示例请求


				ZCRMModule module = ZCRMModule.getInstance("Products");// module apiname
APIResponse response = module.getLayoutDetails(12345690l);//layoutID
ZCRMLayout layout = (ZCRMLayout) response.getData();			

示例响应


				{
    "layouts": [
       {
            "created_by": null,
            "id": "4108880000380019",
            "sections": [
               {
                    "sequence": 1,
                    "name": "Potential Information",
                    "label": "Potential Information",
                    "column_count": 2,
                    "fields": [
                       {
                            "api_name": "Owner",
                            "unique": {},
                            "read_only": false,
                            "visible": true,
                            "pick_list_values": [],
                            "custom_field": false,
                            "lookup": {},
                            "currency": {},
                            "id": "4108880000000515",
                            "data_type": "ownerlookup",
                            "default-value": null,
                            "length": 120,
                            "decimal_place": null,
                            "auto_number": {},
                            "layouts": {
                                "quick_create": false,
                                "edit": true,
                                "view": true,
                                "create": true
                            },
                            "required": false,
                            "field_label": "Potential Owner"
                        }
                    ]
                }
            ],
            "modified_by": "4108880000086001",
            "status": 0,
            "modified_time": "2016-04-22T16:22:32+05:30",
            "name": "Standard",
            "profiles": [
               {
                    "id": "4108880000015972",
                    "default": true,
                    "name": "Administrator"
                },
               {
                    "id": "41088800000015975",
                    "default": true,
                    "name": "Standard"
                }
            ],
            "created_time": null
        }
    ]
}			

示例请求


				$zcrmModuleIns = ZCRMModule::getInstance("Products");
$apiResponse= $zcrmModuleIns->getLayoutDetails(410405000001021001);//LayoutId
$layout =$apiResponse->getData(); // Here $layout is ZCRMLayout instance			

示例响应


				{
    "layouts": [
       {
            "created_by": null,
            "id": "4108880000380019",
            "sections": [
               {
                    "sequence": 1,
                    "name": "Potential Information",
                    "label": "Potential Information",
                    "column_count": 2,
                    "fields": [
                       {
                            "api_name": "Owner",
                            "unique": {},
                            "read_only": false,
                            "visible": true,
                            "pick_list_values": [],
                            "custom_field": false,
                            "lookup": {},
                            "currency": {},
                            "id": "4108880000000515",
                            "data_type": "ownerlookup",
                            "default-value": null,
                            "length": 120,
                            "decimal_place": null,
                            "auto_number": {},
                            "layouts": {
                                "quick_create": false,
                                "edit": true,
                                "view": true,
                                "create": true
                            },
                            "required": false,
                            "field_label": "Potential Owner"
                        }
                    ]
                }
            ],
            "modified_by": "4108880000086001",
            "status": 0,
            "modified_time": "2016-04-22T16:22:32+05:30",
            "name": "Standard",
            "profiles": [
               {
                    "id": "4108880000015972",
                    "default": true,
                    "name": "Administrator"
                },
               {
                    "id": "41088800000015975",
                    "default": true,
                    "name": "Standard"
                }
            ],
            "created_time": null
        }
    ]
}			

示例请求


				def get_layout(self):
    try:
        module_ins=ZCRMModule.get_instance('Accounts') #module API Name
        resp=module_ins.get_layout(440872000000254001) #LAYOUT ID
        print resp.status_code
        layout_ins_arr=[resp.data]
        for layout_ins in layout_ins_arr:
            print "\n\n:::LAYOUT DETAILS:::"
            print layout_ins.name
            print layout_ins.id
            print layout_ins.created_time
            print layout_ins.modified_time
            print layout_ins.convert_mapping
            print layout_ins.is_visible
            print layout_ins.modified_by.id
            profiles=layout_ins.accessible_profiles
            if profiles is not None:
                for profile in profiles:
                    print "\n\n"
                    print profile.id
                    print profile.name
                    print profile.is_default
            print layout_ins.created_by.id
            sections= layout_ins.sections
            if sections is not None:
                print "\n:::SECTION DETAILS:::"
                for secton in sections:
                    print secton.name
                    print secton.display_name
                    print secton.column_count
                    print secton.sequence_number
                    fields=secton.fields
                    if fields is not None:
                        print "\n:::FIELD DETAILS:::"
                        for field_ins in fields:
                            print field_ins.api_name
                            print field_ins.id
                            print field_ins.is_custom_field
                            print field_ins.lookup_field
                            print field_ins.convert_mapping
                            print field_ins.is_visible
                            print field_ins.field_label
                            print field_ins.length
                            print field_ins.created_source
                            print field_ins.default_value
                            print field_ins.is_mandatory
                            print field_ins.sequence_number
                            print field_ins.is_read_only
                            print field_ins.is_unique_field
                            print field_ins.is_case_sensitive
                            print field_ins.data_type
                            print field_ins.is_formula_field
                            print field_ins.is_currency_field
                            picklist_values=field_ins.picklist_values
                            if picklist_values is not None:
                                for picklist_value_ins in picklist_values:
                                    print picklist_value_ins.display_value
                                    print picklist_value_ins.actual_value
                                    print picklist_value_ins.sequence_number
                                    print picklist_value_ins.maps
                            print field_ins.is_auto_number
                            print field_ins.is_business_card_supported
                            print field_ins.field_layout_permissions
                            print field_ins.decimal_place
                            print field_ins.precision
                            print field_ins.rounding_option
                            print field_ins.formula_return_type
                            print field_ins.formula_expression
                            print field_ins.prefix
                            print field_ins.suffix
                            print field_ins.start_number
                            print field_ins.json_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			

示例响应


				{
    "layouts": [
       {
            "created_by": null,
            "id": "4108880000380019",
            "sections": [
               {
                    "sequence": 1,
                    "name": "Potential Information",
                    "label": "Potential Information",
                    "column_count": 2,
                    "fields": [
                       {
                            "api_name": "Owner",
                            "unique": {},
                            "read_only": false,
                            "visible": true,
                            "pick_list_values": [],
                            "custom_field": false,
                            "lookup": {},
                            "currency": {},
                            "id": "4108880000000515",
                            "data_type": "ownerlookup",
                            "default-value": null,
                            "length": 120,
                            "decimal_place": null,
                            "auto_number": {},
                            "layouts": {
                                "quick_create": false,
                                "edit": true,
                                "view": true,
                                "create": true
                            },
                            "required": false,
                            "field_label": "Potential Owner"
                        }
                    ]
                }
            ],
            "modified_by": "4108880000086001",
            "status": 0,
            "modified_time": "2016-04-22T16:22:32+05:30",
            "name": "Standard",
            "profiles": [
               {
                    "id": "4108880000015972",
                    "default": true,
                    "name": "Administrator"
                },
               {
                    "id": "41088800000015975",
                    "default": true,
                    "name": "Standard"
                }
            ],
            "created_time": null
        }
    ]
}			

示例请求


				ZCRMModule moduleIns = ZCRMModule.GetInstance("Leads"); //模块API名称
APIResponse response = moduleIns.GetLayoutDetails(33721640000014); //33721640000014 is layout id
ZCRMLayout layout = (ZCRMLayout)response.Data;			

示例响应


				{
    "layouts": [
       {
            "created_by": null,
            "id": "4108880000380019",
            "sections": [
               {
                    "sequence": 1,
                    "name": "Potential Information",
                    "label": "Potential Information",
                    "column_count": 2,
                    "fields": [
                       {
                            "api_name": "Owner",
                            "unique": {},
                            "read_only": false,
                            "visible": true,
                            "pick_list_values": [],
                            "custom_field": false,
                            "lookup": {},
                            "currency": {},
                            "id": "4108880000000515",
                            "data_type": "ownerlookup",
                            "default-value": null,
                            "length": 120,
                            "decimal_place": null,
                            "auto_number": {},
                            "layouts": {
                                "quick_create": false,
                                "edit": true,
                                "view": true,
                                "create": true
                            },
                            "required": false,
                            "field_label": "Potential Owner"
                        }
                    ]
                }
            ],
            "modified_by": "4108880000086001",
            "status": 0,
            "modified_time": "2016-04-22T16:22:32+05:30",
            "name": "Standard",
            "profiles": [
               {
                    "id": "4108880000015972",
                    "default": true,
                    "name": "Administrator"
                },
               {
                    "id": "41088800000015975",
                    "default": true,
                    "name": "Standard"
                }
            ],
            "created_time": null
        }
    ]
}