|
| 1 | +--- |
| 2 | +title: "scheduleChangeRequest: approveForUser" |
| 3 | +description: "Approve a scheduleChangeRequest object for a user." |
| 4 | +author: "lemikeshifts" |
| 5 | +ms.date: 03/31/2025 |
| 6 | +ms.localizationpriority: medium |
| 7 | +ms.subservice: teams |
| 8 | +doc_type: apiPageType |
| 9 | +--- |
| 10 | + |
| 11 | +# scheduleChangeRequest: approveForUser |
| 12 | + |
| 13 | +Namespace: microsoft.graph |
| 14 | + |
| 15 | +[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)] |
| 16 | + |
| 17 | +Approve a [scheduleChangeRequest](../resources/schedulechangerequest.md) object for a user. This action only supports application permissions. |
| 18 | + |
| 19 | +## Permissions |
| 20 | + |
| 21 | +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](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference). |
| 22 | + |
| 23 | +Permissions for [offerShiftRequest](../resources/offershiftrequest.md): |
| 24 | + |
| 25 | +<!-- { "blockType": "permissions", "name": "schedulechangerequest_approveforuser" } --> |
| 26 | +[!INCLUDE [permissions-table](../includes/permissions/schedulechangerequest-approveforuser-permissions.md)] |
| 27 | + |
| 28 | +Permissions for [openShiftChangeRequest](../resources/openshiftchangerequest.md): |
| 29 | + |
| 30 | +<!-- { "blockType": "permissions", "name": "schedulechangerequest_approveforuser_2" } --> |
| 31 | +[!INCLUDE [permissions-table](../includes/permissions/schedulechangerequest-approveforuser-2-permissions.md)] |
| 32 | + |
| 33 | +Permissions for [swapShiftsChangeRequest](../resources/swapshiftschangerequest.md): |
| 34 | + |
| 35 | +<!-- { "blockType": "permissions", "name": "schedulechangerequest_approveforuser_3" } --> |
| 36 | +[!INCLUDE [permissions-table](../includes/permissions/schedulechangerequest-approveforuser-3-permissions.md)] |
| 37 | + |
| 38 | +Permissions for [timeOffRequest](../resources/timeoffrequest.md): |
| 39 | + |
| 40 | +<!-- { "blockType": "permissions", "name": "schedulechangerequest_approveforuser_4" } --> |
| 41 | +[!INCLUDE [permissions-table](../includes/permissions/schedulechangerequest-approveforuser-4-permissions.md)] |
| 42 | + |
| 43 | +## HTTP request |
| 44 | + |
| 45 | +To approve an [offerShiftRequest](../resources/offershiftrequest.md) object for a user. |
| 46 | + |
| 47 | +<!-- { |
| 48 | + "blockType": "ignored" |
| 49 | +} |
| 50 | +--> |
| 51 | +``` http |
| 52 | +POST /teams/{teamsId}/schedule/offerShiftRequests/{offerShiftRequestId}/approveForUser |
| 53 | +``` |
| 54 | + |
| 55 | +To approve an [openShiftChangeRequest](../resources/openshiftchangerequest.md) object for a user. |
| 56 | + |
| 57 | +<!-- { |
| 58 | + "blockType": "ignored" |
| 59 | +} |
| 60 | +--> |
| 61 | +``` http |
| 62 | +POST /teams/{teamsId}/schedule/openShiftChangeRequests/{openShiftChangeRequestId}/approveForUser |
| 63 | +``` |
| 64 | + |
| 65 | +To approve a [swapShiftsChangeRequest](../resources/swapshiftschangerequest.md) object for a user. |
| 66 | + |
| 67 | +<!-- { |
| 68 | + "blockType": "ignored" |
| 69 | +} |
| 70 | +--> |
| 71 | +``` http |
| 72 | +POST /teams/{teamId}/schedule/swapShiftsChangeRequests/{swapShiftChangeRequestId}/approveForUser |
| 73 | +``` |
| 74 | + |
| 75 | +To approve a [timeOffRequest](../resources/timeoffrequest.md) object for a user. |
| 76 | + |
| 77 | +<!-- { |
| 78 | + "blockType": "ignored" |
| 79 | +} |
| 80 | +--> |
| 81 | +``` http |
| 82 | +POST /teams/{teamsId}/schedule/timeOffRequests/{timeOffRequestId}/approveForUser |
| 83 | +``` |
| 84 | + |
| 85 | +## Request headers |
| 86 | + |
| 87 | +|Name|Description| |
| 88 | +|:---|:---| |
| 89 | +|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).| |
| 90 | +|Content-Type|application/json. Required.| |
| 91 | + |
| 92 | +## Request body |
| 93 | + |
| 94 | +In the request body, supply a JSON representation of the parameters. |
| 95 | + |
| 96 | +|Parameter|Type|Description| |
| 97 | +|:---|:---|:---| |
| 98 | +|message|String|Custom message sent on approval. Optional.| |
| 99 | +|userId|String|ID of the user who approved the request. Required.| |
| 100 | + |
| 101 | +## Response |
| 102 | + |
| 103 | +If successful, this action returns a `204 No Content` response code. |
| 104 | + |
| 105 | +## Examples |
| 106 | + |
| 107 | +### Example 1: Approve an offer shift request for a user |
| 108 | + |
| 109 | +The following example shows how to approve an [offerShiftRequest](../resources/offershiftrequest.md) for a user. Only the assignee can approve the request. For details, see the **assignedTo** property in [scheduleChangeRequest](../resources/schedulechangerequest.md). |
| 110 | + |
| 111 | +#### Request |
| 112 | + |
| 113 | +The following example shows a request. |
| 114 | +<!-- { |
| 115 | + "blockType": "request", |
| 116 | + "name": "offershiftrequestthis.approveforuser" |
| 117 | +} |
| 118 | +--> |
| 119 | +``` http |
| 120 | +POST https://graph.microsoft.com/beta/teams/8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/schedule/offerShiftRequests/SREQ_bb7af804-9ca1-48d7-9a0c-aa5a9f447d3c/approveForUser |
| 121 | +Content-Type: application/json |
| 122 | +
|
| 123 | +{ |
| 124 | + "message": "Approved!", |
| 125 | + "userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884" |
| 126 | +} |
| 127 | +``` |
| 128 | + |
| 129 | +#### Response |
| 130 | + |
| 131 | +The following example shows the response. |
| 132 | +<!-- { |
| 133 | + "blockType": "response", |
| 134 | + "truncated": true |
| 135 | +} |
| 136 | +--> |
| 137 | +``` http |
| 138 | +HTTP/1.1 204 No Content |
| 139 | +``` |
| 140 | + |
| 141 | +### Example 2: Approve an open shift change request for a user |
| 142 | + |
| 143 | +The following example shows how to approve an [openShiftChangeRequest](../resources/openshiftchangerequest.md) for a user. The **userId** must be a team owner. |
| 144 | + |
| 145 | +#### Request |
| 146 | + |
| 147 | +The following example shows a request. |
| 148 | +<!-- { |
| 149 | + "blockType": "request", |
| 150 | + "name": "openshiftchangerequestthis.approveforuser" |
| 151 | +} |
| 152 | +--> |
| 153 | +``` http |
| 154 | +POST https://graph.microsoft.com/beta/teams/8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/schedule/openShiftChangeRequests/SREQ_8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/approveForUser |
| 155 | +Content-Type: application/json |
| 156 | +
|
| 157 | +{ |
| 158 | + "message": "Approved.", |
| 159 | + "userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884" |
| 160 | +} |
| 161 | +``` |
| 162 | + |
| 163 | +#### Response |
| 164 | + |
| 165 | +The following example shows the response. |
| 166 | +<!-- { |
| 167 | + "blockType": "response", |
| 168 | + "truncated": true |
| 169 | +} |
| 170 | +--> |
| 171 | +``` http |
| 172 | +HTTP/1.1 204 No Content |
| 173 | +``` |
| 174 | + |
| 175 | +### Example 3: Approve a swap shift change request for a user |
| 176 | + |
| 177 | +The following example shows how to approve a [swapShiftsChangeRequest](../resources/swapshiftschangerequest.md) for a user. Only the assignee can approve the request. For details, see the **assignedTo** property in [scheduleChangeRequest](../resources/schedulechangerequest.md). |
| 178 | + |
| 179 | +#### Request |
| 180 | + |
| 181 | +The following example shows a request. |
| 182 | +<!-- { |
| 183 | + "blockType": "request", |
| 184 | + "name": "swapShiftsChangeRequestthis.approveforuser" |
| 185 | +} |
| 186 | +--> |
| 187 | +``` http |
| 188 | +POST /teams/8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/schedule/swapShiftsChangeRequests/SREQ_8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/approveForUser |
| 189 | +Content-Type: application/json |
| 190 | +
|
| 191 | +{ |
| 192 | + "message": "Approved.", |
| 193 | + "userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884" |
| 194 | +} |
| 195 | +``` |
| 196 | + |
| 197 | +#### Response |
| 198 | + |
| 199 | +The following example shows the response. |
| 200 | +<!-- { |
| 201 | + "blockType": "response", |
| 202 | + "truncated": true |
| 203 | +} |
| 204 | +--> |
| 205 | +``` http |
| 206 | +HTTP/1.1 204 No Content |
| 207 | +``` |
| 208 | + |
| 209 | +### Example 4: Approve a time off request for a user |
| 210 | + |
| 211 | +The following example shows how to approve a [timeOffRequest](../resources/timeoffrequest.md) for a user. The **userId** must be a team owner (manager). |
| 212 | + |
| 213 | +#### Request |
| 214 | + |
| 215 | +The following example shows a request. |
| 216 | +<!-- { |
| 217 | + "blockType": "request", |
| 218 | + "name": "timeoffrequestthis.approveforuser" |
| 219 | +} |
| 220 | +--> |
| 221 | +``` http |
| 222 | +POST https://graph.microsoft.com/beta/teams/8f23a3b1-b87f-4a62-b38f-24a5fa83fa29/schedule/timeOffRequests/SREQ_bb7af804-9ca1-48d7-9a0c-aa5a9f447d3c/approveForUser |
| 223 | +Content-Type: application/json |
| 224 | +
|
| 225 | +{ |
| 226 | + "message": "Approved!", |
| 227 | + "userId": "d2e7b5b2-0355-4c73-a543-08847b5b0884" |
| 228 | +} |
| 229 | +``` |
| 230 | + |
| 231 | +#### Response |
| 232 | + |
| 233 | +The following example shows the response. |
| 234 | +<!-- { |
| 235 | + "blockType": "response", |
| 236 | + "truncated": true |
| 237 | +} |
| 238 | +--> |
| 239 | +``` http |
| 240 | +HTTP/1.1 204 No Content |
| 241 | +``` |
0 commit comments