Events: patch
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
อัปเดตกิจกรรม วิธีนี้รองรับความหมายของแพตช์ โปรดทราบว่าคําขอแพตช์แต่ละรายการจะใช้โควต้า 3 หน่วย เราขอแนะนำให้ใช้ get
ตามด้วย update
ค่าในช่องที่คุณระบุจะแทนที่ค่าที่มีอยู่ ช่องที่คุณไม่ได้ระบุในคำขอจะไม่มีการเปลี่ยนแปลง ช่องอาร์เรย์ (หากระบุ) จะเขียนทับอาร์เรย์ที่มีอยู่ ซึ่งจะเป็นการทิ้งองค์ประกอบอาร์เรย์ก่อนหน้า
ลองใช้เลย
ส่งคำขอ
คำขอ HTTP
PATCH https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId
พารามิเตอร์
ชื่อพารามิเตอร์ |
ค่า |
คำอธิบาย |
พารามิเตอร์เส้นทาง |
calendarId |
string |
ตัวระบุปฏิทิน หากต้องการเรียกข้อมูลรหัสปฏิทิน ให้เรียกใช้เมธอด calendarList.list หากต้องการเข้าถึงปฏิทินหลักของผู้ใช้ที่เข้าสู่ระบบอยู่ในปัจจุบัน ให้ใช้คีย์เวิร์ด "primary "
|
eventId |
string |
ตัวระบุเหตุการณ์
|
พารามิเตอร์การค้นหาที่ไม่บังคับ |
alwaysIncludeEmail |
boolean |
เลิกใช้งานและถูกละเว้น ระบบจะแสดงค่าในช่อง email สำหรับผู้จัด ครีเอเตอร์ และผู้เข้าร่วมเสมอ แม้ว่าจะไม่มีอีเมลจริง (นั่นคือ ระบบจะแสดงค่าที่สร้างขึ้นซึ่งใช้งานไม่ได้)
|
conferenceDataVersion |
integer |
หมายเลขเวอร์ชันของข้อมูลการประชุมที่ไคลเอ็นต์ API รองรับ เวอร์ชัน 0 จะถือว่าไม่รองรับข้อมูลการประชุมและจะไม่สนใจข้อมูลการประชุมในเนื้อหาของกิจกรรม เวอร์ชัน 1 รองรับการคัดลอก ConferenceData รวมถึงการสร้างการประชุมใหม่โดยใช้ฟิลด์ createRequest ของ conferenceData ค่าเริ่มต้นคือ 0
ค่าที่ยอมรับได้คือตั้งแต่ 0 ถึง 1
|
maxAttendees |
integer |
จำนวนผู้เข้าร่วมสูงสุดที่จะรวมไว้ในคำตอบ หากมีผู้เข้าร่วมมากกว่าจำนวนที่ระบุ ระบบจะแสดงเฉพาะผู้เข้าร่วม ไม่บังคับ
|
sendNotifications |
boolean |
เลิกใช้งานแล้ว โปรดใช้ sendUpdates แทน
ไม่ว่าจะส่งการแจ้งเตือนเกี่ยวกับการอัปเดตกิจกรรมหรือไม่ (เช่น การเปลี่ยนแปลงคำอธิบาย ฯลฯ) โปรดทราบว่าระบบอาจยังคงส่งอีเมลบางฉบับแม้ว่าคุณจะตั้งค่าเป็น false ก็ตาม ค่าเริ่มต้นคือ false
|
sendUpdates |
string |
ผู้เข้าร่วมที่ควรได้รับการแจ้งเตือนเกี่ยวกับการอัปเดตกิจกรรม (เช่น การเปลี่ยนแปลงชื่อ ฯลฯ)
ค่าที่ยอมรับมีดังนี้
- "
all ": ระบบจะส่งการแจ้งเตือนไปยังผู้เข้าร่วมทุกคน
- "
externalOnly ": ระบบจะส่งการแจ้งเตือนไปยังผู้เข้าร่วมที่ไม่ใช่ผู้ใช้ Google ปฏิทินเท่านั้น
- "
none ": ระบบจะไม่ส่งการแจ้งเตือน สำหรับงานย้ายข้อมูลปฏิทิน ให้ลองใช้เมธอด Events.import แทน
|
supportsAttachments |
boolean |
ระบุว่าไคลเอ็นต์ API ที่ดําเนินการรองรับไฟล์แนบของเหตุการณ์หรือไม่ ไม่บังคับ ค่าเริ่มต้นคือ False
|
การให้สิทธิ์
คำขอนี้ต้องมีการให้สิทธิ์ด้วยขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
ขอบเขต |
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.events |
https://www.googleapis.com/auth/calendar.app.created |
https://www.googleapis.com/auth/calendar.events.owned |
ดูข้อมูลเพิ่มเติมได้ที่หน้าการตรวจสอบสิทธิ์และการให้สิทธิ์
เนื้อหาของคำขอ
ในเนื้อหาคำขอ ให้ระบุส่วนที่เกี่ยวข้องของทรัพยากรเหตุการณ์ตามกฎของความหมายของแพตช์
ลองใช้งาน
ใช้โปรแกรมสำรวจ API ด้านล่างเพื่อเรียกใช้เมธอดนี้กับข้อมูลจริงและดูการตอบกลับ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],null,["# Events: patch\n\n| **Note:** Requires [authorization](#auth).\n\nUpdates an event. This method supports patch semantics. Note that each patch request consumes three quota units; prefer using a `get` followed by an `update`. The field values you specify replace the existing values. Fields that you don't specify in the request remain unchanged. Array fields, if specified, overwrite the existing arrays; this discards any previous array elements.\n[Try it now](#try-it).\n\nRequest\n-------\n\n### HTTP request\n\n```\nPATCH https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId\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| `eventId` | `string` | Event identifier. |\n| **Optional query parameters** |||\n| `alwaysIncludeEmail` | `boolean` | Deprecated and ignored. A value will always be returned in the `email` field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). |\n| `conferenceDataVersion` | `integer` | Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. Acceptable values are `0` to `1`, inclusive. |\n| `maxAttendees` | `integer` | The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. |\n| `sendNotifications` | `boolean` | Deprecated. Please use [sendUpdates](/workspace/calendar/api/v3/reference/events/update#sendUpdates) instead. Whether to send notifications about the event update (for example, description changes, etc.). Note that some emails might still be sent even if you set the value to `false`. The default is `false`. |\n| `sendUpdates` | `string` | Guests who should receive notifications about the event update (for example, title changes, etc.). \u003cbr /\u003e \u003cbr /\u003e Acceptable values are: - \"`all`\": Notifications are sent to all guests. - \"`externalOnly`\": Notifications are sent to non-Google Calendar guests only. - \"`none`\": No notifications are sent. For calendar migration tasks, consider using the [Events.import](/workspace/calendar/api/v3/reference/events/import) method instead. |\n| `supportsAttachments` | `boolean` | Whether API client performing operation supports event attachments. Optional. The default is False. |\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.events` |\n| `https://www.googleapis.com/auth/calendar.app.created` |\n| `https://www.googleapis.com/auth/calendar.events.owned` |\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 the relevant portions of an [Events resource](/workspace/calendar/api/v3/reference/events#resource), according to the rules of patch semantics.\n\nResponse\n--------\n\nIf successful, this method returns an [Events resource](/workspace/calendar/api/v3/reference/events#resource) in the response body.\n\nTry it!\n-------\n\n\nUse the APIs Explorer below to call this method on live data and see the response."]]