Skip to content

Update historical timesheet entry.

Request

Update employee shift.

Expect error codes:

  1. INVALID_EMPLOYEE - when invalid employee id provided
  2. INVALID_SHIFT_START - when invalid start of work time provided
  3. INVALID_SHIFT_END - when invalid finish of work time provided
  4. SHIFT_END_BEFORE_START - when end of work time is before start
  5. SHIFT_TO_SHORT - when shift period is shorter than one minute
  6. INVALID_BREAK_TYPE - when invalid break type id provided. You should use get-break-types method to find proper break type ID
  7. INVALID_BREAK_FOR_USER - when break type is not available for employee
  8. INVALID_BREAK_START - when invalid start of break time provided
  9. INVALID_BREAK_END - when invalid finish of break time provided
  10. BREAK_END_BEFORE_START - when end of break time is before start
  11. BREAK_IS_NOT_IN_SHIFT_RANGE - when break time range goes beyond work time range
  12. BREAK_TO_SHORT - when break period is shorter than one minute
  13. BREAKS_OVERLAP - when one break time range overlaps another
  14. INVALID_PROJECT_TYPE - when invalid project type id provided. You should use get-projects method to find proper project type ID
  15. 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
  16. INVALID_PROJECT_TIME_ENTRY_START - when invalid start of project time entry provided
  17. INVALID_PROJECT_TIME_ENTRY_END - when invalid finish of project time entry provided
  18. PROJECT_TIME_ENTRY_END_BEFORE_START - when end of project time entry is before start
  19. PROJECT_TIME_ENTRY_IS_NOT_IN_SHIFT_RANGE - when project time entry goes beyond work time range
  20. PROJECT_TIME_ENTRY_TO_SHORT - when project time entry is shorter than one minute
  21. PROJECT_TIME_ENTRIES_OVERLAP - when one project time entry overlaps another
  22. SHIFT_DESCRIPTION_TOO_LONG - when description contains more than 4096 characters
  23. SHIFT_DESCRIPTION_NOT_ALLOWED_FORMATTING - when description contains more not allowed HTML or Markdown formatting

Security
basicAuth
Bodyapplication/json
personstringrequired

Employee identifier. You can use e-mail or external identifier in format (externalNumber:ABC123)

Example:"john.white@mycompany.com"
shiftStartstring, (date-time)required

Date and time of shift start in ISO format

shiftEndstring, (date-time)required

Date and time of shift end in ISO format

breaksArray of objects(BreakDtoIn)

List of breaks.

projectsArray of objects(ProjectDtoIn)

List of projects.

descriptionstring, [ 0 .. 4096 ] characters

Shift description

idinteger, (int64)required
curl -i -X POST \
  -u '<username>:<password>' \
  https://awesome-company.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
  }'

Responses

successful operation

Bodyapplication/json
idinteger, (int64)required

Timesheet entry ID

startedstring, (date-time)required

Date and time of timesheet entry started

finishedstring, (date-time)

Date and time of timesheet entry finished. Has null value if employee does not clock out

startedTimeZonestringrequired

Started work timzeone

Example:"Europe/Warsaw"
finishedTimeZonestring

Finished work timezone. Has null value if employee does not clock out

Example:"Europe/Warsaw"
durationinteger, (int64)required

Duration of timesheet entry in seconds. Has 0 value if employee does not clock out

Example:28800
personobject(EmployeeSimpleOut)required

Employee

breaksArray of objects(BreakDto)required

List of breaks

projectsArray of objects(ProjectDto)required

List of projects

closedbooleanrequired

Is shift closed?

descriptionstring

Shift description

Response
{ "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" }