@@ -7,7 +7,7 @@ The Requests API provides endpoints for creating, fetching, and updating request
7
7
| [ GET /requests] ( #get-requests ) | Returns a list of requests with pagination and filtering options. |
8
8
| [ POST /requests] ( #post-requests ) | Creates a new request. |
9
9
| [ PUT /requests/: id ] ( #put-requestsid ) | Updates an existing request. |
10
- | [ PATCH /requests/: id ] ( #patch-requestsid ) | Updates an existing request before approval or rejection. |
10
+ | [ PATCH /requests/: id ] ( #patch-requestsid ) | Updates an existing request partially. |
11
11
12
12
### ** GET /requests**
13
13
@@ -368,9 +368,11 @@ Updates an existing request with the provided details.
368
368
369
369
### **PATCH /requests/:id**
370
370
371
- Updates an existing request before approval or rejection with the provided details.
371
+ - **Description:** Partially updates an existing request based on its type:
372
372
373
- - **Description:** Updates an existing request before approval or rejection with the provided details..
373
+ - For requests of type ONBOARDING, this endpoint updates the request details prior to its approval or rejection.
374
+
375
+ - For requests of type OOO (Out-Of-Office), it processes the approval or rejection of the request using the provided data.
374
376
375
377
- **URL:** `https://api.realdevsquad.com/requests/:id`
376
378
@@ -394,6 +396,41 @@ Updates an existing request before approval or rejection with the provided detai
394
396
395
397
- Body Parameters:
396
398
399
+ - **Example of OOO Request:**
400
+ ```json
401
+ {
402
+ "type" : " OOO" ,
403
+ "status" : " string" , // status must be APPROVED or REJECTED
404
+ "comment" : " string" // optional
405
+ }
406
+ ```
407
+
408
+ - **Success Response of OOO Request:**
409
+
410
+ - **Code:** 200
411
+ - **Content:**
412
+ ```json
413
+ {
414
+ "message" : " Request approved/rejected successfully"
415
+ }
416
+ ```
417
+
418
+ - **Error Responses of OOO Request:**
419
+ - **Code:** 400
420
+ - **Content:** `{ "statusCode": 400, "error": "Bad Request", "message": "Invalid request type" }`
421
+ - **Code:** 409
422
+ - **Content:** `{ "statusCode": 409, "error": "Conflict", "message": "Request already approved" }`
423
+ - **Code:** 409
424
+ - **Content:** `{ "statusCode": 409, "error": "Conflict", "message": "Request already rejected" }`
425
+ - **Code:** 401
426
+ - **Content:** `{ "statusCode": 401, "error": "Unauthorized", "message": "Unauthenticated User" }`
427
+ - **Code:** 403
428
+ - **Content:** `{ "statusCode": 401, "error": "Forbidden", "message": "Only super users are allowed to acknowledge OOO requests" }`
429
+ - **Code:** 404
430
+ - **Content:** `{ "statusCode": 404, "error": "Not Found", "message": "Request does not exist" }`
431
+ - **Code:** 500
432
+ - **Content:** `{ "statusCode": 500, "error": "Internal Server Error", "message": "An internal server error occurred" }`
433
+
397
434
- **Example of Onboarding Extension Request:**
398
435
```json
399
436
{
0 commit comments