Events: delete
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ลบกิจกรรม
ลองใช้เลย
ส่งคำขอ
คำขอ HTTP
DELETE https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId
พารามิเตอร์
ชื่อพารามิเตอร์ |
ค่า |
คำอธิบาย |
พารามิเตอร์เส้นทาง |
calendarId |
string |
ตัวระบุปฏิทิน หากต้องการเรียกข้อมูลรหัสปฏิทิน ให้เรียกใช้เมธอด calendarList.list หากต้องการเข้าถึงปฏิทินหลักของผู้ใช้ที่เข้าสู่ระบบอยู่ในปัจจุบัน ให้ใช้คีย์เวิร์ด "primary "
|
eventId |
string |
ตัวระบุเหตุการณ์
|
พารามิเตอร์การค้นหาที่ไม่บังคับ |
sendNotifications |
boolean |
เลิกใช้งานแล้ว โปรดใช้ sendUpdates แทน
การส่งการแจ้งเตือนเกี่ยวกับการลบเหตุการณ์ โปรดทราบว่าระบบอาจยังคงส่งอีเมลบางฉบับแม้ว่าคุณจะตั้งค่าเป็น false ก็ตาม ค่าเริ่มต้นคือ false
|
sendUpdates |
string |
ผู้เข้าร่วมที่ควรได้รับการแจ้งเตือนเกี่ยวกับการลบกิจกรรม
ค่าที่ยอมรับมีดังนี้
- "
all ": ระบบจะส่งการแจ้งเตือนไปยังผู้เข้าร่วมทุกคน
- "
externalOnly ": ระบบจะส่งการแจ้งเตือนไปยังผู้เข้าร่วมที่ไม่ใช่ผู้ใช้ Google ปฏิทินเท่านั้น
- "
none ": ระบบจะไม่ส่งการแจ้งเตือน สำหรับงานย้ายข้อมูลปฏิทิน ให้ลองใช้เมธอด Events.import แทน
|
การให้สิทธิ์
คำขอนี้ต้องมีการให้สิทธิ์ด้วยขอบเขตต่อไปนี้อย่างน้อย 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: delete\n\n| **Note:** Requires [authorization](#auth).\n\nDeletes an event.\n[Try it now](#try-it).\n\nRequest\n-------\n\n### HTTP request\n\n```\nDELETE 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| `sendNotifications` | `boolean` | Deprecated. Please use [sendUpdates](/workspace/calendar/api/v3/reference/events/delete#sendUpdates) instead. Whether to send notifications about the deletion of the event. 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 deletion of the event. \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\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\nDo not supply a request body with this method.\n\nResponse\n--------\n\nIf successful, this method returns an empty response body.\n\nTry it!\n-------\n\n\nUse the APIs Explorer below to call this method on live data and see the response."]]