| title | Update shiftPreferences |
|---|---|
| description | Update a user's shift preferences. |
| author | akumar39 |
| ms.localizationpriority | medium |
| ms.subservice | teams |
| doc_type | apiPageType |
| ms.date | 04/05/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Update the properties and relationships of a shiftPreferences object.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
PUT /users/{userId}/settings/shiftPreferences| Header | Value |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
| 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. |
In the request body, supply a JSON representation of a shiftPreferences object.
If successful, this method returns a 204 NO CONTENT response code.
The following example shows a request.
PUT https://graph.microsoft.com/beta/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
}
]
}
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
HTTP/1.1 204 NO CONTENT