Calamari Public API (v1)
API for Calamari, your HR tool
https://{tenantName}.calamari.io/api/
Request
Add employee shift.
Expect error codes:
- INVALID_EMPLOYEE - when invalid employee id provided
- INVALID_SHIFT_START - when invalid start of work time provided
- INVALID_SHIFT_END - when invalid finish of work time provided
- SHIFT_END_BEFORE_START - when end of work time is before start
- SHIFT_TO_SHORT - when shift period is shorter than one minute
- INVALID_BREAK_TYPE - when invalid break type id provided. You should use get-break-types method to find proper break type ID
- INVALID_BREAK_FOR_USER - when break type is not available for employee
- INVALID_BREAK_START - when invalid start of break time provided
- INVALID_BREAK_END - when invalid finish of break time provided
- BREAK_END_BEFORE_START - when end of break time is before start
- BREAK_IS_NOT_IN_SHIFT_RANGE - when break time range goes beyond work time range
- BREAK_TO_SHORT - when break period is shorter than one minute
- BREAKS_OVERLAP - when one break time range overlaps another
- INVALID_PROJECT_TYPE - when invalid project type id provided. You should use get-projects method to find proper project type ID
- INVALID_PROJECT_FOR_USER - when project type is not available for employee. You should use get-projects-for-person method to find proper project type ID
- INVALID_PROJECT_TIME_ENTRY_START - when invalid start of project time entry provided
- INVALID_PROJECT_TIME_ENTRY_END - when invalid finish of project time entry provided
- PROJECT_TIME_ENTRY_END_BEFORE_START - when end of project time entry is before start
- PROJECT_TIME_ENTRY_IS_NOT_IN_SHIFT_RANGE - when project time entry goes beyond work time range
- PROJECT_TIME_ENTRY_TO_SHORT - when project time entry is shorter than one minute
- PROJECT_TIME_ENTRIES_OVERLAP - when one project time entry overlaps another
- SHIFT_DESCRIPTION_TOO_LONG - when description contains more than 4096 characters
Employee identifier. You can use e-mail or external identifier in format (externalNumber:ABC123)
https://awesome-company.calamari.io/api/clockin/timesheetentries/v1/create
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
'https://{tenantname}.calamari.io/api/clockin/timesheetentries/v1/create' \
-H 'Content-Type: application/json' \
-d '{
"person": "john.white@mycompany.com",
"shiftStart": "2019-08-24T14:15:22Z",
"shiftEnd": "2019-08-24T14:15:22Z",
"breaks": [
{
"breakType": 1,
"breakStart": "2019-08-24T14:15:22Z",
"breakEnd": "2019-08-24T14:15:22Z"
}
],
"projects": [
{
"projectType": 1,
"projectStart": "2019-08-24T14:15:22Z",
"projectEnd": "2019-08-24T14:15:22Z"
}
],
"description": "string"
}'
successful operation
Date and time of timesheet entry finished. Has null value if employee does not clock out
Finished work timezone. Has null value if employee does not clock out
Duration of timesheet entry in seconds. Has 0 value if employee does not clock out
Employee
List of breaks
Date and time when break was finished. Has null value if break was not finished
Duration of a break in seconds. Has null value if break was not finished.
List of projects
Date and time when employee finished working on project. Has null value if work on project was not finished
Duration of time spent on a project in seconds. Has null value if work on project was not finished
{ "id": 0, "started": "2019-08-24T14:15:22Z", "finished": "2019-08-24T14:15:22Z", "startedTimeZone": "Europe/Warsaw", "finishedTimeZone": "Europe/Warsaw", "duration": 28800, "person": { "firstName": "John", "lastName": "Williams", "email": "john.williams@domain.com", "externalId": "A12Y" }, "breaks": [ { … } ], "projects": [ { … } ], "closed": true, "description": "string" }
https://awesome-company.calamari.io/api/clockin/timesheetentries/v1/delete
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
'https://{tenantname}.calamari.io/api/clockin/timesheetentries/v1/delete' \
-H 'Content-Type: application/json' \
-d '{
"id": 0
}'
Request
Find timesheet entries 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 timesheet entries.
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 {contractTypes: ["Full-time"], teams: ["DevTeam"]} then timesheet entries of employees from Dev and Full-time
The query returns all matching records for the selected time range and filters, with no pagination applied.
Expect error codes:
- INVALID_DATE_FROM - when invalid time in filter provided
- INVALID_DATE_TO - when invalid time in filter provided
- INVALID_EMPLOYEE - when one of provided employees is invalid
- INVALID_TEAM - when one of provided teams is invalid
- INVALID_POSITION - when one of provided positions is invalid
- INVALID_CONTRACT_TYPE - when one of provided contract types is invalid
Start date of dates range to search timesheet entries in ISO format
End date of dates range to search timesheet entries in ISO format
List of teams names or identifiers to search. As a result there will be timesheet entries of employees who are members of at least one of provided teams. Example: ["First Team", "Second Team"]
List of positions names or identifiers to search. As a result there will be timesheet entries of employees who have one of provided positions. Example: ["Developer", "Support"]
List of contract types names or identifiers to search. As a result there will be timesheet entries of employees who have one of contract type. Example: ["Full Time"]
https://awesome-company.calamari.io/api/clockin/timesheetentries/v1/find
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
'https://{tenantname}.calamari.io/api/clockin/timesheetentries/v1/find' \
-H 'Content-Type: application/json' \
-d '{
"from": "2018-10-01",
"to": "2018-10-01",
"teams": [
"string"
],
"positions": [
"string"
],
"contractTypes": [
"string"
],
"employees": [
"string"
]
}'
successful operation
Date and time of timesheet entry finished. Has null value if employee does not clock out
Finished work timezone. Has null value if employee does not clock out
Duration of timesheet entry in seconds. Has 0 value if employee does not clock out
Employee
List of breaks
Date and time when break was finished. Has null value if break was not finished
Duration of a break in seconds. Has null value if break was not finished.
List of projects
Date and time when employee finished working on project. Has null value if work on project was not finished
Duration of time spent on a project in seconds. Has null value if work on project was not finished
[ { "id": 0, "started": "2019-08-24T14:15:22Z", "finished": "2019-08-24T14:15:22Z", "startedTimeZone": "Europe/Warsaw", "finishedTimeZone": "Europe/Warsaw", "duration": 28800, "person": { … }, "breaks": [ … ], "projects": [ … ], "closed": true, "description": "string" } ]
Request
Find employees working time balances 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 balances.
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 {contractTypes: ["Full-time"], teams: ["DevTeam"]} then you receive balances of employees from Dev and Full-time
Expect error codes:
- INVALID_DATE_FROM - when invalid time in filter provided
- INVALID_DATE_TO - when invalid time in filter provided
- INVALID_EMPLOYEE - when one of provided employees is invalid
- INVALID_TEAM - when one of provided teams is invalid
- INVALID_POSITION - when one of provided positions is invalid
- INVALID_CONTRACT_TYPE - when one of provided contract types is invalid
Start date of dates range to search request in ISO format
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"]
https://awesome-company.calamari.io/api/clockin/timesheetentries/v1/balance
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
'https://{tenantname}.calamari.io/api/clockin/timesheetentries/v1/balance' \
-H 'Content-Type: application/json' \
-d '{
"from": "2020-01-10",
"to": "2020-01-15",
"teams": [
"string"
],
"positions": [
"string"
],
"contractTypes": [
"string"
],
"employees": [
"string"
]
}'
[ { "person": { … }, "balance": -3600 } ]
https://awesome-company.calamari.io/api/clockin/timesheetentries/v1/get-projects
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
'https://{tenantname}.calamari.io/api/clockin/timesheetentries/v1/get-projects'
[ { "id": 0, "name": "Primary project" } ]
https://awesome-company.calamari.io/api/clockin/timesheetentries/v1/get-projects-for-person
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
'https://{tenantname}.calamari.io/api/clockin/timesheetentries/v1/get-projects-for-person' \
-H 'Content-Type: application/json' \
-d '{
"person": "john.white@mycompany.com"
}'
[ { "id": 0, "name": "Primary project" } ]
Request
Update employee shift.
Expect error codes:
- INVALID_EMPLOYEE - when invalid employee id provided
- INVALID_SHIFT_START - when invalid start of work time provided
- INVALID_SHIFT_END - when invalid finish of work time provided
- SHIFT_END_BEFORE_START - when end of work time is before start
- SHIFT_TO_SHORT - when shift period is shorter than one minute
- INVALID_BREAK_TYPE - when invalid break type id provided. You should use get-break-types method to find proper break type ID
- INVALID_BREAK_FOR_USER - when break type is not available for employee
- INVALID_BREAK_START - when invalid start of break time provided
- INVALID_BREAK_END - when invalid finish of break time provided
- BREAK_END_BEFORE_START - when end of break time is before start
- BREAK_IS_NOT_IN_SHIFT_RANGE - when break time range goes beyond work time range
- BREAK_TO_SHORT - when break period is shorter than one minute
- BREAKS_OVERLAP - when one break time range overlaps another
- INVALID_PROJECT_TYPE - when invalid project type id provided. You should use get-projects method to find proper project type ID
- INVALID_PROJECT_FOR_USER - when project type is not available for employee. You should use get-projects-for-person method to find proper project type ID
- INVALID_PROJECT_TIME_ENTRY_START - when invalid start of project time entry provided
- INVALID_PROJECT_TIME_ENTRY_END - when invalid finish of project time entry provided
- PROJECT_TIME_ENTRY_END_BEFORE_START - when end of project time entry is before start
- PROJECT_TIME_ENTRY_IS_NOT_IN_SHIFT_RANGE - when project time entry goes beyond work time range
- PROJECT_TIME_ENTRY_TO_SHORT - when project time entry is shorter than one minute
- PROJECT_TIME_ENTRIES_OVERLAP - when one project time entry overlaps another
- SHIFT_DESCRIPTION_TOO_LONG - when description contains more than 4096 characters
Employee identifier. You can use e-mail or external identifier in format (externalNumber:ABC123)
https://awesome-company.calamari.io/api/clockin/timesheetentries/v1/update
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
'https://{tenantname}.calamari.io/api/clockin/timesheetentries/v1/update' \
-H 'Content-Type: application/json' \
-d '{
"person": "john.white@mycompany.com",
"shiftStart": "2019-08-24T14:15:22Z",
"shiftEnd": "2019-08-24T14:15:22Z",
"breaks": [
{
"breakType": 1,
"breakStart": "2019-08-24T14:15:22Z",
"breakEnd": "2019-08-24T14:15:22Z"
}
],
"projects": [
{
"projectType": 1,
"projectStart": "2019-08-24T14:15:22Z",
"projectEnd": "2019-08-24T14:15:22Z"
}
],
"description": "string",
"id": 0
}'
successful operation
Date and time of timesheet entry finished. Has null value if employee does not clock out
Finished work timezone. Has null value if employee does not clock out
Duration of timesheet entry in seconds. Has 0 value if employee does not clock out
Employee
List of breaks
Date and time when break was finished. Has null value if break was not finished
Duration of a break in seconds. Has null value if break was not finished.
List of projects
Date and time when employee finished working on project. Has null value if work on project was not finished
Duration of time spent on a project in seconds. Has null value if work on project was not finished
{ "id": 0, "started": "2019-08-24T14:15:22Z", "finished": "2019-08-24T14:15:22Z", "startedTimeZone": "Europe/Warsaw", "finishedTimeZone": "Europe/Warsaw", "duration": 28800, "person": { "firstName": "John", "lastName": "Williams", "email": "john.williams@domain.com", "externalId": "A12Y" }, "breaks": [ { … } ], "projects": [ { … } ], "closed": true, "description": "string" }