Events: move

予定を別のカレンダーに移動する(予定の主催者を変更する)。移動できるのは default イベントのみです。outOfOfficefocusTimeworkingLocationfromGmail イベントは移動できません。 こちらから今すぐお試しいただくか、をご覧ください。

リクエスト

HTTP リクエスト

POST https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId/move

パラメータ

パラメータ名 説明
パスパラメータ
calendarId string 現在予定が行われているソースカレンダーの ID。
eventId string イベント ID。
必須のクエリ パラメータ
destination string 予定の移動先のカレンダーのカレンダー ID。
省略可能なクエリ パラメータ
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

詳細については、認証と認可のページをご覧ください。

リクエスト本文

このメソッドをリクエストの本文に含めないでください。

レスポンス

成功すると、このメソッドはレスポンスの本文で Events リソースを返します。

注: このメソッドで使用可能なコード例では、サポートされているプログラミング言語すべての例を示しているわけではありません(サポートされている言語の一覧については、クライアント ライブラリ ページをご覧ください)。

Java

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

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

PHP クライアント ライブラリを使用します。

$result = $service->events->move('primary', 'eventId', 'destinationCalendarId');

// Print the updated date.
echo $result->getUpdated();

Ruby

Ruby クライアント ライブラリを使用します。

result = client.move_event('primary', 'eventId', 'destinationCalendarId')
print result.updated

試してみよう:

以下の API Explorer を使用して、ライブデータに対してこのメソッドを呼び出し、レスポンスを確認してください。