Locations
Get Locations
Returns a paginated list of all locations.
GET
/
locations
Get Locations
curl --request GET \
--url https://api.roostedhr.com/api/1_12/locations \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.roostedhr.com/api/1_12/locations"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.roostedhr.com/api/1_12/locations', 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.roostedhr.com/api/1_12/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-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://api.roostedhr.com/api/1_12/locations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-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://api.roostedhr.com/api/1_12/locations")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roostedhr.com/api/1_12/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"locations": [
{
"id": "<string>",
"location": "<string>",
"addy_street_number": "<string>",
"addy_city": "<string>",
"addy_zip": "<string>",
"location_comments": "<string>",
"default": 0,
"saved": 0,
"color": "#DC136C",
"timezone": {
"id": 123,
"name": "<string>",
"offset": "<string>"
},
"companies_payroll_rulesets_id": "<string>",
"payroll_rule_display": "<string>",
"latitude": "<string>",
"longitude": "<string>",
"default_clients_id": "<string>",
"default_areas": [
"<string>"
]
}
],
"total": 123
}This endpoint returns paginated results. Use
items_per_page and page query parameters to control pagination. The response includes a total field with the full count of locations.Authorizations
Query Parameters
Number of items per page (1-100). Defaults to 25.
Required range:
1 <= x <= 100Page number. Defaults to 1.
Required range:
x >= 1⌘I
Get Locations
curl --request GET \
--url https://api.roostedhr.com/api/1_12/locations \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.roostedhr.com/api/1_12/locations"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.roostedhr.com/api/1_12/locations', 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.roostedhr.com/api/1_12/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-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://api.roostedhr.com/api/1_12/locations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-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://api.roostedhr.com/api/1_12/locations")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roostedhr.com/api/1_12/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"locations": [
{
"id": "<string>",
"location": "<string>",
"addy_street_number": "<string>",
"addy_city": "<string>",
"addy_zip": "<string>",
"location_comments": "<string>",
"default": 0,
"saved": 0,
"color": "#DC136C",
"timezone": {
"id": 123,
"name": "<string>",
"offset": "<string>"
},
"companies_payroll_rulesets_id": "<string>",
"payroll_rule_display": "<string>",
"latitude": "<string>",
"longitude": "<string>",
"default_clients_id": "<string>",
"default_areas": [
"<string>"
]
}
],
"total": 123
}