Acl: watch
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
監控 ACL 資源的變更。
要求
HTTP 要求
POST https://www.googleapis.com/calendar/v3/calendars/calendarId/acl/watch
參數
參數名稱 |
值 |
說明 |
路徑參數 |
calendarId |
string |
日曆 ID。如要擷取日曆 ID,請呼叫 calendarList.list 方法。如果您想存取目前登入使用者的主日曆,請使用「primary 」關鍵字。
|
授權
這項要求需要至少具備下列其中一個範圍的授權:
範圍 |
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.acls |
https://www.googleapis.com/auth/calendar.acls.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 |
受監控資源的版本專屬 ID。 |
|
token |
string |
每當透過這個管道傳送通知時,就會將任意字串傳送至目標地址。選填。 |
|
expiration |
long |
通知管道到期日期和時間,以 Unix 時間戳記 (以毫秒為單位) 表示。選填。 |
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# Acl: watch\n\n| **Note:** Requires [authorization](#auth).\n\nWatch for changes to ACL resources.\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/calendar/v3/calendars/calendarId/acl/watch\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Path parameters** |||\n| `calendarId` | `string` | Calendar identifier. To retrieve calendar IDs call the [calendarList.list](/workspace/calendar/api/v3/reference/calendarList/list) method. If you want to access the primary calendar of the currently logged in user, use the \"`primary`\" keyword. |\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` |\n| `https://www.googleapis.com/auth/calendar.acls` |\n| `https://www.googleapis.com/auth/calendar.acls.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. | |"]]