Update the JobSummary for a Job
curl --request PATCH \
--url https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"adjusted_logging_started_at": "2023-11-07T05:31:56Z",
"adjusted_logging_ended_at": "2023-11-07T05:31:56Z",
"approved_work_time_minutes": 123
}
'import requests
url = "https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary"
payload = {
"adjusted_logging_started_at": "2023-11-07T05:31:56Z",
"adjusted_logging_ended_at": "2023-11-07T05:31:56Z",
"approved_work_time_minutes": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
adjusted_logging_started_at: '2023-11-07T05:31:56Z',
adjusted_logging_ended_at: '2023-11-07T05:31:56Z',
approved_work_time_minutes: 123
})
};
fetch('https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary', 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.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'adjusted_logging_started_at' => '2023-11-07T05:31:56Z',
'adjusted_logging_ended_at' => '2023-11-07T05:31:56Z',
'approved_work_time_minutes' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary"
payload := strings.NewReader("{\n \"adjusted_logging_started_at\": \"2023-11-07T05:31:56Z\",\n \"adjusted_logging_ended_at\": \"2023-11-07T05:31:56Z\",\n \"approved_work_time_minutes\": 123\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"adjusted_logging_started_at\": \"2023-11-07T05:31:56Z\",\n \"adjusted_logging_ended_at\": \"2023-11-07T05:31:56Z\",\n \"approved_work_time_minutes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"adjusted_logging_started_at\": \"2023-11-07T05:31:56Z\",\n \"adjusted_logging_ended_at\": \"2023-11-07T05:31:56Z\",\n \"approved_work_time_minutes\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"has_gps_data": true,
"logging_started_at": "2023-11-07T05:31:56Z",
"logging_ended_at": "2023-11-07T05:31:56Z",
"completed_loads_count": 1,
"break_time_minutes": 1,
"work_time_minutes": 1,
"approved_work_time_minutes": 123,
"first_geofence_entry_at": "2023-11-07T05:31:56Z",
"last_geofence_exit_at": "2023-11-07T05:31:56Z",
"job_phase_name": "<string>",
"job_phase_code": "<string>",
"foreman_external_id": "<string>",
"delivered_quantities": [
{
"delivered": "<string>",
"unit_of_measure": "Load",
"material_name": "<string>",
"total": "<string>",
"ticketed": true
}
],
"adjusted_logging_started_at": "2023-11-07T05:31:56Z",
"adjusted_logging_ended_at": "2023-11-07T05:31:56Z",
"editable": true,
"loads_with_tickets_count": 123,
"pre_clamp_logging_ended_at": "2023-11-07T05:31:56Z",
"travelled_distance_meters": "<string>",
"first_sent_at": "2023-11-07T05:31:56Z",
"sent_to_driver_at": "2023-11-07T05:31:56Z",
"driver_accepted_at": "2023-11-07T05:31:56Z",
"driver_declined_at": "2023-11-07T05:31:56Z",
"first_accepted_at": "2023-11-07T05:31:56Z",
"first_declined_at": "2023-11-07T05:31:56Z",
"first_canceled_at": "2023-11-07T05:31:56Z",
"pickup_geofence_entry_count": 1,
"dropoff_geofence_entry_count": 1,
"gps_active_period_minutes": 1,
"gps_total_pings": 1,
"gps_offline_pings": 1,
"gps_expected_pings": 1
}
}{
"error": {
"code": "<string>",
"error_type": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
{
"model": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}
}JobSummaries
Update the JobSummary for a Job
Update the JobSummary for a Job.
This endpoint requires the edit_job_summary IamPermission.
PATCH
/
v1
/
companies
/
{company-id}
/
jobs
/
{job-id}
/
summary
Update the JobSummary for a Job
curl --request PATCH \
--url https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"adjusted_logging_started_at": "2023-11-07T05:31:56Z",
"adjusted_logging_ended_at": "2023-11-07T05:31:56Z",
"approved_work_time_minutes": 123
}
'import requests
url = "https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary"
payload = {
"adjusted_logging_started_at": "2023-11-07T05:31:56Z",
"adjusted_logging_ended_at": "2023-11-07T05:31:56Z",
"approved_work_time_minutes": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
adjusted_logging_started_at: '2023-11-07T05:31:56Z',
adjusted_logging_ended_at: '2023-11-07T05:31:56Z',
approved_work_time_minutes: 123
})
};
fetch('https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary', 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.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'adjusted_logging_started_at' => '2023-11-07T05:31:56Z',
'adjusted_logging_ended_at' => '2023-11-07T05:31:56Z',
'approved_work_time_minutes' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary"
payload := strings.NewReader("{\n \"adjusted_logging_started_at\": \"2023-11-07T05:31:56Z\",\n \"adjusted_logging_ended_at\": \"2023-11-07T05:31:56Z\",\n \"approved_work_time_minutes\": 123\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"adjusted_logging_started_at\": \"2023-11-07T05:31:56Z\",\n \"adjusted_logging_ended_at\": \"2023-11-07T05:31:56Z\",\n \"approved_work_time_minutes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/companies/{company-id}/jobs/{job-id}/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"adjusted_logging_started_at\": \"2023-11-07T05:31:56Z\",\n \"adjusted_logging_ended_at\": \"2023-11-07T05:31:56Z\",\n \"approved_work_time_minutes\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"has_gps_data": true,
"logging_started_at": "2023-11-07T05:31:56Z",
"logging_ended_at": "2023-11-07T05:31:56Z",
"completed_loads_count": 1,
"break_time_minutes": 1,
"work_time_minutes": 1,
"approved_work_time_minutes": 123,
"first_geofence_entry_at": "2023-11-07T05:31:56Z",
"last_geofence_exit_at": "2023-11-07T05:31:56Z",
"job_phase_name": "<string>",
"job_phase_code": "<string>",
"foreman_external_id": "<string>",
"delivered_quantities": [
{
"delivered": "<string>",
"unit_of_measure": "Load",
"material_name": "<string>",
"total": "<string>",
"ticketed": true
}
],
"adjusted_logging_started_at": "2023-11-07T05:31:56Z",
"adjusted_logging_ended_at": "2023-11-07T05:31:56Z",
"editable": true,
"loads_with_tickets_count": 123,
"pre_clamp_logging_ended_at": "2023-11-07T05:31:56Z",
"travelled_distance_meters": "<string>",
"first_sent_at": "2023-11-07T05:31:56Z",
"sent_to_driver_at": "2023-11-07T05:31:56Z",
"driver_accepted_at": "2023-11-07T05:31:56Z",
"driver_declined_at": "2023-11-07T05:31:56Z",
"first_accepted_at": "2023-11-07T05:31:56Z",
"first_declined_at": "2023-11-07T05:31:56Z",
"first_canceled_at": "2023-11-07T05:31:56Z",
"pickup_geofence_entry_count": 1,
"dropoff_geofence_entry_count": 1,
"gps_active_period_minutes": 1,
"gps_total_pings": 1,
"gps_offline_pings": 1,
"gps_expected_pings": 1
}
}{
"error": {
"code": "<string>",
"error_type": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
{
"model": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The Accept-Language request HTTP header indicates the natural language and locale that the client prefers.
Example:
"en"
Body
application/json
Response
OK
Show child attributes
Show child attributes
⌘I