Skip to content

Latest commit

 

History

History
147 lines (105 loc) · 6.02 KB

schedule-share.md

File metadata and controls

147 lines (105 loc) · 6.02 KB
title description author ms.localizationpriority ms.subservice doc_type
schedule: share
Share a schedule time range with schedule members.
aaku
medium
teams
apiPageType

schedule: share

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Share a schedule time range with schedule members.

This action makes the collections of shift, openshift and timeOff items in the specified time range of the schedule viewable by the specified team members, including employees and managers.

Each shift, openshift and timeOff instance in a schedule supports a draft version and a shared version of the item. The draft version is viewable only by managers, and the shared version is viewable by employees and managers. For each shift, openshift and timeOff instance in the specified time range, the share action updates the shared version from the draft version, so that in addition to managers, employees can also view the most current information about the item. The notifyTeam parameter further specifies which employees can view the item.

Note: To streamline the user experience, update all draft properites and then share all pending changes within a date range as a single action. The draft versions of the properties must be empty before you can update the shared versions of the items.

[!INCLUDE national-cloud-support]

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.

[!INCLUDE permissions-table]

HTTP request

POST /teams/{teamId}/schedule/share

Request headers

Header Value
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.
MS-APP-ACTS-AS A user ID (GUID). Required only if the authorization token is an application token; otherwise, optional.

Request body

In the request body, provide a JSON object with the following parameters.

Parameter Type Description
notifyTeam Boolean Indicates whether the entire team should get a visible notification of this action, or only employees that have a shift assigned to them that was shared. Required.
startDateTime DateTimeOffset The start time from which to share shifts on the schedule. Required.
endDateTime DateTimeOffset The end time until which to share shifts on the schedule.

Response

If successful, this method returns a 200 OK response code. It doesn't return anything in the response body.

Example

Request

Here's an example of the request.

POST https://graph.microsoft.com/beta/teams/{teamId}/schedule/share
Content-type: application/json

{
  "notifyTeam": true,
  "startDateTime": "2018-10-08T00:00:00.000Z",
  "endDateTime": "2018-10-15T00:00:00.000Z"
}

[!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]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

Here's an example of the response.

HTTP/1.1 200 OK

Related content

Microsoft Graph service-specific throttling limits