List all shifts
curl --request GET \
--url https://prod.truv.com/v1/links/{link_id}/shifts/ \
--header 'X-Access-Client-Id: <api-key>' \
--header 'X-Access-Secret: <api-key>'import requests
url = "https://prod.truv.com/v1/links/{link_id}/shifts/"
headers = {
"X-Access-Client-Id": "<api-key>",
"X-Access-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Access-Client-Id': '<api-key>', 'X-Access-Secret': '<api-key>'}
};
fetch('https://prod.truv.com/v1/links/{link_id}/shifts/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod.truv.com/v1/links/{link_id}/shifts/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Access-Client-Id: <api-key>",
"X-Access-Secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://prod.truv.com/v1/links/{link_id}/shifts/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Access-Client-Id", "<api-key>")
req.Header.Add("X-Access-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://prod.truv.com/v1/links/{link_id}/shifts/")
.header("X-Access-Client-Id", "<api-key>")
.header("X-Access-Secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.truv.com/v1/links/{link_id}/shifts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Access-Client-Id"] = '<api-key>'
request["X-Access-Secret"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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": [
{
"external_id": "48427a36d43c4d5aa6324bc06c692456",
"start_date": "2022-06-07",
"end_date": "2022-06-07",
"time_entries": [
{
"external_id": "48427a36d43c4d5aa6324bc06c692456",
"entry_date": "2022-06-07",
"start": "2022-06-07T15:00:00Z",
"end": "2022-06-07T16:00:00Z",
"id": "48427a36d43c4d5aa6324bc06c692456",
"created_at": "2022-06-07T15:00:00Z",
"updated_at": "2022-06-07T15:00:00Z"
}
],
"type": "shift",
"id": "48427a36d43c4d5aa6324bc06c692456",
"created_at": "2022-06-07T15:00:00Z",
"updated_at": "2022-06-07T15: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"
}
]
}
]
}{
"error": {
"code": "authentication_failed",
"message": "No such token"
}
}{
"error": {
"code": "not_authenticated",
"message": "Authentication credentials were not provided."
}
}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
/
List all shifts
curl --request GET \
--url https://prod.truv.com/v1/links/{link_id}/shifts/ \
--header 'X-Access-Client-Id: <api-key>' \
--header 'X-Access-Secret: <api-key>'import requests
url = "https://prod.truv.com/v1/links/{link_id}/shifts/"
headers = {
"X-Access-Client-Id": "<api-key>",
"X-Access-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Access-Client-Id': '<api-key>', 'X-Access-Secret': '<api-key>'}
};
fetch('https://prod.truv.com/v1/links/{link_id}/shifts/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod.truv.com/v1/links/{link_id}/shifts/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Access-Client-Id: <api-key>",
"X-Access-Secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://prod.truv.com/v1/links/{link_id}/shifts/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Access-Client-Id", "<api-key>")
req.Header.Add("X-Access-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://prod.truv.com/v1/links/{link_id}/shifts/")
.header("X-Access-Client-Id", "<api-key>")
.header("X-Access-Secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.truv.com/v1/links/{link_id}/shifts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Access-Client-Id"] = '<api-key>'
request["X-Access-Secret"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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": [
{
"external_id": "48427a36d43c4d5aa6324bc06c692456",
"start_date": "2022-06-07",
"end_date": "2022-06-07",
"time_entries": [
{
"external_id": "48427a36d43c4d5aa6324bc06c692456",
"entry_date": "2022-06-07",
"start": "2022-06-07T15:00:00Z",
"end": "2022-06-07T16:00:00Z",
"id": "48427a36d43c4d5aa6324bc06c692456",
"created_at": "2022-06-07T15:00:00Z",
"updated_at": "2022-06-07T15:00:00Z"
}
],
"type": "shift",
"id": "48427a36d43c4d5aa6324bc06c692456",
"created_at": "2022-06-07T15:00:00Z",
"updated_at": "2022-06-07T15: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"
}
]
}
]
}{
"error": {
"code": "authentication_failed",
"message": "No such token"
}
}{
"error": {
"code": "not_authenticated",
"message": "Authentication credentials were not provided."
}
}Authorizations
Client ID
Client Access Key
Path Parameters
Link ID
Query Parameters
Filter start_date greater than or equal (ISO-8601)
Example:
"2022-06-01T00:00:00.000Z"
Filter start_date less than or equal (ISO-8601)
Example:
"2022-06-01T00:00:00.000Z"
Page number from the shift list
Number of results to return per page.
Response
Shift List
Number of the results in total
Example:
100
Link to the next page
Example:
"https://prod.truv.com/v1/link/0000000000/shifts?page=1"
Link to the previous page
Example:
"https://prod.truv.com/v1/link/0000000000/shifts?page=1"
List of the Shifts
Show child attributes
Show child attributes
Was this page helpful?
⌘I