自定义视图元数据

目的

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

请求URL

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

请求方法

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无效的模块名称或没有模块权限,或者模块可能已从已机构的模块中删除
400INVALID_MODULEThe given module is not supported in API当前API不支持文档和项目等模块。(一旦支持了这些模块,就不会显示此错误。)

示例请求


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

示例响应


				{
    "custom_views": [
        {
            "display_value": "All Leads",
            "offline": true,
            "default": false,
            "system_name": "ALLVIEWS",
            "system_defined": true,
            "name": "All Open Leads",
            "id": "3652397000000087501",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Converted Leads",
            "offline": true,
            "default": false,
            "system_name": "CONVERTEDVIEWS",
            "system_defined": true,
            "name": "Converted Leads",
            "id": "3652397000000089005",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Email Opt Out",
            "offline": true,
            "default": true,
            "system_name": null,
            "system_defined": false,
            "name": "Email Opt Out",
            "id": "3652397000000538003",
            "category": "created_by_me",
            "favorite": null
        },
        {
            "display_value": "Junk Leads",
            "offline": true,
            "default": false,
            "system_name": "JUNKLEADVIEWS",
            "system_defined": true,
            "name": "Junk Leads",
            "id": "3652397000000149020",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Mailing Labels",
            "offline": true,
            "default": false,
            "system_name": "ALLVIEWS",
            "system_defined": true,
            "name": "Mailing Labels",
            "id": "3652397000000087503",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "My Converted Leads",
            "offline": true,
            "default": false,
            "system_name": "MYCONVERTEDVIEWS",
            "system_defined": true,
            "name": "My Converted Leads",
            "id": "3652397000000089007",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "My Leads",
            "offline": true,
            "default": false,
            "system_name": "MYVIEWS",
            "system_defined": true,
            "name": "My Leads",
            "id": "3652397000000087563",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Not Qualified Leads",
            "offline": true,
            "default": false,
            "system_name": "NOTQUALIFIEDLEADVIEWS",
            "system_defined": true,
            "name": "Not Qualified Leads",
            "id": "3652397000000149031",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Open Leads",
            "offline": true,
            "default": false,
            "system_name": "OPENLEADVIEWS",
            "system_defined": true,
            "name": "Open Leads",
            "id": "3652397000000149042",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Recently Created Leads",
            "offline": true,
            "default": false,
            "system_name": "RECENTLYCREATED",
            "system_defined": true,
            "name": "Recently Created Leads",
            "id": "3652397000000087509",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Recently Modified Leads",
            "offline": true,
            "default": false,
            "system_name": "RECENTLYMODIFIED",
            "system_defined": true,
            "name": "Recently Modified Leads",
            "id": "3652397000000087511",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Today's Leads",
            "offline": true,
            "default": false,
            "system_name": "today",
            "system_defined": true,
            "name": "Todays Leads",
            "id": "3652397000000087507",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Unread Leads",
            "offline": true,
            "default": false,
            "system_name": "UNREADVIEWS",
            "system_defined": true,
            "name": "Unread Leads",
            "id": "3652397000000087505",
            "category": "shared_with_me",
            "favorite": null
        }
    ],
    "info": {
        "per_page": 200,
        "default": "3652397000000538003",
        "count": 13,
        "translation": {
            "public_views": "Public Views",
            "other_users_views": "Other Users' Views",
            "shared_with_me": "Shared With Me",
            "created_by_me": "Created By Me"
        },
        "page": 1,
        "more_records": false
    }
}			

示例请求


				ZCRMModule module = ZCRMModule.getInstance("Contacts");// 模块API名称
BulkAPIResponse response = module.getCustomViews();
List<ZCRMCustomView> customViews = (List<ZCRMCustomView>)
response.getData();			

示例响应


				{
    "custom_views": [
        {
            "display_value": "All Leads",
            "offline": true,
            "default": false,
            "system_name": "ALLVIEWS",
            "system_defined": true,
            "name": "All Open Leads",
            "id": "3652397000000087501",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Converted Leads",
            "offline": true,
            "default": false,
            "system_name": "CONVERTEDVIEWS",
            "system_defined": true,
            "name": "Converted Leads",
            "id": "3652397000000089005",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Email Opt Out",
            "offline": true,
            "default": true,
            "system_name": null,
            "system_defined": false,
            "name": "Email Opt Out",
            "id": "3652397000000538003",
            "category": "created_by_me",
            "favorite": null
        },
        {
            "display_value": "Junk Leads",
            "offline": true,
            "default": false,
            "system_name": "JUNKLEADVIEWS",
            "system_defined": true,
            "name": "Junk Leads",
            "id": "3652397000000149020",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Mailing Labels",
            "offline": true,
            "default": false,
            "system_name": "ALLVIEWS",
            "system_defined": true,
            "name": "Mailing Labels",
            "id": "3652397000000087503",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "My Converted Leads",
            "offline": true,
            "default": false,
            "system_name": "MYCONVERTEDVIEWS",
            "system_defined": true,
            "name": "My Converted Leads",
            "id": "3652397000000089007",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "My Leads",
            "offline": true,
            "default": false,
            "system_name": "MYVIEWS",
            "system_defined": true,
            "name": "My Leads",
            "id": "3652397000000087563",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Not Qualified Leads",
            "offline": true,
            "default": false,
            "system_name": "NOTQUALIFIEDLEADVIEWS",
            "system_defined": true,
            "name": "Not Qualified Leads",
            "id": "3652397000000149031",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Open Leads",
            "offline": true,
            "default": false,
            "system_name": "OPENLEADVIEWS",
            "system_defined": true,
            "name": "Open Leads",
            "id": "3652397000000149042",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Recently Created Leads",
            "offline": true,
            "default": false,
            "system_name": "RECENTLYCREATED",
            "system_defined": true,
            "name": "Recently Created Leads",
            "id": "3652397000000087509",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Recently Modified Leads",
            "offline": true,
            "default": false,
            "system_name": "RECENTLYMODIFIED",
            "system_defined": true,
            "name": "Recently Modified Leads",
            "id": "3652397000000087511",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Today's Leads",
            "offline": true,
            "default": false,
            "system_name": "today",
            "system_defined": true,
            "name": "Todays Leads",
            "id": "3652397000000087507",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Unread Leads",
            "offline": true,
            "default": false,
            "system_name": "UNREADVIEWS",
            "system_defined": true,
            "name": "Unread Leads",
            "id": "3652397000000087505",
            "category": "shared_with_me",
            "favorite": null
        }
    ],
    "info": {
        "per_page": 200,
        "default": "3652397000000538003",
        "count": 13,
        "translation": {
            "public_views": "Public Views",
            "other_users_views": "Other Users' Views",
            "shared_with_me": "Shared With Me",
            "created_by_me": "Created By Me"
        },
        "page": 1,
        "more_records": false
    }
}			

示例请求


				$zcrmModuleIns = ZCRMModule::getInstance("Products");
$apiResponse=$zcrmModuleIns->getAllCustomViews();
$zcrmCustomViews=$apiResponse->getData(); // 这里$ ZCRMCustomView是一个ZCRMCustomView实例数组		

示例响应


				{
    "custom_views": [
        {
            "display_value": "All Leads",
            "offline": true,
            "default": false,
            "system_name": "ALLVIEWS",
            "system_defined": true,
            "name": "All Open Leads",
            "id": "3652397000000087501",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Converted Leads",
            "offline": true,
            "default": false,
            "system_name": "CONVERTEDVIEWS",
            "system_defined": true,
            "name": "Converted Leads",
            "id": "3652397000000089005",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Email Opt Out",
            "offline": true,
            "default": true,
            "system_name": null,
            "system_defined": false,
            "name": "Email Opt Out",
            "id": "3652397000000538003",
            "category": "created_by_me",
            "favorite": null
        },
        {
            "display_value": "Junk Leads",
            "offline": true,
            "default": false,
            "system_name": "JUNKLEADVIEWS",
            "system_defined": true,
            "name": "Junk Leads",
            "id": "3652397000000149020",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Mailing Labels",
            "offline": true,
            "default": false,
            "system_name": "ALLVIEWS",
            "system_defined": true,
            "name": "Mailing Labels",
            "id": "3652397000000087503",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "My Converted Leads",
            "offline": true,
            "default": false,
            "system_name": "MYCONVERTEDVIEWS",
            "system_defined": true,
            "name": "My Converted Leads",
            "id": "3652397000000089007",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "My Leads",
            "offline": true,
            "default": false,
            "system_name": "MYVIEWS",
            "system_defined": true,
            "name": "My Leads",
            "id": "3652397000000087563",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Not Qualified Leads",
            "offline": true,
            "default": false,
            "system_name": "NOTQUALIFIEDLEADVIEWS",
            "system_defined": true,
            "name": "Not Qualified Leads",
            "id": "3652397000000149031",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Open Leads",
            "offline": true,
            "default": false,
            "system_name": "OPENLEADVIEWS",
            "system_defined": true,
            "name": "Open Leads",
            "id": "3652397000000149042",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Recently Created Leads",
            "offline": true,
            "default": false,
            "system_name": "RECENTLYCREATED",
            "system_defined": true,
            "name": "Recently Created Leads",
            "id": "3652397000000087509",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Recently Modified Leads",
            "offline": true,
            "default": false,
            "system_name": "RECENTLYMODIFIED",
            "system_defined": true,
            "name": "Recently Modified Leads",
            "id": "3652397000000087511",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Today's Leads",
            "offline": true,
            "default": false,
            "system_name": "today",
            "system_defined": true,
            "name": "Todays Leads",
            "id": "3652397000000087507",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Unread Leads",
            "offline": true,
            "default": false,
            "system_name": "UNREADVIEWS",
            "system_defined": true,
            "name": "Unread Leads",
            "id": "3652397000000087505",
            "category": "shared_with_me",
            "favorite": null
        }
    ],
    "info": {
        "per_page": 200,
        "default": "3652397000000538003",
        "count": 13,
        "translation": {
            "public_views": "Public Views",
            "other_users_views": "Other Users' Views",
            "shared_with_me": "Shared With Me",
            "created_by_me": "Created By Me"
        },
        "page": 1,
        "more_records": false
    }
}			

示例请求


				def get_all_customviews(self):
    try:
        module_ins=ZCRMModule.get_instance('Accounts') #module API Name
        resp=module_ins.get_all_customviews()
        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": "All Leads",
            "offline": true,
            "default": false,
            "system_name": "ALLVIEWS",
            "system_defined": true,
            "name": "All Open Leads",
            "id": "3652397000000087501",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Converted Leads",
            "offline": true,
            "default": false,
            "system_name": "CONVERTEDVIEWS",
            "system_defined": true,
            "name": "Converted Leads",
            "id": "3652397000000089005",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Email Opt Out",
            "offline": true,
            "default": true,
            "system_name": null,
            "system_defined": false,
            "name": "Email Opt Out",
            "id": "3652397000000538003",
            "category": "created_by_me",
            "favorite": null
        },
        {
            "display_value": "Junk Leads",
            "offline": true,
            "default": false,
            "system_name": "JUNKLEADVIEWS",
            "system_defined": true,
            "name": "Junk Leads",
            "id": "3652397000000149020",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Mailing Labels",
            "offline": true,
            "default": false,
            "system_name": "ALLVIEWS",
            "system_defined": true,
            "name": "Mailing Labels",
            "id": "3652397000000087503",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "My Converted Leads",
            "offline": true,
            "default": false,
            "system_name": "MYCONVERTEDVIEWS",
            "system_defined": true,
            "name": "My Converted Leads",
            "id": "3652397000000089007",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "My Leads",
            "offline": true,
            "default": false,
            "system_name": "MYVIEWS",
            "system_defined": true,
            "name": "My Leads",
            "id": "3652397000000087563",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Not Qualified Leads",
            "offline": true,
            "default": false,
            "system_name": "NOTQUALIFIEDLEADVIEWS",
            "system_defined": true,
            "name": "Not Qualified Leads",
            "id": "3652397000000149031",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Open Leads",
            "offline": true,
            "default": false,
            "system_name": "OPENLEADVIEWS",
            "system_defined": true,
            "name": "Open Leads",
            "id": "3652397000000149042",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Recently Created Leads",
            "offline": true,
            "default": false,
            "system_name": "RECENTLYCREATED",
            "system_defined": true,
            "name": "Recently Created Leads",
            "id": "3652397000000087509",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Recently Modified Leads",
            "offline": true,
            "default": false,
            "system_name": "RECENTLYMODIFIED",
            "system_defined": true,
            "name": "Recently Modified Leads",
            "id": "3652397000000087511",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Today's Leads",
            "offline": true,
            "default": false,
            "system_name": "today",
            "system_defined": true,
            "name": "Todays Leads",
            "id": "3652397000000087507",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Unread Leads",
            "offline": true,
            "default": false,
            "system_name": "UNREADVIEWS",
            "system_defined": true,
            "name": "Unread Leads",
            "id": "3652397000000087505",
            "category": "shared_with_me",
            "favorite": null
        }
    ],
    "info": {
        "per_page": 200,
        "default": "3652397000000538003",
        "count": 13,
        "translation": {
            "public_views": "Public Views",
            "other_users_views": "Other Users' Views",
            "shared_with_me": "Shared With Me",
            "created_by_me": "Created By Me"
        },
        "page": 1,
        "more_records": false
    }
}			

示例请求


				ZCRMModule moduleIns = ZCRMModule.GetInstance("Leads"); //模块API名称
BulkAPIResponse<ZCRMCustomView> response = moduleIns.GetAllCustomViews();
List<ZCRMCustomView> customViews = response.BulkData; //customViews - ZCRMCustomView实例的列表			

示例响应


				{
    "custom_views": [
        {
            "display_value": "All Leads",
            "offline": true,
            "default": false,
            "system_name": "ALLVIEWS",
            "system_defined": true,
            "name": "All Open Leads",
            "id": "3652397000000087501",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Converted Leads",
            "offline": true,
            "default": false,
            "system_name": "CONVERTEDVIEWS",
            "system_defined": true,
            "name": "Converted Leads",
            "id": "3652397000000089005",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Email Opt Out",
            "offline": true,
            "default": true,
            "system_name": null,
            "system_defined": false,
            "name": "Email Opt Out",
            "id": "3652397000000538003",
            "category": "created_by_me",
            "favorite": null
        },
        {
            "display_value": "Junk Leads",
            "offline": true,
            "default": false,
            "system_name": "JUNKLEADVIEWS",
            "system_defined": true,
            "name": "Junk Leads",
            "id": "3652397000000149020",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Mailing Labels",
            "offline": true,
            "default": false,
            "system_name": "ALLVIEWS",
            "system_defined": true,
            "name": "Mailing Labels",
            "id": "3652397000000087503",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "My Converted Leads",
            "offline": true,
            "default": false,
            "system_name": "MYCONVERTEDVIEWS",
            "system_defined": true,
            "name": "My Converted Leads",
            "id": "3652397000000089007",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "My Leads",
            "offline": true,
            "default": false,
            "system_name": "MYVIEWS",
            "system_defined": true,
            "name": "My Leads",
            "id": "3652397000000087563",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Not Qualified Leads",
            "offline": true,
            "default": false,
            "system_name": "NOTQUALIFIEDLEADVIEWS",
            "system_defined": true,
            "name": "Not Qualified Leads",
            "id": "3652397000000149031",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Open Leads",
            "offline": true,
            "default": false,
            "system_name": "OPENLEADVIEWS",
            "system_defined": true,
            "name": "Open Leads",
            "id": "3652397000000149042",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Recently Created Leads",
            "offline": true,
            "default": false,
            "system_name": "RECENTLYCREATED",
            "system_defined": true,
            "name": "Recently Created Leads",
            "id": "3652397000000087509",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Recently Modified Leads",
            "offline": true,
            "default": false,
            "system_name": "RECENTLYMODIFIED",
            "system_defined": true,
            "name": "Recently Modified Leads",
            "id": "3652397000000087511",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Today's Leads",
            "offline": true,
            "default": false,
            "system_name": "today",
            "system_defined": true,
            "name": "Todays Leads",
            "id": "3652397000000087507",
            "category": "shared_with_me",
            "favorite": null
        },
        {
            "display_value": "Unread Leads",
            "offline": true,
            "default": false,
            "system_name": "UNREADVIEWS",
            "system_defined": true,
            "name": "Unread Leads",
            "id": "3652397000000087505",
            "category": "shared_with_me",
            "favorite": null
        }
    ],
    "info": {
        "per_page": 200,
        "default": "3652397000000538003",
        "count": 13,
        "translation": {
            "public_views": "Public Views",
            "other_users_views": "Other Users' Views",
            "shared_with_me": "Shared With Me",
            "created_by_me": "Created By Me"
        },
        "page": 1,
        "more_records": false
    }
}