Settings: watch
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
请留意“设置”资源的更改。
请求
HTTP 请求
POST https://www.googleapis.com/calendar/v3/users/me/settings/watch
参数
授权
此请求需要获得以下至少一个范围的授权:
范围 |
https://www.googleapis.com/auth/calendar.readonly |
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.settings.readonly |
如需了解详情,请参阅身份验证和授权页面。
请求正文
在请求正文中,请按以下结构提供数据:
{
"id": string,
"token": string,
"type": string,
"address": string,
"params": {
"ttl": string
}
}
属性名称 |
值 |
说明 |
备注 |
id |
string |
用于标识此频道的 UUID 或类似的唯一字符串。 |
|
token |
string |
传送到目标地址的任意字符串,每条通知通过此渠道传送。可选。 |
|
type |
string |
用于此渠道的传送机制的类型。有效值为“web_hook ”(或“webhook ”)。这两个值都表示使用 HTTP 请求传递消息的通道。 |
|
address |
string |
为此频道发送通知的地址。 |
|
params |
object |
用于控制投放渠道行为的其他参数。可选。 |
|
params.ttl |
string |
通知渠道的存留时间(以秒为单位)。默认值为 604800 秒。 |
|
响应
如果成功,此方法将返回采用以下结构的响应正文:
{
"kind": "api#channel",
"id": string,
"resourceId": string,
"resourceUri": string,
"token": string,
"expiration": long
}
属性名称 |
值 |
说明 |
备注 |
kind |
string |
将此标识为用于监控资源(即“api#channel ”)更改的通知渠道。 |
|
id |
string |
用于标识此频道的 UUID 或类似的唯一字符串。 |
|
resourceId |
string |
不透明 ID,用于标识此频道中正在监控的资源。在不同的 API 版本中保持稳定。 |
|
resourceUri |
string |
所监控资源的版本特定标识符。 |
|
token |
string |
传送到目标地址的任意字符串,每条通知通过此渠道传送。可选。 |
|
expiration |
long |
通知渠道到期的日期和时间,以 Unix 时间戳表示,以毫秒为单位。可选。 |
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# Settings: watch\n\n| **Note:** Requires [authorization](#auth).\n\nWatch for changes to Settings resources.\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/calendar/v3/users/me/settings/watch\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|-------|-------------|\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes:\n\n| Scope |\n|--------------------------------------------------------------|\n| `https://www.googleapis.com/auth/calendar.readonly` |\n| `https://www.googleapis.com/auth/calendar` |\n| `https://www.googleapis.com/auth/calendar.settings.readonly` |\n\nFor more information, see the [authentication and authorization](/workspace/guides/configure-oauth-consent) page.\n\n### Request body\n\nIn the request body, supply data with the following structure:\n\n```carbon\n{\n \"id\": string,\n \"token\": string,\n \"type\": string,\n \"address\": string,\n \"params\": {\n \"ttl\": string\n }\n}\n```\n\n| Property name | Value | Description | Notes |\n|---------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|\n| `id` | `string` | A UUID or similar unique string that identifies this channel. | |\n| `token` | `string` | An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. | |\n| `type` | `string` | The type of delivery mechanism used for this channel. Valid values are \"`web_hook`\" (or \"`webhook`\"). Both values refer to a channel where Http requests are used to deliver messages. | |\n| `address` | `string` | The address where notifications are delivered for this channel. | |\n| `params` | `object` | Additional parameters controlling delivery channel behavior. Optional. | |\n| params.`ttl` | `string` | The time-to-live in seconds for the notification channel. Default is 604800 seconds. | |\n\nResponse\n--------\n\nIf successful, this method returns a response body with the following structure:\n\n```text\n{\n \"kind\": \"api#channel\",\n \"id\": string,\n \"resourceId\": string,\n \"resourceUri\": string,\n \"token\": string,\n \"expiration\": long\n}\n```\n\n| Property name | Value | Description | Notes |\n|---------------|----------|-------------------------------------------------------------------------------------------------------------------|-------|\n| `kind` | `string` | Identifies this as a notification channel used to watch for changes to a resource, which is \"`api#channel`\". | |\n| `id` | `string` | A UUID or similar unique string that identifies this channel. | |\n| `resourceId` | `string` | An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. | |\n| `resourceUri` | `string` | A version-specific identifier for the watched resource. | |\n| `token` | `string` | An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. | |\n| `expiration` | `long` | Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. | |"]]