Timesheet Management Calls

You can create and update one or more timesheet records using Timesheet Management calls. You can also use the Timesheet resource API to fetch details for one or more employees.

Endpoints

MethodEndpointSummaryEnterprise/Premium
POST/api/v1/supervise/timesheet/startStart an employee's timesheetBoth
POST/api/v1/supervise/timesheet/endEnd an employee's timesheetBoth
POST/api/v1/supervise/timesheet/pauseStart or end an employee's breakBoth
POST/api/v1/supervise/timesheet/approveApprove an existing timesheetBoth
POST/api/v1/supervise/timesheet/discardDiscard an existing timesheetBoth
POST/api/v1/supervise/timesheet/updateUpdate an existing timesheetBoth
GET/api/v1/supervise/timesheet/{id}/detailsView an employee's timesheet detailsBoth

Fields

Body parametersDescriptionDataTypeMandatory
intTimesheetIdUnique internal identifier of the TimesheetIntegerYes
intEmployeeIdUnique internal identifier of the EmployeeIntegerYes
IntOpunitIdUnique internal identifier of the DepartmentsIntegerTYes
intStartTimestampUnix timestamp for the start of the TimesheetIntegerYes
intEndTimestampUnix timestamp for the end of the timesheetIntegerYes
intRosterIdUnique internal identifier of the RosterIntegerNo
strCommentComments attached to the timesheetStringNo
strDateDate to associate to the Timesheet (instead of providing Unix timestamps)DateNo
intStartTimeHourStart Hour (instead of providing unix timestamps)IntegerNo
intStartTimeMinuteStart Minute (instead of providing unix timestamps)IntegerNo
intEndTimeHourEnd Hour (instead of providing unix timestamps)IntegerNo
intEndTimeMinuteEnd minute (instead of providing unix timestamps)IntegerNo
intMealbreakMinuteTotal number of minutes as an undefined mealbreakIntegerNo
arrSlotsArray of specifically defined mealbreaksStringNo
blnIsInprogressValue that represents if the timesheet is currently in progressBooleanNo
blnApproveTimesheetValue that represents if timesheet should be set as approvedBooleanNo

Start an employee's timesheet

URL

curl --location -g --request POST 'https://{install}.{geo}.au.deputy.com/api/v1/supervise/timesheet/start'

Sample payload

{
  intEmployeeId: 3,
  intMealbreakMinute: 30
}

End an employee's timesheet

URL

curl --location -g --request POST 'https://{install}.{geo}.au.deputy.com/api/v1/supervise/timesheet/end'

The below example is used when attempting to conclude an employee's timesheet and allocate a 30-minute undefined mealbreak.

Sample payload

{
intTimesheetId: 3,
intMealbreakMinute: 30
}

Update or Create a given employee's timesheet

This call allows you to create a new Timesheet Record in Deputy using unix timestamps, defined mealbreak slots and associate it to an employee.

URL

curl --location -g --request POST 'https://{install}.{geo}.au.deputy.com/api/v1/supervise/timesheet/update'

Sample payload

{
    intEmployeeId: 1,
    intOpunitId: 2,
    intStartTimestamp: 1616360400,
    intEndTimestamp: 1616382000,
    arrSlots: [{
        "blnEmptySlot": false,
        "strType": "B",
        "intStart": 7200,
        "intEnd": 9000,
        "intUnixStart": 1616367600,
        "intUnixEnd": 1616369400,
        "mixedActivity": {
            "intState": 2,
            "blnCanStartEarly": 1,
            "blnCanEndEarly": 1,
            "blnIsMandatory": 1,
            "strBreakType": "M"
        },
        "strTypeName": "Meal Break",
        "strState": "Finished"
    }, {
        "blnEmptySlot": false,
        "strType": "B",
        "intStart": 14400,
        "intEnd": 15300,
        "intUnixStart": 1616374800,
        "intUnixEnd": 1616375700,
        "mixedActivity": {
            "intState": 2,
            "blnCanStartEarly": 1,
            "blnCanEndEarly": 1,
            "blnIsMandatory": 1,
            "strBreakType": "R"
        },
        "strTypeName": "Rest Break",
        "strState": "Finished"
    }]
}

The below sample is an example of updating an existing timesheet record in Deputy

{
    intTimesheetId: 1,
    intStartTimestamp: 1616360400,
    intEndTimestamp: 1616382000,
    intOpunitId: 2,
    strComment: "This timesheet was recently updated via the API"
}

Pause, Approve or Discard a given employee's timesheet

The following examples show how to start/end an employee's break, approve or discard an associated timesheet.

URLS

Pause

curl --location -g --request POST 'https://{install}.{geo}.au.deputy.com/api/v1/supervise/timesheet/pause'

Approve

curl --location -g --request POST 'https://{install}.{geo}.au.deputy.com/api/v1/supervise/timesheet/approve'

Discard

curl --location -g --request POST 'https://{install}.{geo}.au.deputy.com/api/v1/supervise/timesheet/discard'

Sample payload

{
    intTimesheetId: 12
}

Status Responses

CodeStatusDescription
200OKThe request was successfully completed and the JSON response contains the timesheet object
400Bad Request$ExceptionMessage
400Bad RequestUnable to update your shift
400Bad RequestInvalid Photo does not exist
400Bad RequestInvalid LoginEmp is not active
400Bad RequestINVALID ActionString is given
400Bad RequestEndTime cannot be in the future
400Bad RequestSorry, you cannot submit a future timesheet
400Bad RequestSorry, the submitted timesheet does not exist
400Bad RequestSorry, you must set the area for the timesheet
400Bad RequestTimesheet start time must not be in the future
400Bad RequestINVALID given employee is not your subordinate
400Bad RequestINVALID timesheet not found or cannot be modified
400Bad RequestYou are not allowed to clock in/out on this device
400Bad RequestSorry, this action was not possible to be completed
400Bad RequestSorry, you can not start another break when there is a break in place
400Bad RequestReferenced roster does not exist or assigned employee has been changed
400Bad RequestSorry, the selected area is not legal for submitting timesheet. Please contact your supervisor.
401UnauthorizedYou are not allowed to edit this timesheet
409ConflictYou already have another timesheet in progress
412Precondition FailedYou are not allowed to edit this timesheet
412Precondition FailedTimesheet has been discarded by the supervisor
412Precondition FailedYour timesheet is no longer in progress so cannot be submitted
412Precondition FailedCannot pause timesheet as you do not have an in-progress timesheet
500Internal Server ErrorUnknown Error. Please contact support for assistance.