Skip to content

Latest commit

 

History

History
269 lines (202 loc) · 7.94 KB

File metadata and controls

269 lines (202 loc) · 7.94 KB
title scheduleChangeRequest: approveForUser
description Approve a scheduleChangeRequest object for a user.
author lemikeshifts
ms.date 03/31/2025
ms.localizationpriority medium
ms.subservice teams
doc_type apiPageType

scheduleChangeRequest: approveForUser

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Approve 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:

[!INCLUDE permissions-table]

Permissions for openShiftChangeRequest:

[!INCLUDE permissions-table]

Permissions for swapShiftsChangeRequest:

[!INCLUDE permissions-table]

Permissions for timeOffRequest:

[!INCLUDE permissions-table]

HTTP request

To approve an offerShiftRequest object for a user.

POST /teams/{teamsId}/schedule/offerShiftRequests/{offerShiftRequestId}/approveForUser

To approve an openShiftChangeRequest object for a user.

POST /teams/{teamsId}/schedule/openShiftChangeRequests/{openShiftChangeRequestId}/approveForUser

To approve a swapShiftsChangeRequest object for a user.

POST /teams/{teamId}/schedule/swapShiftsChangeRequests/{swapShiftChangeRequestId}/approveForUser

To approve a timeOffRequest object for a user.

POST /teams/{teamsId}/schedule/timeOffRequests/{timeOffRequestId}/approveForUser

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 approval. Optional.
userId String ID of the user who approved the request. Required.

Response

If successful, this action returns a 204 No Content response code.

Examples

Example 1: Approve an offer shift request for a user

The following example shows how to approve an offerShiftRequest for a user. Only the assignee can approve the request. 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_bb7af804-9ca1-48d7-9a0c-aa5a9f447d3c/approveForUser
Content-Type: application/json

{
  "message": "Approved!",
  "userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 2: Approve an open shift change request for a user

The following example shows how to approve an openShiftChangeRequest for a user. The userId must be a team owner.

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/approveForUser
Content-Type: application/json

{
  "message": "Approved.",
  "userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 3: Approve a swap shift change request for a user

The following example shows how to approve a swapShiftsChangeRequest for a user. Only the assignee can approve the request. For details, see the assignedTo property in scheduleChangeRequest.

Request

The following example shows a request.

POST /teams/8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/schedule/swapShiftsChangeRequests/SREQ_8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/approveForUser
Content-Type: application/json

{
  "message": "Approved.",
  "userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 4: Approve a time off request for a user

The following example shows how to approve 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_bb7af804-9ca1-48d7-9a0c-aa5a9f447d3c/approveForUser
Content-Type: application/json

{
  "message": "Approved!",
  "userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

HTTP/1.1 204 No Content