Get a timesheet entry's rate breakdown
Returns the pay rate, service rate, and allowance breakdown for a single timesheet entry.
GET
/
api
/
external
/
timesheets
/
{id}
/
rates
Get a timesheet entry's rate breakdown
curl --request GET \
--url https://gateway-api.guardhousehq.com/api/external/timesheets/{id}/rates \
--header 'Authorization: Bearer <token>' \
--header 'external-gh-apim-sub-key: <api-key>'import requests
url = "https://gateway-api.guardhousehq.com/api/external/timesheets/{id}/rates"
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}/rates', 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}/rates",
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}/rates"
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}/rates")
.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}/rates")
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": {
"scheduledStartTime": "2023-11-07T05:31:56Z",
"scheduledEndTime": "2023-11-07T05:31:56Z",
"payRate": {},
"serviceRate": {},
"allowances": [
{}
]
},
"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
Rate detail
The standard envelope for every JSON endpoint.
⌘I
Get a timesheet entry's rate breakdown
curl --request GET \
--url https://gateway-api.guardhousehq.com/api/external/timesheets/{id}/rates \
--header 'Authorization: Bearer <token>' \
--header 'external-gh-apim-sub-key: <api-key>'import requests
url = "https://gateway-api.guardhousehq.com/api/external/timesheets/{id}/rates"
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}/rates', 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}/rates",
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}/rates"
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}/rates")
.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}/rates")
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": {
"scheduledStartTime": "2023-11-07T05:31:56Z",
"scheduledEndTime": "2023-11-07T05:31:56Z",
"payRate": {},
"serviceRate": {},
"allowances": [
{}
]
},
"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>"
}
]
}