ย้ายกิจกรรมไปยังปฏิทินอื่น เช่น เปลี่ยนผู้จัดกิจกรรม ลองใช้เลยหรือดูตัวอย่าง
ส่งคำขอ
คำขอ HTTP
POST https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId/move
พารามิเตอร์
ชื่อพารามิเตอร์ | ค่า | คำอธิบาย |
---|---|---|
พารามิเตอร์เส้นทาง | ||
calendarId |
string |
ตัวระบุปฏิทินของปฏิทินต้นทางที่กิจกรรมเปิดอยู่ |
eventId |
string |
ตัวระบุเหตุการณ์ |
พารามิเตอร์การค้นหาที่จําเป็น | ||
destination |
string |
ตัวระบุปฏิทินของปฏิทินที่ต้องการย้ายกิจกรรม |
พารามิเตอร์การค้นหาที่ไม่บังคับ | ||
sendNotifications |
boolean |
เลิกใช้งานแล้ว โปรดใช้ sendUpdates แทน เลือกว่าจะส่งการแจ้งเตือนเกี่ยวกับการเปลี่ยนแปลงของผู้จัดกิจกรรมหรือไม่ โปรดทราบว่าระบบอาจยังส่งอีเมลบางรายการแม้ว่าคุณจะตั้งค่าเป็น false ก็ตาม ค่าเริ่มต้นคือ false
|
sendUpdates |
string |
ผู้เข้าร่วมที่ควรได้รับการแจ้งเตือนเกี่ยวกับการเปลี่ยนแปลงของผู้จัดกิจกรรม
ค่าที่ยอมรับมีดังนี้
|
การให้สิทธิ์
คําขอนี้ต้องได้รับอนุญาตจากขอบเขตต่อไปนี้อย่างน้อย 1 ขอบเขต
ขอบเขต |
---|
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.events |
สําหรับข้อมูลเพิ่มเติม โปรดดูหน้าการตรวจสอบสิทธิ์และการให้สิทธิ์
เนื้อหาของคำขอ
อย่าให้เนื้อหาคําขอด้วยวิธีนี้
คำตอบ
หากสําเร็จ วิธีนี้แสดงทรัพยากรเหตุการณ์ในส่วนเนื้อหาของการตอบกลับ
ตัวอย่าง
หมายเหตุ: ตัวอย่างโค้ดที่มีสำหรับวิธีการนี้ไม่ได้แสดงถึงภาษาโปรแกรมที่รองรับทั้งหมด (ดูรายการภาษาที่รองรับได้ในหน้าไลบรารีของไคลเอ็นต์)
Java
import com.google.api.services.calendar.Calendar; import com.google.api.services.calendar.model.Event; // ... // Initialize Calendar service with valid OAuth credentials Calendar service = new Calendar.Builder(httpTransport, jsonFactory, credentials) .setApplicationName("applicationName").build(); // Move an event to another calendar Event updatedEvent = service.events().move('primary', "eventId", "destinationCalendarId").execute(); System.out.println(updatedEvent.getUpdated());
Python
# First retrieve the event from the API. updated_event = service.events().move( calendarId='primary', eventId='eventId', destination='destinationCalendarId').execute() # Print the updated date. print updated_event['updated']
PHP
$result = $service->events->move('primary', 'eventId', 'destinationCalendarId'); // Print the updated date. echo $result->getUpdated();
Ruby
result = client.move_event('primary', 'eventId', 'destinationCalendarId') print result.updated
ลองใช้เลย
ใช้เครื่องมือสํารวจ API ด้านล่างเพื่อเรียกใช้วิธีการนี้สําหรับข้อมูลสดและดูการตอบกลับ