特定自定义视图元数据

目的

获取模块的任何特定自定义视图的数据。在API请求中指定要检索其自定义视图数据的模块的自定义视图ID。

请求URL

https://www.zohoapis.com.cn/crm/v2/settings/custom_views/{custom_view_id}

custom_view_id - 自定义视图的唯一ID

请求方法

GET

范围

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

参数

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

可能的错误

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

示例请求


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

示例响应


				{
    "custom_views": [
        {
            "display_value": "Email Opt Out",
            "shared_type": "only_me",
            "criteria": {
                "comparator": "equal",
                "field": "Email_Opt_Out",
                "value": true
            },
            "system_name": null,
            "shared_details": null,
            "sort_by": null,
            "offline": true,
            "default": true,
            "system_defined": false,
            "name": "Email Opt Out",
            "id": "3652397000000538003",
            "category": "created_by_me",
            "fields": [
                "First_Name",
                "Last_Name",
                "Company",
                "Email",
                "Email_Opt_Out"
            ],
            "favorite": null,
            "sort_order": null
        }
    ],
    "info": {
        "translation": {
            "public_views": "Public Views",
            "other_users_views": "Other Users' Views",
            "shared_with_me": "Shared With Me",
            "created_by_me": "Created By Me"
        }
    }
}			

示例请求


				ZCRMModule module = ZCRMModule.getInstance("Contacts");
APIResponse response = module.getCustomView(98658369836l);
ZCRMCustomView customView = (ZCRMCustomView) response.getData();			

示例响应


				{
    "custom_views": [
        {
            "display_value": "Email Opt Out",
            "shared_type": "only_me",
            "criteria": {
                "comparator": "equal",
                "field": "Email_Opt_Out",
                "value": true
            },
            "system_name": null,
            "shared_details": null,
            "sort_by": null,
            "offline": true,
            "default": true,
            "system_defined": false,
            "name": "Email Opt Out",
            "id": "3652397000000538003",
            "category": "created_by_me",
            "fields": [
                "First_Name",
                "Last_Name",
                "Company",
                "Email",
                "Email_Opt_Out"
            ],
            "favorite": null,
            "sort_order": null
        }
    ],
    "info": {
        "translation": {
            "public_views": "Public Views",
            "other_users_views": "Other Users' Views",
            "shared_with_me": "Shared With Me",
            "created_by_me": "Created By Me"
        }
    }
}			

示例请求


				$zcrmModuleIns = ZCRMModule::getInstance("Products");
$apiResponse=$zcrmModuleIns->getCustomView(410405000005108011);//自定义视图ID
$zcrmCustomView=$apiResponse->getData(); // 这里$zcrmCustomView是zcrmCustomView的一个实例		

示例响应


				{
    "custom_views": [
        {
            "display_value": "Email Opt Out",
            "shared_type": "only_me",
            "criteria": {
                "comparator": "equal",
                "field": "Email_Opt_Out",
                "value": true
            },
            "system_name": null,
            "shared_details": null,
            "sort_by": null,
            "offline": true,
            "default": true,
            "system_defined": false,
            "name": "Email Opt Out",
            "id": "3652397000000538003",
            "category": "created_by_me",
            "fields": [
                "First_Name",
                "Last_Name",
                "Company",
                "Email",
                "Email_Opt_Out"
            ],
            "favorite": null,
            "sort_order": null
        }
    ],
    "info": {
        "translation": {
            "public_views": "Public Views",
            "other_users_views": "Other Users' Views",
            "shared_with_me": "Shared With Me",
            "created_by_me": "Created By Me"
        }
    }
}			

示例请求


				def get_customview(self):
    try:
        module_ins=ZCRMModule.get_instance('Accounts') #module API Name
        resp=module_ins.get_customview(440872000000091517) #CUSTOM VIEW ID
        print resp.status_code
        cv_ins_arr=[resp.data]
        for customview_ins in cv_ins_arr:
            print "\n\n:::CUSTOM VIEW DETAILS:::"
            print customview_ins.id
            print customview_ins.module_api_name
            print customview_ins.display_value
            print customview_ins.is_default
            print customview_ins.name
            print customview_ins.system_name
            print customview_ins.sort_by
            print customview_ins.category
            fields=customview_ins.fields
            print "\n:::FIELDS:::"
            for field in fields:
                print field
            print customview_ins.favorite
            print customview_ins.sort_order
            cv_criteria= customview_ins.criteria
            if cv_criteria is not None:
                print "\n\n :::CRITERIA::::"
                for criteria_ins in cv_criteria:
                    print criteria_ins.field
                    print criteria_ins.comparator
                    print criteria_ins.value
                    print customview_ins.criteria_pattern
            categories=customview_ins.categories
            print "\n\n :::CATEGORIES::::"
            if categories is not None:
                for category in categories:
                    print category.actual_value
                    print category.display_value
            print customview_ins.is_off_line
    except ZCRMException as ex:
        print ex.status_code
        print ex.error_message
        print ex.error_code
        print ex.error_details
        print ex.error_content			

示例响应


				{
    "custom_views": [
        {
            "display_value": "Email Opt Out",
            "shared_type": "only_me",
            "criteria": {
                "comparator": "equal",
                "field": "Email_Opt_Out",
                "value": true
            },
            "system_name": null,
            "shared_details": null,
            "sort_by": null,
            "offline": true,
            "default": true,
            "system_defined": false,
            "name": "Email Opt Out",
            "id": "3652397000000538003",
            "category": "created_by_me",
            "fields": [
                "First_Name",
                "Last_Name",
                "Company",
                "Email",
                "Email_Opt_Out"
            ],
            "favorite": null,
            "sort_order": null
        }
    ],
    "info": {
        "translation": {
            "public_views": "Public Views",
            "other_users_views": "Other Users' Views",
            "shared_with_me": "Shared With Me",
            "created_by_me": "Created By Me"
        }
    }
}			

示例请求


				ZCRMModule moduleIns = ZCRMModule.GetInstance("Leads"); //模块API名称
APIResponse response = moduleIns.GetCustomView(33721640000006); //33721640000006是自定义视图ID
ZCRMCustomView customView = (ZCRMCustomView)response.Data;			

示例响应


				{
    "custom_views": [
        {
            "display_value": "Email Opt Out",
            "shared_type": "only_me",
            "criteria": {
                "comparator": "equal",
                "field": "Email_Opt_Out",
                "value": true
            },
            "system_name": null,
            "shared_details": null,
            "sort_by": null,
            "offline": true,
            "default": true,
            "system_defined": false,
            "name": "Email Opt Out",
            "id": "3652397000000538003",
            "category": "created_by_me",
            "fields": [
                "First_Name",
                "Last_Name",
                "Company",
                "Email",
                "Email_Opt_Out"
            ],
            "favorite": null,
            "sort_order": null
        }
    ],
    "info": {
        "translation": {
            "public_views": "Public Views",
            "other_users_views": "Other Users' Views",
            "shared_with_me": "Shared With Me",
            "created_by_me": "Created By Me"
        }
    }
}