schedule: share

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.

Share a schedule time range with schedule members. Make 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 by only 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.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Schedule.ReadWrite.All, Group.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application Schedule.ReadWrite.All

HTTP request

POST /teams/{teamId}/schedule/share

Request headers

Header Value
Authorization Bearer {token}. Required.
Content-Type application/json. Required.

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 to share shifts on the schedule from. Required.
endDateTime DateTimeOffset The end time to share shifts on the schedule until.

Response

If successful, this method returns a 204 No Content response code. It does not return anything in the response body.

Example

Request

The following is 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"
}

Response

The following is an example of the response.

HTTP/1.1 204 No content