curl --request GET \
--url https://{base_url}/api/v1/departments/{department_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{base_url}/api/v1/departments/{department_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{base_url}/api/v1/departments/{department_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://{base_url}/api/v1/departments/{department_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>"
],
]);
$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://{base_url}/api/v1/departments/{department_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{base_url}/api/v1/departments/{department_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{base_url}/api/v1/departments/{department_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "2784_118",
"costCentreCode": "",
"manager": "",
"name": "Bakery",
"payRollCode": "",
"roles": [
{
"id": "2213_6820",
"costCentreCode": "",
"defaultActivity": "2760_183",
"name": "Assistant Manager"
},
{
"id": "2213_6559",
"costCentreCode": "",
"defaultActivity": "2760_183",
"name": "Retail Assistant"
}
],
"workDayFinishTime": "",
"workDayStartTime": ""
}Get a department
Returns details about a single department by its ID.
curl --request GET \
--url https://{base_url}/api/v1/departments/{department_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{base_url}/api/v1/departments/{department_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{base_url}/api/v1/departments/{department_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://{base_url}/api/v1/departments/{department_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>"
],
]);
$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://{base_url}/api/v1/departments/{department_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{base_url}/api/v1/departments/{department_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{base_url}/api/v1/departments/{department_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "2784_118",
"costCentreCode": "",
"manager": "",
"name": "Bakery",
"payRollCode": "",
"roles": [
{
"id": "2213_6820",
"costCentreCode": "",
"defaultActivity": "2760_183",
"name": "Assistant Manager"
},
{
"id": "2213_6559",
"costCentreCode": "",
"defaultActivity": "2760_183",
"name": "Retail Assistant"
}
],
"workDayFinishTime": "",
"workDayStartTime": ""
}Authorizations
Access token obtained from /oauth/token. Pass as Authorization: Bearer {token}
Path Parameters
The unique identifier of the department to retrieve
"2784_118"
Response
Department details
The unique identifier for the department
"2784_118"
The cost centre code associated with this department. Empty string if not assigned.
""
The manager of the department. Empty string if not assigned.
""
The display name of the department
"Bakery"
The payroll code associated with this department. Empty string if not assigned.
""
A list of roles within this department
Show child attributes
Show child attributes
The default work day finish time for this department. Empty string if not set.
""
The default work day start time for this department. Empty string if not set.
""
Was this page helpful?

.png?fit=max&auto=format&n=fTXEPIUfjW4rC1Pi&q=85&s=85d7b852879d29ad2bde9b743307ab0e)