# Find timesheet entries with advanced filtering by several parameters.

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-timeThe 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 providedINVALID_DATE_TO - when invalid time in filter providedINVALID_EMPLOYEE - when one of provided employees is invalidINVALID_TEAM - when one of provided teams is invalidINVALID_POSITION - when one of provided positions is invalidINVALID_CONTRACT_TYPE - when one of provided contract types is invalid

Endpoint: POST /clockin/timesheetentries/v1/find
Version: v1
Security: basicAuth

## Request fields (application/json):

  - `from` (string, required)
    Start date of dates range to search timesheet entries in ISO format
    Example: "2018-10-01"

  - `to` (string, required)
    End date of dates range to search timesheet entries in ISO format
    Example: "2018-10-01"

  - `teams` (array)
    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"]
    Example: ["First Team"]

  - `positions` (array)
    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"]
    Example: ["Developer"]

  - `contractTypes` (array)
    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"]
    Example: ["Full Time"]

  - `employees` (array)
    List of employees e-mails or logins. Example: ["john.white@domain.com", "mark.smith@domain.com"]
    Example: ["john.white@domain.com"]

## Response 200 fields (application/json):

  - `id` (integer, required)
    Timesheet entry ID

  - `started` (string, required)
    Date and time of timesheet entry started

  - `finished` (string)
    Date and time of timesheet entry finished. Has null value if employee does not clock out

  - `startedTimeZone` (string, required)
    Started work timzeone
    Example: "Europe/Warsaw"

  - `finishedTimeZone` (string)
    Finished work timezone. Has null value if employee does not clock out
    Example: "Europe/Warsaw"

  - `duration` (integer, required)
    Duration of timesheet entry in seconds. Has 0 value if employee does not clock out
    Example: 28800

  - `person` (object, required)
    Employee

  - `person.firstName` (string, required)
    Employee first name
    Example: "John"

  - `person.lastName` (string, required)
    Employee last name
    Example: "Williams"

  - `person.email` (string, required)
    Employee email
    Example: "john.williams@domain.com"

  - `person.externalId` (string)
    Employee external identifier
    Example: "A12Y"

  - `breaks` (array, required)
    List of breaks

  - `breaks.from` (string)
    Date and time when break was started.

  - `breaks.to` (string)
    Date and time when break was finished. Has null value if break was not finished

  - `breaks.duration` (integer)
    Duration of a break in seconds. Has null value if break was not finished.
    Example: 28800

  - `breaks.breakType` (object)
    Break type.

  - `breaks.breakType.id` (integer)
    Break id

  - `breaks.breakType.name` (string)
    Break name
    Example: "Primary break"

  - `projects` (array, required)
    List of projects

  - `projects.from` (string)
    Date and time when employee started working on project

  - `projects.to` (string)
    Date and time when employee finished working on project. Has null value if work on project was not finished

  - `projects.duration` (integer)
    Duration of time spent on a project in seconds. Has null value if work on project was not finished
    Example: 28800

  - `projects.project` (object)
    Project properties

  - `projects.project.id` (integer)
    Project id

  - `projects.project.name` (string)
    Project name
    Example: "Primary project"

  - `closed` (boolean, required)
    Is shift closed?

  - `description` (string)
    Shift description

## Response 400 fields (application/json):

  - `message` (string)
    Human readable error explanation.
    Example: "Api error"

  - `code` (string)
    Error code.
    Example: "INVALID_JSON_PAYLOAD"

  - `field` (string)
    Which field of payload object caused error. NULL when error is not related to particular field
    Example: "field"

## Response 401 fields (application/json):

  - `message` (string, required)
    Error details
    Example: "Authentication failure"

  - `code` (string, required)
    General type of error
    Example: "AUTH"

  - `field` (string)
    Leftover for backward compatibility

## Response 429 fields (application/json):

  - `code` (string, required)
    General type of error
    Example: "QUOTA_EXCEEDED"

  - `field` (string, required)
    Detailed info about quota and it's current usage
    Example: "Your current usage is 101/day, 10/hour, 1/sec\nYour current limits 100/day, 10/hour, 1/sec."

## Response 500 fields (application/json):

  - `message` (string, required)
    Error details
    Example: "An unexpected error occurred"

  - `code` (string, required)
    General type of error
    Example: "INTERNAL_SERVER_ERROR"

## Response 504 fields (application/json):

  - `message` (string, required)
    Error details
    Example: "Public API call exceeded timeout"

  - `code` (string, required)
    General type of error
    Example: "TIMEOUT"


## Response 403 fields
