Settings: watch
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คอยดูการเปลี่ยนแปลงในแหล่งข้อมูลการตั้งค่า
ส่งคำขอ
คำขอ HTTP
POST https://www.googleapis.com/calendar/v3/users/me/settings/watch
พารามิเตอร์
ชื่อพารามิเตอร์ |
ค่า |
คำอธิบาย |
การให้สิทธิ์
คำขอนี้ต้องได้รับการให้สิทธิ์ที่มีขอบเขตต่อไปนี้อย่างน้อย 1 ขอบเขต
ขอบเขต |
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 ") ทั้ง 2 ค่าหมายถึงแชแนลที่ใช้คำขอ HTTP เพื่อส่งข้อความ |
|
address |
string |
ที่อยู่ที่ส่งการแจ้งเตือนสำหรับช่องนี้ |
|
params |
object |
พารามิเตอร์เพิ่มเติมที่ควบคุมลักษณะการทำงานของช่องทางการแสดงโฆษณา ไม่บังคับ |
|
params.ttl |
string |
Time to Live ในหน่วยวินาทีสำหรับช่องทางการแจ้งเตือน ค่าเริ่มต้นคือ 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,["# 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. | |"]]