Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
Decline a scheduleChangeRequest object for a user. This action only supports application permissions.
Permissions
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.
Permissions for offerShiftRequest:
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Not supported. | Not supported. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Schedule.ReadWrite.All | Not available. |
Permissions for openShiftChangeRequest:
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Not supported. | Not supported. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Schedule.ReadWrite.All | Not available. |
Permissions for swapShiftsChangeRequest:
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Not supported. | Not supported. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Schedule.ReadWrite.All | Not available. |
Permissions for timeOffRequest:
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Not supported. | Not supported. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Schedule.ReadWrite.All | Not available. |
HTTP request
To decline an offerShiftRequest object for a user.
POST /teams/{teamsId}/schedule/offerShiftRequests/{offerShiftRequestId}/declineForUser
To decline an openShiftChangeRequest object for a user.
POST /teams/{teamsId}/schedule/openShiftChangeRequests/{openShiftChangeRequestId}/declineForUser
To decline a swapShiftsChangeRequest object for a user.
POST /teams/{teamId}/schedule/swapShiftsChangeRequests/{swapShiftChangeRequestId}/declineForUser
To decline a timeOffRequest object for a user.
POST /teams/{teamsId}/schedule/timeOffRequests/{timeOffRequestId}/declineForUser
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Content-Type | application/json. Required. |
Request body
In the request body, supply a JSON representation of the parameters.
Parameter | Type | Description |
---|---|---|
message | String | Custom message sent on decline. Optional. |
userId | String | ID of the user who declined the request. Required. |
Response
If successful, this action returns a 204 No Content
response code.
Examples
Example 1: Decline an offer shift request for a user
The following example shows how to decline an offerShiftRequest for a user. The request can be declined by the sender or the assignee. For details, see the assignedTo property in scheduleChangeRequest.
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/teams/8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/schedule/offerShiftRequests/SREQ_8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/declineForUser
Content-Type: application/json
{
"message": "Declined.",
"userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884"
}
Response
The following example shows the response.
HTTP/1.1 204 No Content
Example 2: Decline an open shift change request for a user
The following example shows how to decline an openShiftChangeRequest for a user. The request can be declined by the sender or a team owner (manager).
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/teams/8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/schedule/openShiftChangeRequests/SREQ_8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/declineForUser
Content-Type: application/json
{
"message": "Declined.",
"userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884"
}
Response
The following example shows the response.
HTTP/1.1 204 No Content
Example 3: Decline a swap shift change request for a user
The following example shows how to decline a swapShiftsChangeRequest for a user. The request can be declined by the sender or the assignee (see assignedTo
property in scheduleChangeRequest).
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/teams/8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/schedule/swapShiftsChangeRequests/SREQ_8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/declineForUser
Content-Type: application/json
{
"message": "Declined.",
"userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884"
}
Response
The following example shows the response.
HTTP/1.1 204 No Content
Example 4: Decline a time off request for a user
The following example shows how to decline a timeOffRequest for a user. The userId must be a team owner (manager).
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/teams/8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/schedule/timeOffRequests/SREQ_8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/declineForUser
Content-Type: application/json
{
"message": "Declined.",
"userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884"
}
Response
The following example shows the response.
HTTP/1.1 204 No Content