API for Calamari, your HR tool
API for Calamari, your HR tool
Create an absence request.Expect error codes:
Employee e-mail or login. Absence request will be created for the chosen employee. Chosen employee will be also a creator of request.
Time part value for absence start. Allowed values are based on minimal duration of absence request in absence type configuration.
Time part value for absence end. Allowed values are based on minimal duration of absence request in absence type configuration.
curl -i -X POST \
-u <username>:<password> \
https://awesome-company.calamari.io/api/leave/request/v1/create \
-H 'Content-Type: application/json' \
-d '{
"employee": "john.white@mycompany.com",
"fromPart": "MORNING",
"toPart": "END_OF_DAY",
"absenceTypeId": "PTO",
"reason": "Home office",
"substitute": "john.white@mycompany.com",
"comment": "Home office",
"dateFrom": "2019-08-24",
"dateTo": "2019-08-24"
}'
{ "id": 0 }
Employee identifier. You can use e-mail or external identifier in format (externalNumber:ABC123)
curl -i -X POST \
-u <username>:<password> \
https://awesome-company.calamari.io/api/leave/request/v1/create-comment \
-H 'Content-Type: application/json' \
-d '{
"creator": "john.white@mycompany.com",
"content": "Home office",
"absenceRequestId": 12
}'
[ { "commentator": { … }, "content": "string", "absenceRequestId": 0 } ]
curl -i -X POST \
-u <username>:<password> \
https://awesome-company.calamari.io/api/leave/request/v1/find \
-H 'Content-Type: application/json' \
-d '{
"employee": "john.white@mycompany.com",
"from": "2017-01-10",
"to": "2017-01-15"
}'
successful operation
Absence category. TIMEOFF - regular time off. WORK - when employee is working but is not in office (eg. 'Remote working day')
Absence request status
Local start date and start time of absence
[ { "id": 0, "from": "2017-02-20", "to": "2017-02-25", "absenceTypeName": "Annual leave", "absenceTypeId": 0, "absenceCategory": "TIMEOFF", "status": "PENDING", "entitlementAmount": 0.1, "reason": "string", "amountFirstDay": 0.1, "amountLastDay": 0.1, "entitlementAmountUnit": "DAYS", "created": "2019-08-24T14:15:22Z", "updated": "2019-08-24T14:15:22Z", "fullDayRequest": true, "startTime": "2018-06-30T09:00:00.000", "endTime": "2018-06-30T13:00:00.000", "timeZone": { … }, "hasAttachments": true } ]
Find absence requests in dates range.
If you provide more than one value in one filter attribute there is OR relation between them. For instance: if you put in a filter: {employees: ["john@mycompany.com", "kevin@mycompany.com"]} it returns all John's and all Kevin's requests.
When you fill more than one attribute in filter all conditions have to be fulfilled. There is AND relation between attributes. For instance: if you provide in filter {absenceTypes: ["PTO"], teams: ["DevTeam"]} then will be returned PTO requests of employees who are in team DevTeam.
Expect error codes:
Start date of dates range to search request in ISO format
List of absence types names or identifiers to search. Example: ["Annual Leave", "Remote Work", "Sick Leave"]
List of teams names or identifiers to search. As a result there will be absence requests of employees who are members of at least one of provided teams. Example: ["First Team", "Second Team", "Third Team"]
List of positions names or identifiers to search. As a result there will be absence requests of employees who have one of provided positions. Example: ["Developer", "Support", "Architect"]
List of contract types names or identifiers to search. As a result there will be absence requests of employees who have one of contract type. Example: ["firstContract", "secondContract"]
List of employees e-mails or logins. Example: ["john.smith@domain.com", "mark.small@domain.com"]
Filter absence requests by date of creation. As a result there will be absence requests created at the provided moment or later. Please provide the date and time in ISO 8601 format with time zone.
Filter absence requests by date of creation. As a result there will be absence requests created before the provided moment. Please provide the date and time in ISO 8601 format with time zone.
Filter absence requests by date of last update. As a result there will be absence requests updated at the provided moment or later. Please provide the date and time in ISO 8601 format with time zone.
Filter absence requests by date of last update. As a result there will be absence requests updated before the provided moment. Please provide the date and time in ISO 8601 format with time zone.
Filter absence requests by absence statuses. As a result there will be absence requests with chosen statuses. By default return all absence requests. Allowed values: ["PENDING", "PENDING_CANCELLATION", "REJECTED", "APPROVED", "CANCELED", "REVOKED"]
curl -i -X POST \
-u <username>:<password> \
https://awesome-company.calamari.io/api/leave/request/v1/find-advanced \
-H 'Content-Type: application/json' \
-d '{
"from": "2017-01-10",
"to": "2017-01-15",
"absenceTypes": [
"string"
],
"teams": [
"string"
],
"positions": [
"string"
],
"contractTypes": [
"string"
],
"employees": [
"string"
],
"createdFrom": "2017-01-23T08:00:00+01:00",
"createdTo": "2017-01-24T00:00:00+01:00",
"updatedFrom": "2017-01-23T08:00:00+01:00",
"updatedTo": "2017-01-24T00:00:00+01:00",
"absenceStatuses": "[PENDING, APPROVED]"
}'
successful operation
Absence category. TIMEOFF - regular time off. WORK - when employee is working but is not in office (eg. 'Remote working day')
Absence request status
Local start date and start time of absence
Substitute email. Has null value if employee does not have substitute
[ { "id": 0, "from": "2017-02-20", "to": "2017-02-25", "absenceTypeName": "Annual leave", "absenceTypeId": 0, "absenceCategory": "TIMEOFF", "status": "PENDING", "entitlementAmount": 0.1, "reason": "string", "amountFirstDay": 0.1, "amountLastDay": 0.1, "entitlementAmountUnit": "DAYS", "created": "2019-08-24T14:15:22Z", "updated": "2019-08-24T14:15:22Z", "fullDayRequest": true, "startTime": "2018-06-30T09:00:00.000", "endTime": "2018-06-30T13:00:00.000", "timeZone": { … }, "hasAttachments": true, "employeeEmail": "john.white@mycompany.com", "substituteEmail": "john.black@mycompany.com" } ]
curl -i -X POST \
-u <username>:<password> \
https://awesome-company.calamari.io/api/leave/request/v1/remove \
-H 'Content-Type: application/json' \
-d '{
"id": 0
}'
{ "message": "Api error", "code": "INVALID_JSON_PAYLOAD", "field": "field" }