Acl: watch
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คอยดูการเปลี่ยนแปลงทรัพยากร ACL
ส่งคำขอ
คำขอ HTTP
POST https://www.googleapis.com/calendar/v3/calendars/calendarId/acl/watch
พารามิเตอร์
ชื่อพารามิเตอร์ |
ค่า |
คำอธิบาย |
พารามิเตอร์เส้นทาง |
calendarId |
string |
ตัวระบุปฏิทิน หากต้องการเรียกข้อมูลรหัสปฏิทิน ให้เรียกใช้เมธอด calendarList.list หากต้องการเข้าถึงปฏิทินหลักของผู้ใช้ที่เข้าสู่ระบบอยู่ในปัจจุบัน ให้ใช้คีย์เวิร์ด "primary "
|
การให้สิทธิ์
คำขอนี้ต้องมีการให้สิทธิ์ด้วยขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
ขอบเขต |
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 ") ค่าทั้ง 2 ค่าหมายถึงแชแนลที่ใช้คําขอ 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 |
รหัสทึบแสงที่ระบุทรัพยากรที่กำลังรับชมในช่องนี้ ทำงานได้อย่างเสถียรใน API เวอร์ชันต่างๆ |
|
resourceUri |
string |
ตัวระบุเฉพาะเวอร์ชันสำหรับทรัพยากรที่ดู |
|
token |
string |
สตริงที่กำหนดเองซึ่งส่งไปยังที่อยู่เป้าหมายพร้อมกับการแจ้งเตือนแต่ละรายการที่ส่งผ่านช่องทางนี้ ไม่บังคับ |
|
expiration |
long |
วันที่และเวลาหมดอายุของช่องทางการแจ้งเตือนที่แสดงเป็นการประทับเวลา UNIX ในหน่วยมิลลิวินาที ไม่บังคับ |
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],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. | |"]]