Retrieve a shift
curl --request GET \
--url https://api-sandbox.argyle.com/v2/shifts/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api-sandbox.argyle.com/v2/shifts/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api-sandbox.argyle.com/v2/shifts/{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-sandbox.argyle.com/v2/shifts/{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: Basic <encoded-value>"
],
]);
$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-sandbox.argyle.com/v2/shifts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
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-sandbox.argyle.com/v2/shifts/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.argyle.com/v2/shifts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"id": "0183d245-b5c1-2a6d-5e37-1b831d765c5d",
"account": "0187c66e-e7e5-811c-b006-2232f00f426a",
"employer": "Whole Goods",
"created_at": "2023-04-27T07:02:01.279Z",
"updated_at": "2023-04-27T07:02:01.279Z",
"status": "completed",
"type": "hourly",
"start_datetime": "2023-04-26T00:00:00Z",
"end_datetime": "2023-04-26T08:00:00Z",
"all_datetimes": {
"shift_start": "2023-04-26T00:00:00Z",
"shift_end": "2023-04-26T08:00:00Z",
"breaks": [
{
"break_start": "2023-04-26T03:36:00Z",
"break_end": "2023-04-26T04:24:00Z"
}
]
},
"hours": "7.2",
"timezone": "America/New_York",
"location": "302 East N St, New York, NY 10014, US",
"metadata": {}
}Shifts
Retrieve A Shift
Retrieves a shift object.
GET
/
v2
/
shifts
/
{id}
Retrieve a shift
curl --request GET \
--url https://api-sandbox.argyle.com/v2/shifts/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api-sandbox.argyle.com/v2/shifts/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api-sandbox.argyle.com/v2/shifts/{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-sandbox.argyle.com/v2/shifts/{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: Basic <encoded-value>"
],
]);
$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-sandbox.argyle.com/v2/shifts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
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-sandbox.argyle.com/v2/shifts/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.argyle.com/v2/shifts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"id": "0183d245-b5c1-2a6d-5e37-1b831d765c5d",
"account": "0187c66e-e7e5-811c-b006-2232f00f426a",
"employer": "Whole Goods",
"created_at": "2023-04-27T07:02:01.279Z",
"updated_at": "2023-04-27T07:02:01.279Z",
"status": "completed",
"type": "hourly",
"start_datetime": "2023-04-26T00:00:00Z",
"end_datetime": "2023-04-26T08:00:00Z",
"all_datetimes": {
"shift_start": "2023-04-26T00:00:00Z",
"shift_end": "2023-04-26T08:00:00Z",
"breaks": [
{
"break_start": "2023-04-26T03:36:00Z",
"break_end": "2023-04-26T04:24:00Z"
}
]
},
"hours": "7.2",
"timezone": "America/New_York",
"location": "302 East N St, New York, NY 10014, US",
"metadata": {}
}Authorizations
Username = api_key_id, Password = api_key_secret
Path Parameters
ID of the shift object to be retrieved.
Response
200 - application/json
Unique ID of the shift.
Unique ID of the account associated with the shift.
Employer name.
Current state of the shift.
Available options:
scheduled, in_progress, completed, cancelled The type of shift.
Available options:
hourly, services Contains information on when the shift started and ended, and any breaks taken in between.
Show child attributes
Show child attributes
Time duration of the shift, subtracting breaks. Returned as a decimal string with up to four decimal places.
Full address of where the shift took place.
Additional, non-categorized information.