Events: list

Returns events on the specified calendar. Try it now or see an example. 指定されたカレンダーの予定を返します。今すぐ試す、例を見てください

Request要求

HTTP requestHTTPリクエスト

GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events

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キーワード" "を使用してください。
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です。
iCalUID string Specifies event ID in the iCalendar format to be included in the response. Optional. 応答に含めるiCalendar形式のイベントIDを指定します。オプションです。
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. 応答に含める参加者の最大数。指定した数を超える出席者がいる場合は、参加者だけが返されます。オプションです。
maxResults integer Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. 1つの結果ページに返されるイベントの最大数 結果のページのイベント数は、この値より少なくても、クエリに一致するイベントがもっとあってもまったくない場合があります。不完全なページはnextPageToken、レスポンス内の空でないフィールドによって検出される可能性があります。デフォルトでは、値は250イベントです。ページサイズは2500イベントを超えることはできません。オプションです。
orderBy string The order of the events returned in the result. Optional. The default is an unspecified, stable order.

Acceptable values are:
  • "startTime": Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True) " startTime":開始日時順(昇順)で並びます。これは単一のイベントを問い合わせるときにのみ利用可能です(すなわち、パラメータsingleEventsはTrueです)。
  • "updated": Order by last modification time (ascending). " updated":最終更新日時順(昇順)で並び替えます。
pageToken string Token specifying which result page to return. Optional. どの結果ページを返すかを指定するトークン。オプションです。
privateExtendedProperty string Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints. 拡張プロパティー制約はpropertyName = valueとして指定されています。私有財産のみに一致します。このパラメーターは、与えられたすべての制約に一致するイベントを返すために複数回繰り返されることがあります。
q string Free text search terms to find events that match these terms in any field, except for extended properties. Optional. 拡張プロパティを除いて、任意のフィールドでこれらの用語と一致するイベントを見つけるためのフリーテキスト検索用語。オプションです。
sharedExtendedProperty string Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints. 拡張プロパティー制約はpropertyName = valueとして指定されています。共有プロパティのみに一致します。このパラメーターは、与えられたすべての制約に一致するイベントを返すために複数回繰り返されることがあります。
showDeleted boolean Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. 削除されたイベント(status" cancelled" が等しい)を結果に含めるかどうか。(ただし、基本的な定期的なイベント)のイベントを定期的にキャンセルの場合は、まだ場合も含まれますshowDeletedし、singleEvents両方ともFalseです。場合showDeletedsingleEvents削除されたイベントの両方の真の、唯一の単一インスタンスである(しかし、根本的な定期的なイベントではない)が返されます。オプションです。デフォルトはFalseです。
showHiddenInvitations boolean Whether to include hidden invitations in the result. Optional. The default is False. 結果に隠し招待を含めるかどうか。オプションです。デフォルトはFalseです。
singleEvents boolean Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False. 繰り返しイベントをインスタンスに展開し、単一の1回限りのイベントと繰り返しイベントのインスタンスのみを返し、基本となる繰り返しイベント自体は返さないかどうか。オプションです。デフォルトはFalseです。
syncToken string Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.
There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state.

These are:
  • iCalUID
  • orderBy
  • privateExtendedProperty
  • q
  • sharedExtendedProperty
  • timeMin
  • timeMax
  • updatedMin
If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.
Learn more about incremental synchronization.
Optional. The default is to return all entries.
timeMax datetime Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin. フィルタ処理するイベントの開始時間の上限(これを含まない)。オプションです。デフォルトでは、開始時間でフィルタリングしません。2011-06-03T10:00:00-07:00、2011-06-03T10:00:00Zなど、必須のタイムゾーンオフセットを含むRFC3339タイムスタンプである必要があります。ミリ秒を指定できますが無視されます。timeMinが設定されている場合は、timeMaxより大きい必要がありますtimeMin
timeMin datetime Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax. イベントによるフィルタ処理の終了時間の下限(両端を含む)。オプションです。デフォルトでは、終了時間でフィルタリングしません。2011-06-03T10:00:00-07:00、2011-06-03T10:00:00Zなど、必須のタイムゾーンオフセットを含むRFC3339タイムスタンプである必要があります。ミリ秒を指定できますが無視されます。timeMaxが設定されている場合、timeMinより小さくなければなりませんtimeMax
timeZone string Time zone used in the response. Optional. The default is the time zone of the calendar. 応答に使用されたタイムゾーン。オプションです。デフォルトはカレンダーのタイムゾーンです。
updatedMin datetime Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. Optional. The default is not to filter by last modification time. イベントの最終変更時刻(RFC3339タイムスタンプとして)の下限値。指定した場合、今回以降に削除されたエントリは、に関係なく常に含まれshowDeletedます。オプションです。デフォルトでは、最終変更時刻でフィルタリングしません。

Request bodyリクエストボディ

Do not supply a request body with this method.このメソッドでリクエストボディを指定しないでください。

Response応答

If successful, this method returns a response body with the following structure:成功した場合、このメソッドは以下の構造を持つレスポンスボディを返します。

{
  "kind": "calendar#events",
  "etag": etag,
  "summary": string,
  "description": string,
  "updated": datetime,
  "timeZone": string,
  "accessRole": string,
  "defaultReminders": [
    {
      "method": string,
      "minutes": integer
    }
  ],
  "nextPageToken": string,
  "nextSyncToken": string,
  "items": [
    events Resource
  ]
}
Property nameプロパティ名 Value Description説明 Notesノート
kind string Type of the collection ("calendar#events").コレクションの種類( " calendar#events")。
etag etag ETag of the collection.コレクションのETag。
summary string Title of the calendar. Read-only.カレンダーのタイトル 読み取り専用
description string Description of the calendar. Read-only.カレンダーの説明 読み取り専用
updated datetime Last modification time of the calendar (as a RFC3339 timestamp). Read-only.カレンダーの最終変更時刻(RFC 3339タイムスタンプとして)。読み取り専用
timeZone string The time zone of the calendar. Read-only.カレンダーのタイムゾーン。読み取り専用
accessRole string The user's access role for this calendar. Read-only. Possible values are:
  • "none" - The user has no access." none" - ユーザーにアクセス権がありません。
  • "freeBusyReader" - The user has read access to free/busy information." freeBusyReader" - ユーザーは空き時間情報への読み取りアクセス権を持っています。
  • "reader" - The user has read access to the calendar. Private events will appear to users with reader access, but event details will be hidden." reader" - ユーザーはカレンダーへの読み取りアクセス権を持っています。非公開の予定は閲覧者アクセス権を持つユーザーに表示されますが、予定の詳細は非表示になります。
  • "writer" - The user has read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible." writer" - ユーザーはカレンダーへの読み書きアクセス権を持っています。非公開のイベントは、書き込み権限を持つユーザーに表示され、イベントの詳細が表示されます。
  • "owner" - The user has ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs." owner" - ユーザーはカレンダーの所有権を持っています。このロールは、ACLを表示および操作するための追加機能を持つ、作家ロールのすべての許可を持っています。
defaultReminders[] list The default reminders on the calendar for the authenticated user. These reminders apply to all events on this calendar that do not explicitly override them (i.e. do not have reminders.useDefault set to True).認証されたユーザーの予定表のデフォルトの通知。これらのリマインダーは、このカレンダー上で明示的に上書きreminders.useDefaultされていない(つまりTrueに設定されていない)すべてのイベントに適用されます。
defaultReminders[].method string The method used by this reminder. Possible values are:
  • "email" - Reminders are sent via email." email" - リマインダは電子メールで送信されます。
  • "sms" - Deprecated. Once this feature is shutdown, the API will no longer return reminders using this method. Any newly added SMS reminders will be ignored. See Google Calendar SMS notifications to be removed for more information.

    Reminders are sent via SMS. These are only available for G Suite customers. Requests to set SMS reminders for other account types are ignored.通知はSMS経由で送信されます。これらはG Suiteのお客様のみご利用いただけます。他の種類のアカウントにSMSリマインダーを設定する要求は無視されます。

  • "popup" - Reminders are sent via a UI popup." popup" - リマインダーはUIポップアップを介して送信されます。

Required when adding a reminder.アラームを追加するときに必要です。

writable 書き込み可能
defaultReminders[].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 書き込み可能
nextPageToken string Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided.この結果の次のページにアクセスするためのトークン。それ以上の結果が得られない場合は省略され、その場合nextSyncTokenは提供されます。
items[] list List of events on the calendar.カレンダー上の予定のリスト。
nextSyncToken string Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided.この結果が返された後に変更されたエントリのみを取得するために後で使用されるトークン。さらなる結果が利用可能である場合nextPageTokenは省略され、その場合は提供される。

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;
import com.google.api.services.calendar.model.Events;
// ...
// Initialize Calendar service with valid OAuth credentials
Calendar service = new Calendar.Builder(httpTransport, jsonFactory, credentials)
    .setApplicationName("applicationName").build();
// Iterate over the events in the specified calendar
String pageToken = null;
do {
  Events events = service.events().list('primary').setPageToken(pageToken).execute();
  List<Event> items = events.getItems();
  for (Event event : items) {
    System.out.println(event.getSummary());
  }
  pageToken = events.getNextPageToken();
} while (pageToken != null);

Python

Uses the Python client library.Pythonクライアントライブラリを使用します

page_token = None
while True:
  events = service.events().list(calendarId='primary', pageToken=page_token).execute()
  for event in events['items']:
    print event['summary']
  page_token = events.get('nextPageToken')
  if not page_token:
    break

PHP

Uses the PHP client library.PHPクライアントライブラリを使用します

$events = $service->events->listEvents('primary');
while(true) {
  foreach ($events->getItems() as $event) {
    echo $event->getSummary();
  }
  $pageToken = $events->getNextPageToken();
  if ($pageToken) {
    $optParams = array('pageToken' => $pageToken);
    $events = $service->events->listEvents('primary', $optParams);
  } else {
    break;
  }
}

Rubyルビー

Uses the Ruby client library.Rubyクライアントライブラリを使用します

page_token = nil
begin
  result = client.list_events('primary', page_token: page_token)
  result.items.each do |e|
    print e.summary + "\n"
  end
  if result.next_page_token != page_token
    page_token = result.next_page_token
  else
    page_token = nil
  end
end while !page_token.nil?

Try it!それを試してみてください!

Use the APIs Explorer below to call this method on live data and see the response. 以下のAPI Explorerを使用して、ライブデータに対してこのメ??ソッドを呼び出して応答を確認してください。

関連記事

スポンサーリンク

letter-spacingを指定した要素内で「ー」と直後の文字とが重なる

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る