v4

latestOpenAPI 3.0.12026-07-3189233676.2 KB
Shifts

List all shifts

The endpoint returns ongoing and completed work shifts. It includes time entries (clock in/clock out), the type of work, and earnings.

get/v1/links/{link_id}/shifts/

Query parameters

start_date_fromstring
Example:2022-06-01T00:00:00.000Z

Filter start_date greater than or equal (ISO-8601)

start_date_tostring
Example:2022-06-01T00:00:00.000Z

Filter start_date less than or equal (ISO-8601)

pageinteger

Page number from the shift list

page_sizeinteger

Number of results to return per page.

Response

countinteger required

Number of the results in total

nextstring nullable required

Link to the next page

previousstring nullable required

Link to the previous page

Example response

{
  "count": 100,
  "next": "https://prod.truv.com/v1/link/0000000000/shifts?page=1",
  "previous": "https://prod.truv.com/v1/link/0000000000/shifts?page=1",
  "results": [
    {
      "id": "48427a36d43c4d5aa6324bc06c692456",
      "external_id": "48427a36d43c4d5aa6324bc06c692456",
      "created_at": "2022-06-07T15:00:00Z",
      "updated_at": "2022-06-07T15:00:00Z",
      "start_date": "2022-06-07",
      "end_date": "2022-06-07",
      "time_entries": [
        {
          "id": "48427a36d43c4d5aa6324bc06c692456",
          "external_id": "48427a36d43c4d5aa6324bc06c692456",
          "created_at": "2022-06-07T15:00:00Z",
          "updated_at": "2022-06-07T15:00:00Z",
          "entry_date": "2022-06-07",
          "start": "2022-06-07T15:00:00Z",
          "end": "2022-06-07T16:00:00Z"
        }
      ],
      "earnings": [
        {
          "name": "Regular",
          "amount": "1935.77",
          "category": "regular",
          "rate": null,
          "units": null
        },
        {
          "name": "Overtime",
          "amount": "60.58",
          "category": "overtime",
          "rate": "30.29",
          "units": "2"
        }
      ],
      "type": "shift"
    }
  ]
}