更新 shiftPreferencesUpdate shiftPreferences

命名空间:microsoft.graphNamespace: microsoft.graph

更新 shiftPreferences 对象的属性和 关系。Update the properties and relationships of a shiftPreferences object.

权限Permissions

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限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) User.ReadWrite.AllUser.ReadWrite.All
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) 不支持。Not supported.
应用程序Application UserShiftPreferences.ReadWrite.AllUserShiftPreferences.ReadWrite.All

注意:此 API 支持管理员权限。Note: This API supports admin permissions. 全局管理员可以访问他们不是其成员组。Global admins can access groups that they are not a member of.

HTTP 请求HTTP request

PATCH /users/{userId}/settings/shiftPreferences

请求标头Request headers

标头Header Value
AuthorizationAuthorization Bearer {token}。必需。Bearer {token}. Required.
Content-TypeContent-Type application/json. Required.application/json. Required.

请求正文Request body

在请求正文中,提供 shiftPreferences 对象的 JSON 表示形式。In the request body, supply a JSON representation of a shiftPreferences object.

响应Response

如果成功,此方法返回 204 NO CONTENT 响应代码。If successful, this method returns a 204 NO CONTENT response code.

示例Example

请求Request

下面展示了示例请求。The following is an example of the request.

PATCH https://graph.microsoft.com/v1.0/users/871dbd5c-3a6a-4392-bfe1-042452793a50/settings/shiftPreferences
Content-type: application/json

{
    "id": "SHPR_eeab4fb1-20e5-48ca-ad9b-98119d94bee7",
    "@odata.etag": "1a371e53-f0a6-4327-a1ee-e3c56e4b38aa",
    "availability": [
        {
            "recurrence": {
                "pattern": {
                    "type": "Weekly",
                    "daysOfWeek": ["Monday", "Wednesday", "Friday"],
                    "interval": 1
                },
                "range": {
                    "type": "noEnd"
                }
            },
            "timeZone": "Pacific Standard Time",
            "timeSlots": null
        }
    ]
}

响应Response

下面展示了示例响应。The following is an example of the response.

HTTP/1.1 204 NO CONTENT