Get Shift
curl --request GET \
--url https://api.conduit.ai/v1/shifts/{shift_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.conduit.ai/v1/shifts/{shift_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.conduit.ai/v1/shifts/{shift_id}', 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://api.conduit.ai/v1/shifts/{shift_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.conduit.ai/v1/shifts/{shift_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.conduit.ai/v1/shifts/{shift_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.conduit.ai/v1/shifts/{shift_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"worker": {
"member_id": "<string>",
"name": "<string>"
},
"status": "open",
"timezone": "<string>",
"clock_in_at": "<string>",
"clock_out_at": "<string>",
"breaks": [
{
"start_at": "<string>",
"end_at": "<string>",
"duration_secs": 123
}
],
"duration_secs": 123,
"break_secs": 123,
"working_secs": 123,
"created_at": "<string>",
"updated_at": "<string>",
"first_recorded_location": {
"latitude": 123,
"longitude": 123,
"accuracy_m": 123,
"battery_percent": 123,
"recorded_at": "<string>"
},
"last_recorded_location": {
"latitude": 123,
"longitude": 123,
"accuracy_m": 123,
"battery_percent": 123,
"recorded_at": "<string>"
},
"allocation_basis": "recorded_task_assignments",
"overlap_secs": 123,
"unallocated_secs": 123,
"task_events": [
{
"at": "<string>",
"kind": "started",
"task_id": "<string>",
"task_title": "<string>",
"listing_id": "<string>",
"status": {
"id": "<string>",
"name": "<string>",
"category": "upcoming"
}
}
],
"allocations": [
{
"task_id": "<string>",
"listing_id": "<string>",
"listing_ref": "<string>",
"start_at": "<string>",
"end_at": "<string>",
"duration_secs": 123
}
],
"stops": [
{
"number": 123,
"arrived_at": "<string>",
"left_at": "<string>",
"duration_secs": 123,
"latitude": 123,
"longitude": 123,
"gaps": [
{
"start_at": "<string>",
"end_at": "<string>"
}
],
"listing": {
"listing_id": "<string>",
"name": "<string>",
"address": "<string>"
}
}
]
}
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}Shifts
Get shift
Read a shift’s times, breaks, task work, and recorded locations.
GET
/
v1
/
shifts
/
{shift_id}
Get Shift
curl --request GET \
--url https://api.conduit.ai/v1/shifts/{shift_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.conduit.ai/v1/shifts/{shift_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.conduit.ai/v1/shifts/{shift_id}', 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://api.conduit.ai/v1/shifts/{shift_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.conduit.ai/v1/shifts/{shift_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.conduit.ai/v1/shifts/{shift_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.conduit.ai/v1/shifts/{shift_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"worker": {
"member_id": "<string>",
"name": "<string>"
},
"status": "open",
"timezone": "<string>",
"clock_in_at": "<string>",
"clock_out_at": "<string>",
"breaks": [
{
"start_at": "<string>",
"end_at": "<string>",
"duration_secs": 123
}
],
"duration_secs": 123,
"break_secs": 123,
"working_secs": 123,
"created_at": "<string>",
"updated_at": "<string>",
"first_recorded_location": {
"latitude": 123,
"longitude": 123,
"accuracy_m": 123,
"battery_percent": 123,
"recorded_at": "<string>"
},
"last_recorded_location": {
"latitude": 123,
"longitude": 123,
"accuracy_m": 123,
"battery_percent": 123,
"recorded_at": "<string>"
},
"allocation_basis": "recorded_task_assignments",
"overlap_secs": 123,
"unallocated_secs": 123,
"task_events": [
{
"at": "<string>",
"kind": "started",
"task_id": "<string>",
"task_title": "<string>",
"listing_id": "<string>",
"status": {
"id": "<string>",
"name": "<string>",
"category": "upcoming"
}
}
],
"allocations": [
{
"task_id": "<string>",
"listing_id": "<string>",
"listing_ref": "<string>",
"start_at": "<string>",
"end_at": "<string>",
"duration_secs": 123
}
],
"stops": [
{
"number": 123,
"arrived_at": "<string>",
"left_at": "<string>",
"duration_secs": 123,
"latitude": 123,
"longitude": 123,
"gaps": [
{
"start_at": "<string>",
"end_at": "<string>"
}
],
"listing": {
"listing_id": "<string>",
"name": "<string>",
"address": "<string>"
}
}
]
}
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}Task work
Task time uses the worker assigned while a task was In progress. Offline actions use the time they happened.| Field | Meaning |
|---|---|
task_events | Recorded task work starts and stops. |
allocations | Working time attributed to each task and property. |
overlap_secs | Working time when multiple tasks were active. |
unallocated_secs | Working time with no recorded task work. |
overlap_secs, and unallocated_secs add up to working_secs.
An allocation’s start and end can span excluded time. Use its duration_secs for the allocated total.
Older shifts may have no recorded task assignments. That time is unallocated.
listing_ref is the Conduit property ID. listing_id is the PMS ID and may repeat across PMS accounts.
Locations and stops
first_recorded_location and last_recorded_location are the earliest and latest GPS samples during working time. They may be null. Their timestamps may differ from clock-in and clock-out.
Stops are recorded stays of at least 90 seconds. A nearby property is matched within 50 meters. gaps marks missing GPS coverage, which is excluded from stop duration. GPS does not determine working time.
Using shift history
Names and labels reflect current data. Save approved payroll exports in your payroll system. Very large histories return an error instead of partial task allocations.Authorizations
Was this page helpful?