Get a timesheet entry
Returns the full detail for a single timesheet entry by ID. The entry must belong to your API key’s company, customers, and sites. Requires an API key with KeyType=timesheet.
curl --request GET \
--url https://gateway-api.guardhousehq.com/api/external/timesheets/{id} \
--header 'Authorization: Bearer <token>' \
--header 'external-gh-apim-sub-key: <api-key>'import requests
url = "https://gateway-api.guardhousehq.com/api/external/timesheets/{id}"
headers = {
"Authorization": "Bearer <token>",
"external-gh-apim-sub-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'external-gh-apim-sub-key': '<api-key>'}
};
fetch('https://gateway-api.guardhousehq.com/api/external/timesheets/{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://gateway-api.guardhousehq.com/api/external/timesheets/{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>",
"external-gh-apim-sub-key: <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://gateway-api.guardhousehq.com/api/external/timesheets/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("external-gh-apim-sub-key", "<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://gateway-api.guardhousehq.com/api/external/timesheets/{id}")
.header("Authorization", "Bearer <token>")
.header("external-gh-apim-sub-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api.guardhousehq.com/api/external/timesheets/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["external-gh-apim-sub-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": {
"timesheetId": 123,
"customerName": "<string>",
"customerApiId": 123,
"siteName": "<string>",
"siteApiId": 123,
"staffId": "<string>",
"staffName": "<string>",
"employeeId": "<string>",
"employeeReferenceNumber": "<string>",
"email": "jsmith@example.com",
"mobile": "<string>",
"subcontractorCompany": "<string>",
"entryType": "<string>",
"position": "<string>",
"service": "<string>",
"paygroup": "<string>",
"scheduledStartTime": "2023-11-07T05:31:56Z",
"scheduledEndTime": "2023-11-07T05:31:56Z",
"timeclockStartTime": "2023-11-07T05:31:56Z",
"clockInCoordinates": {},
"timeclockBreakStartTime": "2023-11-07T05:31:56Z",
"timeclockBreakEndTime": "2023-11-07T05:31:56Z",
"timeclockEndTime": "2023-11-07T05:31:56Z",
"clockOutCoordinates": {},
"staffSubmittedTimesheetTimes": [
{}
],
"payStartTime": "2023-11-07T05:31:56Z",
"payEndTime": "2023-11-07T05:31:56Z",
"payBreakTime": 123,
"invoiceStartTime": "2023-11-07T05:31:56Z",
"invoiceEndTime": "2023-11-07T05:31:56Z",
"invoiceBreakTime": 123,
"notes": [
{}
],
"allowances": [
{}
],
"approvedBy": "<string>",
"approvedDateTime": "2023-11-07T05:31:56Z",
"customerApprovalStatus": "<string>",
"customerApprover": "<string>",
"customerApprovedDateTime": "2023-11-07T05:31:56Z",
"lock": true,
"scheduleNotes": {}
},
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}Authorizations
JWT issued by POST /api/external/token/request. Send as Authorization: Bearer <token>.
Guardhouse API Management subscription key. Required on every request. The same value is used by all API consumers within a region — contact Guardhouse Support for the subscription key.
Path Parameters
Timesheet entry ID.
Response
Timesheet entry detail
The standard envelope for every JSON endpoint.
Show child attributes
Show child attributes
Public-facing view of a timesheet entry. Nested arrays (allowances, notes, staffSubmittedTimesheetTimes, scheduleNotes) carry detail objects whose schema is best inspected from a sample response — they're typed as generic objects here.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
curl --request GET \
--url https://gateway-api.guardhousehq.com/api/external/timesheets/{id} \
--header 'Authorization: Bearer <token>' \
--header 'external-gh-apim-sub-key: <api-key>'import requests
url = "https://gateway-api.guardhousehq.com/api/external/timesheets/{id}"
headers = {
"Authorization": "Bearer <token>",
"external-gh-apim-sub-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'external-gh-apim-sub-key': '<api-key>'}
};
fetch('https://gateway-api.guardhousehq.com/api/external/timesheets/{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://gateway-api.guardhousehq.com/api/external/timesheets/{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>",
"external-gh-apim-sub-key: <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://gateway-api.guardhousehq.com/api/external/timesheets/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("external-gh-apim-sub-key", "<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://gateway-api.guardhousehq.com/api/external/timesheets/{id}")
.header("Authorization", "Bearer <token>")
.header("external-gh-apim-sub-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api.guardhousehq.com/api/external/timesheets/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["external-gh-apim-sub-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": {
"timesheetId": 123,
"customerName": "<string>",
"customerApiId": 123,
"siteName": "<string>",
"siteApiId": 123,
"staffId": "<string>",
"staffName": "<string>",
"employeeId": "<string>",
"employeeReferenceNumber": "<string>",
"email": "jsmith@example.com",
"mobile": "<string>",
"subcontractorCompany": "<string>",
"entryType": "<string>",
"position": "<string>",
"service": "<string>",
"paygroup": "<string>",
"scheduledStartTime": "2023-11-07T05:31:56Z",
"scheduledEndTime": "2023-11-07T05:31:56Z",
"timeclockStartTime": "2023-11-07T05:31:56Z",
"clockInCoordinates": {},
"timeclockBreakStartTime": "2023-11-07T05:31:56Z",
"timeclockBreakEndTime": "2023-11-07T05:31:56Z",
"timeclockEndTime": "2023-11-07T05:31:56Z",
"clockOutCoordinates": {},
"staffSubmittedTimesheetTimes": [
{}
],
"payStartTime": "2023-11-07T05:31:56Z",
"payEndTime": "2023-11-07T05:31:56Z",
"payBreakTime": 123,
"invoiceStartTime": "2023-11-07T05:31:56Z",
"invoiceEndTime": "2023-11-07T05:31:56Z",
"invoiceBreakTime": 123,
"notes": [
{}
],
"allowances": [
{}
],
"approvedBy": "<string>",
"approvedDateTime": "2023-11-07T05:31:56Z",
"customerApprovalStatus": "<string>",
"customerApprover": "<string>",
"customerApprovedDateTime": "2023-11-07T05:31:56Z",
"lock": true,
"scheduleNotes": {}
},
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}{
"status": {
"code": 123,
"errorMessage": "<string>"
},
"data": "<unknown>",
"count": 123,
"message": "<string>",
"errors": [
{
"code": 100,
"message": "<string>"
}
]
}