Skip to content

Find employees working time balances with advanced filtering by several parameters.

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:

  1. INVALID_DATE_FROM - when invalid time in filter provided
  2. INVALID_DATE_TO - when invalid time in filter provided
  3. INVALID_EMPLOYEE - when one of provided employees is invalid
  4. INVALID_TEAM - when one of provided teams is invalid
  5. INVALID_POSITION - when one of provided positions is invalid
  6. INVALID_CONTRACT_TYPE - when one of provided contract types is invalid

Security
basicAuth
Bodyapplication/json
fromstring, (date)required

Start date of dates range to search request in ISO format

Example:"2020-01-10"
tostring, (date)required

End date of dates range to search request in ISO format

Example:"2020-01-15"
teamsArray of strings

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"]

Example:
[ "First Team" ]
positionsArray of strings

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"]

Example:
[ "Developer" ]
contractTypesArray of strings

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"]

Example:
[ "Employment Contract" ]
employeesArray of strings

List of employees e-mails or logins. Example: ["john.smith@domain.com", "mark.small@domain.com"]

Example:
[ "john.smith@domain.com" ]
curl -i -X POST \
  -u '<username>:<password>' \
  https://awesome-company.calamari.io/api/clockin/timesheetentries/v1/balance \
  -H 'Content-Type: application/json' \
  -d '{
    "from": "2020-01-10",
    "to": "2020-01-15",
    "teams": [
      "First Team"
    ],
    "positions": [
      "Developer"
    ],
    "contractTypes": [
      "Employment Contract"
    ],
    "employees": [
      "john.smith@domain.com"
    ]
  }'

Responses

successful operation

Bodyapplication/json
Array [
personobject(EmployeeSimpleOut)required

Employee

balanceinteger, (int64)required

Working time balance in seconds

Example:-3600
]
Response
[ { "person": { … }, "balance": -3600 } ]