List accessible organizations and practices
Returns the organizations, regions, and practices available to the authenticated account. Organizations contain practices. Regions are optional, overlapping groupings of practices rather than an intermediate parent level. The response uses three flat arrays: associate regions and practices with organizations through organization_id, and associate each practice with every region ID in region_practices. Arrays may be empty when the account has access only at another scope. Use returned practice IDs in practice-scoped API requests. Supply at most one of organization_id, region_ids, or practice_ids.
curl --request GET \
--url https://api.prod.peerlogic.com/api/org-hierarchy/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.prod.peerlogic.com/api/org-hierarchy/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.prod.peerlogic.com/api/org-hierarchy/', 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.prod.peerlogic.com/api/org-hierarchy/",
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://api.prod.peerlogic.com/api/org-hierarchy/"
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://api.prod.peerlogic.com/api/org-hierarchy/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.peerlogic.com/api/org-hierarchy/")
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{
"data": {
"organization": [
{
"id": "org_123",
"name": "Example Veterinary Group",
"view": true,
"manage": false
}
],
"regions": [
{
"id": "region_west",
"name": "West",
"organization_id": "org_123",
"view": true,
"manage": false
},
{
"id": "region_pilot",
"name": "Pilot practices",
"organization_id": "org_123",
"view": true,
"manage": false
}
],
"practices": [
{
"id": "practice_phoenix",
"name": "Example Veterinary Group - Phoenix",
"organization_id": "org_123",
"region_practices": [
"region_west",
"region_pilot"
],
"view": true,
"manage": false,
"direct": false
}
]
}
}{
"field_error": "exactly one of the parameters among organization_id, region_ids, and practice_ids should be specified."
}{
"detail": "'Authorization' header is required"
}{
"message": "No permissions assigned to permit access to this endpoint."
}Authorizations
Bearer access token issued by Peerlogic.
Query Parameters
Return the accessible hierarchy for this organization. Do not combine with region_ids or practice_ids.
Return the accessible hierarchy for one or more regions. Repeat the parameter for multiple IDs. Do not combine with organization_id or practice_ids.
Return one or more accessible practices and their available hierarchy context. Repeat the parameter for multiple IDs. Do not combine with organization_id or region_ids.
Response
The accessible organization, region, and practice hierarchy. Each array contains only resources visible to the authenticated account.
The organizations, regions, and practices visible to the authenticated account. Organizations contain practices. Regions are optional, many-to-many groupings of practices, not an intermediate parent level. The arrays are flat and can be associated through their identifier fields.
Accessible hierarchy resources. Any array can be empty when the account does not have access at that hierarchy level.
Show child attributes
Show child attributes
Was this page helpful?
curl --request GET \
--url https://api.prod.peerlogic.com/api/org-hierarchy/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.prod.peerlogic.com/api/org-hierarchy/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.prod.peerlogic.com/api/org-hierarchy/', 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.prod.peerlogic.com/api/org-hierarchy/",
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://api.prod.peerlogic.com/api/org-hierarchy/"
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://api.prod.peerlogic.com/api/org-hierarchy/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.peerlogic.com/api/org-hierarchy/")
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{
"data": {
"organization": [
{
"id": "org_123",
"name": "Example Veterinary Group",
"view": true,
"manage": false
}
],
"regions": [
{
"id": "region_west",
"name": "West",
"organization_id": "org_123",
"view": true,
"manage": false
},
{
"id": "region_pilot",
"name": "Pilot practices",
"organization_id": "org_123",
"view": true,
"manage": false
}
],
"practices": [
{
"id": "practice_phoenix",
"name": "Example Veterinary Group - Phoenix",
"organization_id": "org_123",
"region_practices": [
"region_west",
"region_pilot"
],
"view": true,
"manage": false,
"direct": false
}
]
}
}{
"field_error": "exactly one of the parameters among organization_id, region_ids, and practice_ids should be specified."
}{
"detail": "'Authorization' header is required"
}{
"message": "No permissions assigned to permit access to this endpoint."
}