team: getShifts
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 all shift objects across all teams to which a user is a direct member.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Schedule.Read.All | Schedule.ReadWrite.All |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Schedule.Read.All | Schedule.ReadWrite.All |
HTTP request
GET /me/joinedTeams/getShifts
GET /users/{id | user-principal-name}/joinedTeams/getShifts
Optional query parameters
This method supports the $top
and $filter
OData query parameters to help customize the response.
Note
The $filter
parameter supports the sharedShift/startDateTime, sharedShift/endDateTime, userId and teamInfo/teamId properties. It doesn't support the use of the same property more than once in a query. For example, the following query doesn't work: sharedShift/startDateTime ge 2024-05-09T00:00:00Z and sharedShift/startDateTime le 2024-05-09T23:59:59Z
; however, the following query works: sharedShift/startDateTime ge 2024-05-09T00:00:00Z and sharedShift/endDateTime le 2024-05-09T23:59:59Z
.
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
MS-APP-ACTS-AS | A user ID (GUID). Required only if the authorization token is an application token; otherwise, optional. |
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a collection of shift objects in the response body.
Examples
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/me/joinedTeams/getShifts
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
{
"value": [
{
"id": "SHFT_577b75d2-a927-48c0-a5d1-dc984894e7b8",
"createdDateTime": "2019-03-14T04:32:51.451Z",
"lastModifiedDateTime": "2019-03-14T05:32:51.451Z",
"userId": "c5d0c76b-80c4-481c-be50-923cd8d680a1",
"schedulingGroupId": "TAG_228940ed-ff84-4e25-b129-1b395cf78be0",
"schedulingGroupInfo": {
"displayName": "Cashiers",
"schedulingGroupId": "TAG_228940ed-ff84-4e25-b129-1b395cf78be0"
},
"teamInfo": {
"displayName": "Contoso Team",
"teamId": "172b0cce-e65d-44ce-9a49-91d9f2e8493a"
},
"userInfo": {
"displayName": "John Smith",
"userId": "c5d0c76b-80c4-481c-be50-923cd8d680a1"
},
"lastModifiedBy": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "366c0b19-49b1-41b5-a03f-9f3887bd0ed8",
"displayName": "John Doe"
}
},
"sharedShift": {
"displayName": "Day shift",
"notes": "Please do inventory as part of your shift.",
"startDateTime": "2019-03-11T15:00:00Z",
"endDateTime": "2019-03-12T00:00:00Z",
"theme": "blue",
"activities": [
{
"isPaid": true,
"startDateTime": "2019-03-11T15:00:00Z",
"endDateTime": "2019-03-11T15:15:00Z",
"code": "",
"displayName": "Lunch"
}
]
},
"draftShift": {
"displayName": "Day shift",
"notes": "Please do inventory as part of your shift.",
"startDateTime": "2019-03-11T15:00:00Z",
"endDateTime": "2019-03-12T00:00:00Z",
"theme": "blue",
"activities": [
{
"isPaid": true,
"startDateTime": "2019-03-11T15:00:00Z",
"endDateTime": "2019-03-11T15:30:00Z",
"code": "",
"displayName": "Lunch"
}
]
}
}
]
}