The absence services enable the employee to request absence, and the planner to register absence (ie an employee who does not come to work due to illness). The planner must approve or deny the employee’s absence requests.
a) Create New Absence Request/Register Absence
When an employee wants to plan an absence, they must submit an absence request. When a planner wants to register absence, they use the same service. If a planner registers absence, there is the option to make shifts in the absence period available.
Parameter | Format | Example |
employeeId | Guid | 766c9732-e2d1-46d1-ae3e-a74c560bb8e6 |
DateFrom | DateTime | 2011-09-02T12:37:00 |
DateTo | DateTime | 2011-09-02T12:37:00 |
leaveTypeId | as specified by the leavetype service | 1 |
Request (JSON)
POST /LeaveRequests/?securityToken={sessionToken}&makeShiftsVacant={makeShiftsVacant} {"EmployeeId":"<employeeId>", "DateFrom":"<DateFrom>","DateTo":"<dateTo>", "LeaveTypeId":"<leaveTypeId>, "Comment":"<comment>"}
Response (JSON)
HTTP/1.1 200 OK
b) List of Future Absences
This service returns a list of the registered absences for the logged-in employee.
Request (JSON)
GET /Leave/Future/?securityToken={sessionToken}
Response (JSON)
HTTP/1.1 200 OK [{"LeaveRequestId":"766c9732-e2d1-46d1-ae3e-a74c560bb8e6", "EmployeeId":"ffff9732-e2d1-46d1-ae3e-a74c560bb702", “EmployeeName”:”Karina”, "DateFrom":"\/Date(1316700000000+0200)\/", "DateTo":"\/Date(1316700000000+0200)\/", "LeaveTypeId":"1", ”LeaveTypeName”:”Vacation”} ... {"LeaveRequestId":"766c9732-e2d1-46d1-ae3e-a74c560bb8e6", "EmployeeId":"ffff9732-e2d1-46d1-ae3e-a74c560bb702", “EmployeeName”:”Karina”, "DateFrom":"\/Date(1316700000000+0200)\/", "DateTo":"\/Date(1316700000000+0200)\/", "LeaveTypeId":"1" ”LeaveTypeName”:”Vacation”}]
c) Approve or Deny Absence Requests
When a planner wishes to approve or deny an absence request, they are updating the corresponding absence request. This is available for planners only.
Request (JSON)
PUT /LeaveRequests/{requestId}/?securityToken={token} Request (JSON) { "LeaveRequestId": "<requestId>", "IsApproved": “<bool>”, "MoveShiftsToVacant":” <bool>”, "SmsComment": "<comment>"}
Response (JSON)
HTTP/1.1 200 OK
d) List of Absence Categories
This service returns a list of the currently available absence categories for use by the leave request service. This is available for all roles.
If employeeId
and datefrom
are provided, the categories are limited for that employee.
Request (JSON)
GET /Leave/Groups/?securityToken={tokenId}&employeeId={employeeId}&dateFrom={dateFrom}
Response (JSON)
HTTP/1.1 200 OK [{"Id":"766c9732-e2d1-46d1-ae3e-a74c560bb8e6", "Name":"Ferie"}, ... {"Id":"aaaaa732-e2d1-46d1-ae3e-a74c560bb8e6", "Name":"Syg"}]
e) List of Absence Types
This service returns a list of the currently available absence types for use by the leave request service. This is available for all roles. Employees can only choose between a subset of absence types, as specified in tamigo.
If the absenseGroupId
is supplied, the list will be filtered by the categories if all possible leavetypes
are returned.
Request (JSON)
GET/Leave/LeaveRequestTypes/?securityToken={tokenId}&employeeId={employeeId}&absenceGroupId={absenceGroupdId}")
Response (JSON)
HTTP/1.1 200 OK [{"LeaveTypeId":"766c9732-e2d1-46d1-ae3e-a74c560bb8e6", "Name":"Ferie"}, {"LeaveTypeId":"aaaaa732-e2d1-46d1-ae3e-a74c560bb8e6", "Name":"Syg"}]
f) List of Employees from Department
This service returns the list of employees you can register absence for.
Request (JSON)
GET /Leave/Employees/?securityToken={token}
Response (JSON)
HTTP/1.1 200 OK