Events: update
Requires authorization 承認が必要
Updates an event. Try it now or see an example. イベントを更新します。今すぐ試すか、例を見てください。
Request要求
HTTP requestHTTPリクエスト
PUT https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId
Parametersパラメーター
Parameter nameパラメータ名 | Value値 | Description説明 |
---|---|---|
Path parametersパスパラメータ | ||
calendarId |
string |
Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary " keyword.
カレンダーID カレンダーIDを取得するには、calendarList.listメソッドを呼び出します。現在ログインしているユーザーのメインカレンダーにアクセスしたい場合は、primary キーワード" "を使用してください。 |
eventId |
string |
Event identifier. イベントID |
Optional query parametersオプションのクエリパラメータ | ||
alwaysIncludeEmail |
boolean |
Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.
email 実際の電子メールが利用できない場合でも、開催者、作成者、および出席者
のフィールドに常に値を含めるかどうか(つまり、生成された、機能しない値が提供されます)。このオプションの使用は推奨されておらず、言及された場所に電子メールアドレス値が存在しないことを処理できないクライアントによってのみ使用されるべきです。オプションです。デフォルトはFalseです。 |
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.
APIクライアントによってサポートされている会議データのバージョン番号。バージョン0では、会議データがサポートされていないと想定し、イベント本体の会議データを無視します。バージョン1では、ConferenceDataのコピーをサポートし、conferenceDataのcreateRequestフィールドを使用して新しい会議を作成することもできます。デフォルトは0です。許容値は0 to 1 です。 |
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. 応答に含める参加者の最大数。指定した数を超える出席者がいる場合は、参加者だけが返されます。オプションです。 |
sendNotifications |
boolean |
Deprecated. Please use 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 .
廃止予定です。代わりにsendUpdatesを使ってください。イベントの更新に関する通知を送信するかどうか(説明の変更など)。に値を設定しても、電子メールが送信される可能性があることに注意してください false 。デフォルトはfalse です。 |
sendUpdates |
string |
Guests who should receive notifications about the event update (for example, title changes, etc.).
Acceptable values are:
|
supportsAttachments |
boolean |
Whether API client performing operation supports event attachments. Optional. The default is False. 操作を実行しているAPIクライアントがイベント添付をサポートするかどうか。オプションです。デフォルトはFalseです。 |
Authorization承認
This request requires authorization with at least one of the following scopes (read more about authentication and authorization).この要求には、以下の範囲のうちの少なくとも1つを使用した許可が必要です(認証および許可について詳しく読む)。
Scope範囲 |
---|
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.events |
Request bodyリクエストボディ
In the request body, supply an Events resource with the following properties:リクエストボディで、次のプロパティを持つEventsリソースを指定します。
Property nameプロパティ名 | Value値 | Description説明 | Notesノート |
---|---|---|---|
Required Properties必要なプロパティ | |||
end |
nested object |
The (exclusive) end time of the event. For a recurring event, this is the end time of the first instance.イベントの(排他的)終了時刻。定期的なイベントの場合、これは最初のインスタンスの終了時刻です。 | |
start |
nested object |
The (inclusive) start time of the event. For a recurring event, this is the start time of the first instance.イベントの(包括的な)開始時刻。定期的な予定の場合、これは最初のインスタンスの開始時間です。 | |
Optional Propertiesオプションのプロパティ | |||
anyoneCanAddSelf |
boolean |
Whether anyone can invite themselves to the event (currently works for Google+ events only). Optional. The default is False.誰でも自分自身をイベントに招待できるかどうか(現在はGoogle+のイベントでのみ機能します)。オプションです。デフォルトはFalseです。 | writable 書き込み可能 |
attachments[].fileUrl |
string |
URL link to the attachment. For adding Google Drive file attachments use the same format as in Required when adding an attachment.Google Driveの添付ファイルを追加するには、Drive APIのリソースの 添付ファイルを追加するときに必要です。 |
writable 書き込み可能 |
attendees[] |
list |
The attendees of the event. See the Events with attendees guide for more information on scheduling events with other calendar users.イベントの参加者 他のカレンダユーザとのイベントのスケジュール設定の詳細については、参加者とのイベントガイドを参照してください。 | writable 書き込み可能 |
attendees[].additionalGuests |
integer |
Number of additional guests. Optional. The default is 0.追加ゲストの数 オプションです。デフォルトは0です。 | writable 書き込み可能 |
attendees[].comment |
string |
The attendee's response comment. Optional.参加者の回答コメント。オプションです。 | writable 書き込み可能 |
attendees[].displayName |
string |
The attendee's name, if available. Optional.利用可能な場合は出席者の名前。オプションです。 | writable 書き込み可能 |
attendees[].email |
string |
The attendee's email address, if available. This field must be present when adding an attendee. It must be a valid email address as per RFC5322. Required when adding an attendee.出席者を追加するときに必要です。 |
writable 書き込み可能 |
attendees[].optional |
boolean |
Whether this is an optional attendee. Optional. The default is False.これがオプションの参加者かどうか。オプションです。デフォルトはFalseです。 | writable 書き込み可能 |
attendees[].resource |
boolean |
Whether the attendee is a resource. Can only be set when the attendee is added to the event for the first time. Subsequent modifications are ignored. Optional. The default is False.出席者がリソースかどうか 参加者が初めてイベントに追加されたときにのみ設定できます。それ以降の変更は無視されます。オプションです。デフォルトはFalseです。 | writable 書き込み可能 |
attendees[].responseStatus |
string |
The attendee's response status. Possible values are:
|
writable 書き込み可能 |
attendeesOmitted |
boolean |
Whether attendees may have been omitted from the event's representation. When retrieving an event, this may be due to a restriction specified by the maxAttendee query parameter. When updating an event, this can be used to only update the participant's response. Optional. The default is False.出席者がイベントの表現から省略された可能性があるかどうか。イベントを取得するとき、これはmaxAttendee queryパラメータで指定された制限が原因である可能性があります。イベントを更新するとき、これは参加者の応答を更新するためだけに使用できます。オプションです。デフォルトはFalseです。 |
writable 書き込み可能 |
colorId |
string |
The color of the event. This is an ID referring to an entry in the event section of the colors definition (see the colors endpoint). Optional.イベントの色 これはevent 色の定義のセクションのエントリを参照するIDです(色の終点を参照)。オプションです。 |
writable 書き込み可能 |
conferenceData |
nested object |
The conference-related information, such as details of a Hangouts Meet conference. To create new conference details use the createRequest field. To persist your changes, remember to set the conferenceDataVersion request parameter to 1 for all event modification requests.ハングアウト会議の詳細など、会議関連の情報。新しい会議の詳細を作成するには、このcreateRequest フィールドを使用します。変更を保持するには、すべてのイベント変更要求に対してconferenceDataVersion requestパラメータをに設定することを忘れないでください1 。 |
writable 書き込み可能 |
description |
string |
Description of the event. Optional.イベントの説明 オプションです。 | writable 書き込み可能 |
end.date |
date |
The date, in the format "yyyy-mm-dd", if this is an all-day event.終日イベントの場合は "yyyy-mm-dd"の形式の日付。 | writable 書き込み可能 |
end.dateTime |
datetime |
The time, as a combined date-time value (formatted according to RFC3339). A time zone offset is required unless a time zone is explicitly specified in timeZone .日付と時刻の組み合わせの値としての時刻(RFC 3339に従ってフォーマットされたもの)。でタイムゾーンが明示的に指定されていない限り、タイムゾーンオフセットが必要ですtimeZone 。 |
writable 書き込み可能 |
end.timeZone |
string |
The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) For recurring events this field is required and specifies the time zone in which the recurrence is expanded. For single events this field is optional and indicates a custom time zone for the event start/end.時間が指定されているタイムゾーン。(IANAタイムゾーンデータベース名としてフォーマットされます、例えば、 "Europe / Zurich")。定期的なイベントの場合、このフィールドは必須であり、繰り返しが展開されるタイムゾーンを指定します。単一イベントの場合、このフィールドはオプションであり、イベントの開始/終了のカスタムタイムゾーンを示します。 | writable 書き込み可能 |
extendedProperties.private |
object |
Properties that are private to the copy of the event that appears on this calendar.このカレンダーに表示されるイベントのコピーに固有のプロパティ。 | writable 書き込み可能 |
extendedProperties.shared |
object |
Properties that are shared between copies of the event on other attendees' calendars.他の出席者のカレンダーの予定のコピー間で共有されるプロパティ。 | writable 書き込み可能 |
gadget.display |
string |
The gadget's display mode. Optional. Possible values are:
|
writable 書き込み可能 |
gadget.height |
integer |
The gadget's height in pixels. The height must be an integer greater than 0. Optional.ガジェットの高さ(ピクセル単位)。高さは0より大きい整数でなければなりません。 | writable 書き込み可能 |
gadget.iconLink |
string |
The gadget's icon URL. The URL scheme must be HTTPS.ガジェットのアイコンのURL。URLスキームはHTTPSにする必要があります。 | writable 書き込み可能 |
gadget.link |
string |
The gadget's URL. The URL scheme must be HTTPS.ガジェットのURL。URLスキームはHTTPSにする必要があります。 | writable 書き込み可能 |
gadget.preferences |
object |
Preferences.設定 | writable 書き込み可能 |
gadget.title |
string |
The gadget's title.ガジェットのタイトル。 | writable 書き込み可能 |
gadget.type |
string |
The gadget's type.ガジェットの種類。 | writable 書き込み可能 |
gadget.width |
integer |
The gadget's width in pixels. The width must be an integer greater than 0. Optional.ガジェットの幅(ピクセル単位)。幅は0より大きい整数でなければなりません。 | writable 書き込み可能 |
guestsCanInviteOthers |
boolean |
Whether attendees other than the organizer can invite others to the event. Optional. The default is True.開催者以外の出席者が他の人をイベントに招待できるかどうか。オプションです。デフォルトはTrueです。 | writable 書き込み可能 |
guestsCanModify |
boolean |
Whether attendees other than the organizer can modify the event. Optional. The default is False.開催者以外の出席者が予定を変更できるかどうか。オプションです。デフォルトはFalseです。 | writable 書き込み可能 |
guestsCanSeeOtherGuests |
boolean |
Whether attendees other than the organizer can see who the event's attendees are. Optional. The default is True.開催者以外の出席者が、イベントの出席者が誰であるかを確認できるかどうか。オプションです。デフォルトはTrueです。 | writable 書き込み可能 |
location |
string |
Geographic location of the event as free-form text. Optional.自由形式のテキストとしてのイベントの地理的位置。オプションです。 | writable 書き込み可能 |
originalStartTime.date |
date |
The date, in the format "yyyy-mm-dd", if this is an all-day event.終日イベントの場合は "yyyy-mm-dd"の形式の日付。 | writable 書き込み可能 |
originalStartTime.dateTime |
datetime |
The time, as a combined date-time value (formatted according to RFC3339). A time zone offset is required unless a time zone is explicitly specified in timeZone .日付と時刻の組み合わせの値としての時刻(RFC 3339に従ってフォーマットされたもの)。でタイムゾーンが明示的に指定されていない限り、タイムゾーンオフセットが必要ですtimeZone 。 |
writable 書き込み可能 |
originalStartTime.timeZone |
string |
The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) For recurring events this field is required and specifies the time zone in which the recurrence is expanded. For single events this field is optional and indicates a custom time zone for the event start/end.時間が指定されているタイムゾーン。(IANAタイムゾーンデータベース名としてフォーマットされます、例えば、 "Europe / Zurich")。定期的なイベントの場合、このフィールドは必須であり、繰り返しが展開されるタイムゾーンを指定します。単一イベントの場合、このフィールドはオプションであり、イベントの開始/終了のカスタムタイムゾーンを示します。 | writable 書き込み可能 |
recurrence[] |
list |
List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. Note that DTSTART and DTEND lines are not allowed in this field; event start and end times are specified in the start and end fields. This field is omitted for single events or instances of recurring events.RFC5545で指定されているように、繰り返しイベントのRRULE、EXRULE、RDATEおよびEXDATE行のリスト。DTSTART行とDTEND行はこのフィールドには使用できないことに注意してください。イベントの開始時間と終了時間はstart and end フィールドで指定します。このフィールドは、単一のイベントまたは定期的なイベントのインスタンスでは省略されます。 |
writable 書き込み可能 |
reminders.overrides[] |
list |
If the event doesn't use the default reminders, this lists the reminders specific to the event, or, if not set, indicates that no reminders are set for this event. The maximum number of override reminders is 5.イベントでデフォルトのアラームが使用されていない場合は、イベントに固有のアラームが一覧表示されます。設定されていない場合は、このイベントにアラームが設定されていないことを示します。上書きアラームの最大数は5です。 | writable 書き込み可能 |
reminders.overrides[].method |
string |
The method used by this reminder. Possible values are:
Required when adding a reminder.アラームを追加するときに必要です。 |
writable 書き込み可能 |
reminders.overrides[].minutes |
integer |
Number of minutes before the start of the event when the reminder should trigger. Valid values are between 0 and 40320 (4 weeks in minutes). Required when adding a reminder.アラームを追加するときに必要です。 |
writable 書き込み可能 |
reminders.useDefault |
boolean |
Whether the default reminders of the calendar apply to the event.カレンダーのデフォルトのアラームが予定に適用されるかどうか。 | writable 書き込み可能 |
sequence |
integer |
Sequence number as per iCalendar.iCalendarによるシーケンス番号 | writable 書き込み可能 |
source.title |
string |
Title of the source; for example a title of a web page or an email subject.ソースのタイトル たとえば、Webページのタイトルや電子メールの件名などです。 | writable 書き込み可能 |
source.url |
string |
URL of the source pointing to a resource. The URL scheme must be HTTP or HTTPS.リソースを指しているソースのURL。URLスキームはHTTPまたはHTTPSでなければなりません。 | writable 書き込み可能 |
start.date |
date |
The date, in the format "yyyy-mm-dd", if this is an all-day event.終日イベントの場合は "yyyy-mm-dd"の形式の日付。 | writable 書き込み可能 |
start.dateTime |
datetime |
The time, as a combined date-time value (formatted according to RFC3339). A time zone offset is required unless a time zone is explicitly specified in timeZone .日付と時刻の組み合わせの値としての時刻(RFC 3339に従ってフォーマットされたもの)。でタイムゾーンが明示的に指定されていない限り、タイムゾーンオフセットが必要ですtimeZone 。 |
writable 書き込み可能 |
start.timeZone |
string |
The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) For recurring events this field is required and specifies the time zone in which the recurrence is expanded. For single events this field is optional and indicates a custom time zone for the event start/end.時間が指定されているタイムゾーン。(IANAタイムゾーンデータベース名としてフォーマットされます、例えば、 "Europe / Zurich")。定期的なイベントの場合、このフィールドは必須であり、繰り返しが展開されるタイムゾーンを指定します。単一イベントの場合、このフィールドはオプションであり、イベントの開始/終了のカスタムタイムゾーンを示します。 | writable 書き込み可能 |
status |
string |
Status of the event. Optional. Possible values are:
|
writable 書き込み可能 |
summary |
string |
Title of the event.イベントのタイトル | writable 書き込み可能 |
transparency |
string |
Whether the event blocks time on the calendar. Optional. Possible values are:
|
writable 書き込み可能 |
visibility |
string |
Visibility of the event. Optional. Possible values are:
|
writable 書き込み可能 |
Response応答
If successful, this method returns an Events resource in the response body.成功した場合、このメソッドはレスポンスボディにEventsリソースを返します。
Examples例
Note: The code examples available for this method do not represent all supported programming languages (see the client libraries page for a list of supported languages).注:このメソッドで使用可能なコード例は、サポートされているすべてのプログラミング言語を表しているわけではありません(サポートされている言語のリストについては、クライアントライブラリのページを参照してください)。
Java
Uses the Java client library.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(); // Retrieve the event from the API Event event = service.events().get("primary", "eventId").execute(); // Make a change event.setSummary("Appointment at Somewhere"); // Update the event Event updatedEvent = service.events().update("primary", event.getId(), event).execute(); System.out.println(updatedEvent.getUpdated());
Python
Uses the Python client library.Pythonクライアントライブラリを使用します。
# First retrieve the event from the API. event = service.events().get(calendarId='primary', eventId='eventId').execute() event['summary'] = 'Appointment at Somewhere' updated_event = service.events().update(calendarId='primary', eventId=event['id'], body=event).execute() # Print the updated date. print updated_event['updated']
PHP
Uses the PHP client library.PHPクライアントライブラリを使用します。
// First retrieve the event from the API. $event = $service->events->get('primary', 'eventId'); $event->setSummary('Appointment at Somewhere'); $updatedEvent = $service->events->update('primary', $event->getId(), $event); // Print the updated date. echo $updatedEvent->getUpdated();
Rubyルビー
Uses the Ruby client library.Rubyクライアントライブラリを使用します。
event = client.get_event('primary', 'eventId') event.summary = 'Appointment at Somewhere' result = client.update_event('primary', event.id, event) print result.updated
Try it!それを試してみてください!
Use the APIs Explorer below to call this method on live data and see the response. 以下のAPI Explorerを使用して、ライブデータに対してこのメ??ソッドを呼び出して応答を確認してください。
関連記事
- Events: watch
- Events: quickAdd
- Events: patch
- Events: move
- Events: list
- Events: instances
- Events: insert
- Events: import
- Events: get
- Events: delete
スポンサーリンク