获取订阅明细

目的

获取用户已订阅的详细信息。

请求 URL

https://www.zohoapis.com.cn/crm/v2/actions/watch

请求方法

GET

范围

scope=ZohoCRM.notifications.{operation_type}

 
可能的操作类型
ALL - 完全访问通知数据
READ - 获取通知订阅详细信息

参数

参数名称数据类型描述
page (可选)整型从相关页面获取记录列表。默认值是1
per_page (可选)整型获取每页可用记录的列表。默认值是200
channel_id (必填)整型指定通知通道的唯一ID。
module字符串指定订阅通知的模块API名称。
 

备注:

使用pageper_page参数根据它们在CRM中的位置获取记录。假设用户必须获取400条记录。一个API调用最多可以获得200条记录。因此,对于第200条以上的记录,无法获取。通过使用page(1,2,3,4)和per_page(100)参数,用户可以使用4个API调用获取所有400条记录。

示例请求


				curl "https://www.zohoapis.com.cn/crm/v2/actions/watch?page=1&per_page=200"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"			

示例响应


				{
    "watch": [
       {
            "channel_expiry": "2018-02-02T11:30:00+05:30",
            "resource_uri": "https://www.zohoapis.com.cn/crm/v2/Contacts",
            "resource_id": "1000000000045",
            "notify_url": """https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key2=val2&key3=val3",
            "resource_name": "Contacts",
            "channel_id": "1000000068001",
            "events": [
                "Contacts.create"
            ],
            "token": "TOKEN_FOR_VERIFICATION_OF_1000000068001"
        },
       {
            "channel_expiry": "2018-02-02T11:30:00+05:30",
            "resource_uri": "https://www.zohoapis.com.cn/crm/v2/Leads",
            "resource_id": "1000000000041",
            "notify_url": """https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key2=val2&key3=val3",
            "resource_name": "Leads",
            "channel_id": "1000000068001",
            "events": [
                "Leads.edit",
                "Leads.create",
                "Leads.delete"
            ],
            "token": "TOKEN_FOR_VERIFICATION_OF_1000000068001"
        },
       {
            "channel_expiry": "2018-02-02T11:30:00+05:30",
            "resource_uri": "https://www.zohoapis.com.cn/crm/v2/Deals",
            "resource_id": "1000000000047",
            "notify_url": """https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key2=val2&key3=val3",
            "resource_name": "Deals",
            "channel_id": "1000000068001",
            "events": [
                "Deals.edit",
                "Deals.create",
                "Deals.delete"
            ],
            "token": "TOKEN_FOR_VERIFICATION_OF_1000000068001"
        },
       {
            "channel_expiry": "2018-02-02T11:30:00+05:30",
            "resource_uri": "https://www.zohoapis.com.cn/crm/v2/Tasks",
            "resource_id": "1000000000063",
            "notify_url": "https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key2=val2",
            "resource_name": "Tasks",
            "channel_id": "1000000068001",
            "events": [
                "Tasks.edit",
                "Tasks.create",
                "Tasks.delete"
            ],
            "token": "TOKEN_FOR_VERIFICATION_OF_1000000068001"
        },
       {
            "channel_expiry": "2018-02-02T10:30:00+05:30",
            "resource_uri": "https://www.zohoapis.com.cn/crm/v2/Leads",
            "resource_id": "1000000000041",
            "notify_url": """https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key2=val2&key3=val3",
            "resource_name": "Leads",
            "channel_id": "1000000058003",
            "events": [
                "Leads.edit",
                "Leads.create",
                "Leads.delete"
            ],
            "token": "TOKEN_FOR_VERIFICATION_OF_1000000058003"
        }
    ],
    "info": {
        "per_page": 200,
        "count": 5,
        "page": 1,
        "more_records": false
    }
}			

示例请求:获取与特定频道相关的订阅


				curl "https://www.zohoapis.com.cn/crm/v2/actions/watch?channel_id=1000000068001"
-X GET
-H "Authorization: Zoho-oauthtoken d92d401c803988c5cb849d0b4215f52"			

示例响应: 获取与特定频道相关的订阅


				{
    "watch": [
       {
            "channel_expiry": "2018-02-02T11:30:00+05:30",
            "resource_uri": "https://www.zohoapis.com.cn/crm/v2/Contacts",
            "resource_id": "1000000000045",
            "notify_url": """https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key2=val2&key3=val3",
            "resource_name": "Contacts",
            "channel_id": "1000000068001",
            "events": [
                "Contacts.create"
            ],
            "token": "TOKEN_FOR_VERIFICATION_OF_1000000068001"
        },
       {
            "channel_expiry": "2018-02-02T11:30:00+05:30",
            "resource_uri": "https://www.zohoapis.com.cn/crm/v2/Leads",
            "resource_id": "1000000000041",
            "notify_url": """https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key2=val2&key3=val3",
            "resource_name": "Leads",
            "channel_id": "1000000068001",
            "events": [
                "Leads.edit",
                "Leads.create",
                "Leads.delete"
            ],
            "token": "TOKEN_FOR_VERIFICATION_OF_1000000068001"
        },
       {
            "channel_expiry": "2018-02-02T11:30:00+05:30",
            "resource_uri": "https://www.zohoapis.com.cn/crm/v2/Deals",
            "resource_id": "1000000000047",
            "notify_url": """https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key2=val2&key3=val3",
            "resource_name": "Deals",
            "channel_id": "1000000068001",
            "events": [
                "Deals.edit",
                "Deals.create",
                "Deals.delete"
            ],
            "token": "TOKEN_FOR_VERIFICATION_OF_1000000068001"
        },
       {
            "channel_expiry": "2018-02-02T11:30:00+05:30",
            "resource_uri": "https://www.zohoapis.com.cn/crm/v2/Tasks",
            "resource_id": "1000000000063",
            "notify_url": "https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key2=val2",
            "resource_name": "Tasks",
            "channel_id": "1000000068001",
            "events": [
                "Tasks.edit",
                "Tasks.create",
                "Tasks.delete"
            ],
            "token": "TOKEN_FOR_VERIFICATION_OF_1000000068001"
        }
    ],
    "info": {
        "per_page": 200,
        "count": 4,
        "page": 1,
        "more_records": false
    }
}			

示例请求:用于与模块和通道相关的订阅


				curl "https://www.zohoapis.com.cn/crm/v2/actions/watch?channel_id=1000000068001&module={module_api_name}"
-X GET
-H "Authorization: Zoho-oauthtoken d92d401c803988c5cb849d0b4215f52"			

示例响应:用于与模块和通道相关的订阅


				{
    "watch": [
       {
            "channel_expiry": "2018-02-02T11:30:00+05:30",
            "resource_uri": "https://www.zohoapis.com.cn/crm/v2/Leads",
            "resource_id": "1000000000041",
            "notify_url": """https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key2=val2&key3=val3",
            "resource_name": "Leads",
            "channel_id": "1000000068001",
            "events": [
                "Leads.edit",
                "Leads.create",
                "Leads.delete"
            ],
            "token": "TOKEN_FOR_VERIFICATION_OF_1000000068001"
        }
    ],
    "info": {
        "per_page": 200,
        "count": 1,
        "page": 1,
        "more_records": false
    }
}