AVAILABLE WITH BUSINESS SUBSCRIPTION
Request: POST /users/work-leave-status
Permissions to Run the Request
Account Owner, Account Administrators, Department Administrators, or custom roles.
Department Administrators and users with a custom role can add users only to the departments they manage and their sub-departments.
Request Headers and Parameters
Header | Description |
---|
Authorization (required) | Access token. You can obtain a token by making a request |
Parameter | Description |
---|
userid (required) | The ID of a user you want to add a work leave status for |
workLeaveReason (required) | Reasons for work leave status: - OutOfTheOffice
- OnVacation
- PersonalLeave
- BusinessTrip
- SickLeave
- ParentalLeave
- EducationalLeave
|
startDate (optional) | The work leave status start date. You can add it in the yyyy-mm-dd format |
endDate (optional) | The work leave status end date. You can add it in the yyyy-mm-dd format |
Possible Response Codes
Code | Text | Description |
---|
200 | OK | A new work leave status has been added |
400 | Bad Request | Some of the sent parameters are incorrect |
401 | Unauthorized | An authorization error |
403 | Permission Denied | The user doesn't have enough permissions to add other users. For instance, Department Administrators can't add work leave statuses to users from a department they don't manage |
Sample Request
POST /user https/1.1
Host: api-learn.ispringlearn.com
Authorization: p-1sJDjmULL5DdpXPJTcbm4jVIaWVHvNmrjAxATRbNE
Content-Type:application/xml
<?xml version="1.0" encoding="UTF-8"?>
<request>
<workLeaveStatuses>
<userId>76a38028-c8b7-11ed-a616-0542ac15004f</userId>
<workLeaveReason>SickLeave</workLeaveReason>
<startDate>2024-01-12</startDate>
<endDate>2024-01-15</endDate>
</workLeaveStatuses>
<workLeaveStatuses>
<userId>f5bafbba-c7eb-11ed-a327-0242ac12004e</userId>
<workLeaveReason>PersonalLeave</workLeaveReason>
<startDate>2024-01-12</startDate>
<endDate>2024-01-20</endDate>
</workLeaveStatuses>
</request>
XML
Sample Response
https/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
XML