Edit

Share via


workHoursAndLocationsSetting: occurrencesView

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Get work plan occurrences from your own work plan within a specified date range. This function requires the startDateTime and endDateTime parameters.

Permissions

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.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Calendars.Read Calendars.ReadWrite
Delegated (personal Microsoft account) Not supported. Not supported.
Application Not supported. Not supported.

HTTP request

GET /me/settings/workHoursAndLocations/occurrencesView(startDateTime='{startDateTime}',endDateTime='{endDateTime}')

Note

Calling the /me endpoint requires a signed-in user and therefore a delegated permission. Application permissions aren't supported when using the /me endpoint.

When using the /users/{id} endpoint, the ID must be your own user ID.

GET /users/{id | userPrincipalName}/settings/workHoursAndLocations/occurrencesView(startDateTime='{startDateTime}',endDateTime='{endDateTime}')

Function parameters

In the request URL, provide the following required function parameters with values.

Parameter Type Description
endDateTime String The end date and time of the time range, represented in ISO 8601 format.
startDateTime String The start date and time of the time range, represented in ISO 8601 format.

Optional query parameters

This method supports the $select and $top OData query parameters to help customize the response.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this function returns a 200 OK response code and a collection of workPlanOccurrence objects in the response body.

Examples

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/me/settings/workHoursAndLocations/occurrencesView(startDateTime='2025-12-01T00:00:00Z',endDateTime='2025-12-01T23:59:59Z')

Response

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

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.workPlanOccurrence)",
  "value": [
    {
      "id": "AAkBOQAICN4wbJIpwAAuAAAAAB2EAxGqZhHNm8gAqgAvxFoNAOtpUxZW-2ZHr9tjSZTO0jMAA2pPCT8AABA=",
      "recurrenceId": "AAkALgAAAAAAHYQDEapmEc2byACqAC-EWg0A62lTFlb-Zkev22NJlM7SMwADak8JPwAA",
      "workLocationType": "remote",
      "start": {
        "dateTime": "2025-12-01T09:00:00.0000000",
        "timeZone": "Pacific Standard Time"
      },
      "end": {
        "dateTime": "2025-12-01T18:00:00.0000000",
        "timeZone": "Pacific Standard Time"
      }
    }
  ]
}