| title | List calendarView |
|---|---|
| description | Get the occurrences, exceptions and single instances of events in a calendar view defined by a time range. |
| ms.localizationpriority | medium |
| author | iamgirishck |
| ms.subservice | outlook |
| doc_type | apiPageType |
| ms.date | 06/22/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Get the occurrences, exceptions and single instances of events in a calendar view defined by a time range,
from a user's default calendar (../me/calendarView) or some other calendar of the user's.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
A user's default calendar.
GET /me/calendar/calendarView?startDateTime={start_datetime}&endDateTime={end_datetime}
GET /users/{id | userPrincipalName}/calendar/calendarView?startDateTime={start_datetime}&endDateTime={end_datetime}A user's calendar in the default calendarGroup.
GET /me/calendars/{id}/calendarView?startDateTime={start_datetime}&endDateTime={end_datetime}
GET /users/{id | userPrincipalName}/calendars/{id}/calendarView?startDateTime={start_datetime}&endDateTime={end_datetime}A user's calendar in a specific calendarGroup.
GET /me/calendarGroups/{id}/calendars/{id}/calendarView?startDateTime={start_datetime}&endDateTime={end_datetime}
GET /users/{id | userPrincipalName}/calendarGroups/{id}/calendars/{id}/calendarView?startDateTime={start_datetime}&endDateTime={end_datetime}In the request URL, provide the following required query parameters with values.
| Parameter | Type | Description |
|---|---|---|
| startDateTime | String | The start date and time of the time range, represented in ISO 8601 format. For example, "2019-11-08T19:00:00-08:00". |
| endDateTime | String | The end date and time of the time range, represented in ISO 8601 format. For example, "2019-11-08T20:00:00-08:00". |
The values of startDateTime and endDateTime are interpreted using the timezone offset specified in the value and aren't impacted by the value of the Prefer: outlook.timezone header if present. If no timezone offset is included in the value, it is interpreted as UTC.
This method also supports some of the OData Query Parameters to help customize the response.
CalendarView with $top has a minimum value of 1 and maximum of 1000.
Note
The createdDateTime and lastModifiedDateTime properties of event do not support $select. To get their values, simply query on calendarView without applying $select.
| Name | Type | Description |
|---|---|---|
| Authorization | string | Bearer {token}. Required. Learn more about authentication and authorization. |
| Prefer: outlook.timezone | string | Use this to specify the time zone for start and end times in the response. If not specified, those time values are returned in UTC. Optional. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK response code and collection of event objects in the response body.
If the result set spans multiple pages, calendarView returns an @odata.nextLink property in the response that contains a URL to the next page of results. See paging for details.
The following example shows a request.
GET https://graph.microsoft.com/beta/me/calendar/calendarView?startDateTime=2017-01-01T19:00:00-08:00&endDateTime=2017-01-07T19:00:00-08:00
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"value": [
{
"originalStartTimeZone": "originalStartTimeZone-value",
"originalEndTimeZone": "originalEndTimeZone-value",
"responseStatus": {
"response": "response-value",
"time": "2016-10-19T10:37:00Z"
},
"uid": "iCalUId-value",
"reminderMinutesBeforeStart": 99,
"isReminderOn": true
}
]
}