Skip to main content
GET
/
v2
/
shifts
List all shifts
curl --request GET \
  --url https://api-sandbox.argyle.com/v2/shifts \
  --header 'Authorization: Basic <encoded-value>'
import requests

url = "https://api-sandbox.argyle.com/v2/shifts"

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', 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",
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"

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")
.header("Authorization", "Basic <encoded-value>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.argyle.com/v2/shifts")

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
{
  "next": "https://api-sandbox.argyle.com/v2/shifts?cursor=ZXhhbXBsZV9jdXJzb3I",
  "previous": null,
  "results": [
    {
      "id": "0183c13c-5d3d-2d36-4d6d-5ac7a7eb2b2d",
      "account": "0187c66e-e7e5-811c-b006-2232f00f426a",
      "employer": "Bullseye",
      "created_at": "2023-04-27T17:37:43.977Z",
      "updated_at": "2023-04-27T17:37:43.977Z",
      "status": "completed",
      "type": "hourly",
      "start_datetime": "2023-04-26T00:00:00Z",
      "end_datetime": "2023-04-26T10:00:00Z",
      "all_datetimes": {
        "shift_start": "2023-04-26T00:00:00Z",
        "shift_end": "2023-04-26T10:00:00Z",
        "breaks": [
          {
            "break_start": "2023-04-26T04:30:00Z",
            "break_end": "2023-04-26T05:30:00Z"
          }
        ]
      },
      "hours": "9.0",
      "timezone": "America/New_York",
      "location": "605 Far West Ave Suite 970, New York, NY 10019, US",
      "metadata": {}
    },
    {
      "id": "0183c5c3-2c9e-f2d1-3c7d-3ac5b73d3a5d",
      "account": "0187c66e-e7e5-811c-b006-2232f00f426a",
      "employer": "Bullseye",
      "created_at": "2023-04-28T17:38:43.977Z",
      "updated_at": "2023-04-28T17:38:43.977Z",
      "status": "scheduled",
      "type": "hourly",
      "start_datetime": "2023-04-29T00:00:00Z",
      "end_datetime": "2023-04-29T10:00:00Z",
      "all_datetimes": {
        "shift_start": "2023-04-29T00:00:00Z",
        "shift_end": "2023-04-29T10:00:00Z",
        "breaks": []
      },
      "hours": "10.0",
      "timezone": "America/New_York",
      "location": "605 Far West Ave Suite 970, New York, NY 10019, US",
      "metadata": {}
    }
  ]
}

Authorizations

Authorization
string
header
required

Username = api_key_id, Password = api_key_secret

Query Parameters

account
string<uuid>

Filter by account ID.

user
string<uuid>

Filter by user ID.

from_start_datetime
string<date-time>

Filter by shifts with a start_datetime on or after this timestamp ISO 8601.

to_start_datetime
string<date-time>

Filter by shifts with a start_datetime on or before this timestamp ISO 8601.

limit
integer

Number of shift objects returned per page. Default: 10. Maximum: 200.

cursor
string

The URL returned in next or previous used to retrieve another page of results.

Response

200 - application/json
next
string<uri> | null

URL for the next page of results, if available.

previous
string<uri> | null

URL for the previous page of results, if available.

results
object[]