团队:getOpenShifts

命名空间:microsoft.graph

重要

Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

获取用户是其直接成员的所有团队中的所有 openShift 对象。

权限

要调用此 API,需要以下权限之一。 若要了解详细信息,包括如何选择权限的信息,请参阅权限

权限类型 最低特权权限 更高特权权限
委派(工作或学校帐户) Schedule.Read.All Schedule.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。 不支持。
应用程序 Schedule.Read.All Schedule.ReadWrite.All

HTTP 请求

GET /me/joinedTeams/getOpenShifts
GET /users/{id | user-principal-name}/joinedTeams/getOpenShifts

可选的查询参数

此方法支持使用 $top$filterOData 查询参数,以帮助自定义响应。

注意

参数 $filter 支持 sharedOpenShift/startDateTimesharedOpenShift/endDateTimeteamInfo/teamId 属性。 它不支持在查询中多次使用相同的属性。 例如,以下查询不起作用: sharedOpenShift/startDateTime ge 2024-05-09T00:00:00Z and sharedOpenShift/startDateTime le 2024-05-09T23:59:59Z;但是,以下查询有效: sharedOpenShift/startDateTime ge 2024-05-09T00:00:00Z and sharedOpenShift/endDateTime le 2024-05-09T23:59:59Z

请求标头

名称 说明
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权
MS-APP-ACTS-AS GUID) (用户 ID。 仅当授权令牌是应用程序令牌时才需要;否则为可选。

请求正文

请勿提供此方法的请求正文。

响应

如果成功,此方法在响应正文中返回响应 200 OK 代码和 openShift 对象的集合。

示例

请求

以下示例显示了一个请求。

GET https://graph.microsoft.com/beta/me/joinedTeams/getOpenShifts

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

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"
      }
    }
  ]
}