| title | team: getOpenShifts |
|---|---|
| description | Get all openShift objects across all teams a user is a direct member of. |
| author | shanemalone |
| ms.localizationpriority | medium |
| ms.subservice | teams |
| doc_type | apiPageType |
| ms.date | 04/04/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Get all openShift objects across all teams a user is a direct member of.
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
[!INCLUDE permissions-table]
GET /me/joinedTeams/getOpenShifts
GET /users/{id | user-principal-name}/joinedTeams/getOpenShiftsThis method supports the $top and $filter OData query parameters to help customize the response.
Note
The $filter parameter supports the sharedOpenShift/startDateTime, sharedOpenShift/endDateTime, 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: sharedOpenShift/startDateTime ge 2024-05-09T00:00:00Z and sharedOpenShift/startDateTime le 2024-05-09T23:59:59Z; however, the following query works: sharedOpenShift/startDateTime ge 2024-05-09T00:00:00Z and sharedOpenShift/endDateTime le 2024-05-09T23:59:59Z.
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| MS-APP-ACTS-AS (deprecated) | A user ID (GUID). Required only if the authorization token is an application token; otherwise, optional. The MS-APP-ACTS-AS header is deprecated and no longer required with application tokens. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK response code and a collection of openShift objects in the response body.
The following example shows a request.
GET https://graph.microsoft.com/beta/me/joinedTeams/getOpenShifts
[!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": [
{
"createdDateTime": "2019-03-14T04:32:51.451Z",
"draftOpenShift": {
"activities": [
{
"code": "Break",
"displayName": "Lunch",
"endDateTime": "2018-10-04T07:58:45.332Z",
"isPaid": true,
"startDateTime": "2018-10-04T00:58:45.340Z"
}
],
"displayName": "Day shift",
"endDateTime": "2018-10-04T08:58:45.340Z",
"notes": "Inventory Management",
"openSlotCount": 3,
"startDateTime": "2018-10-04T00:58:45.332Z",
"theme": "white"
},
"id": "OPNSHFT_577b75d2-a927-48c0-a5d1-dc984894e7b8",
"lastModifiedBy": {
"application": null,
"conversation": null,
"device": null,
"user": {
"displayName": "John Doe",
"id": "366c0b19-49b1-41b5-a03f-9f3887bd0ed8"
}
},
"lastModifiedDateTime": "2019-03-14T05:32:51.451Z",
"schedulingGroupId": "TAG_228940ed-ff84-4e25-b129-1b395cf78be0",
"sharedOpenShift": {
"activities": [
{
"code": "",
"displayName": "Lunch",
"endDateTime": "2018-10-04T01:58:45.340Z",
"isPaid": true,
"startDateTime": "2018-10-04T00:58:45.340Z"
}
],
"displayName": "Day shift",
"endDateTime": "2018-10-04T09:50:45.332Z",
"notes": "Inventory Management",
"openSlotCount": 2,
"startDateTime": "2018-10-04T00:58:45.340Z",
"theme": "white"
},
"schedulingGroupInfo": {
"displayName": "Cashiers",
"schedulingGroupId": "TAG_228940ed-ff84-4e25-b129-1b395cf78be0"
},
"teamInfo": {
"displayName": "Contoso Team",
"teamId": "172b0cce-e65d-44ce-9a49-91d9f2e8493a"
}
}
]
}