更新订阅明细
目的
更新用户订阅的详细信息。所有提供的明细将被保留,其余的明细将被删除.
请求 URL
https://www.zohoapis.com.cn/crm/v2/actions/watch
请求方法
PUT
范围
scope=ZohoCRM.notifications.{operation_type}
可能的操作类型 |
---|
ALL - 完全访问通知数据 WRITE - 编辑通知数据 UPDATE - 更新通知明细 |
输入 JSON 键
键 | 值 | 目的 |
---|---|---|
token | 字符串(最大长度是50个字符) | 通过在通知URL主体中返回给定值,确保通知是从Zoho CRM发送的。通过使用此值,用户可以验证通知。 |
notify_url (必填) | 字符串 | 要通知的URL (POST请求)。无论何时触发任何操作,通知都将通过此通知URL发送。 |
channel_id | 字符串(长) | 给定值在通知URL主体中发回,以确保通知是针对特定通道的。 |
channel_expiry | 字符串(ISO 日期时间) | 设定即时通知的有效期。从订阅时间开始最多只有一天。如果未指定或设置超过一天,则默认过期时间为一个小时。 |
events | JSONArray ["{module_api_name}.{operation}", "{module_api_name}.{operation}"] 例如: ["Leads.create","Sales_Orders.edit","Contacts.delete"] 可能的操作类型 - 创建,删除,编辑,全部 | 根据选定模块上的特定操作进行订阅。 |
示例请求
在这个请求中,"@inputData.json" 包含了示例输入数据。
curl "https://www.zohoapis.com.cn/crm/v2/actions/watch"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-X PUT
-d "@inputData.json"
示例输入
{
"watch": [
{
"channel_id": "1000000068001",
"events": [
"Solutions.edit",
"Price_Books.edit",
"Contacts.delete",
"Solutions.create"
],
"channel_expiry": "2018-02-02T11:30:00+05:30",
"token": "ALTERED_TOKEN_FOR_VERIFICATION_OF_1000000068001",
"notify_url": "https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key=val2"
},
{
"channel_id": "1000000068002",
"events": [
"Deals.create"
],
"channel_expiry": "2018-02-02T11:30:00+05:30",
"token": "ALTERED_TOKEN_FOR_VERIFICATION_OF_1000000068002",
"notify_url": """https://www.zoho.com/callback?authorization=Zoho-oauthtoken 1000.23dnsbbbh455jnn&key1=val1&key2=val&key3=val1"
}
]
}
示例响应
{
"watch": [
{
"code": "SUCCESS",
"details": {
"events": [
{
"channel_expiry": "2018-02-02T11:30:00+05:30",
"resource_uri": "https://www.zohoapis.com.cn/crm/v2/Solutions",
"resource_id": "1000000000091",
"resource_name": "Solutions",
"channel_id": "1000000068001"
},
{
"channel_expiry": "2018-02-02T11:30:00+05:30",
"resource_uri": "https://www.zohoapis.com.cn/crm/v2/Contacts",
"resource_id": "1000000000045",
"resource_name": "Contacts",
"channel_id": "1000000068001"
},
{
"channel_expiry": "2018-02-02T11:30:00+05:30",
"resource_uri": "https://www.zohoapis.com.cn/crm/v2/Price_Books",
"resource_id": "1000000000097",
"resource_name": "Price_Books",
"channel_id": "1000000068001"
}
]
},
"message": "Successfully subscribed for actions-watch of the given module",
"status": "success"
},
{
"code": "SUCCESS",
"details": {
"events": [
{
"channel_expiry": "2018-02-02T11:30:00+05:30",
"resource_uri": "https://www.zohoapis.com.cn/crm/v2/Deals",
"resource_id": "1000000000047",
"resource_name": "Deals",
"channel_id": "1000000068002"
}
]
},
"message": "Successfully subscribed for actions-watch of the given module",
"status": "success"
}
]
}