curl --request GET \
--url https://api.birdeye.com/resources/v2/business/hierarchy/info \
--header 'x-api-key: <x-api-key>' \
--header 'x-business-number: <x-business-number>'import requests
url = "https://api.birdeye.com/resources/v2/business/hierarchy/info"
headers = {
"x-api-key": "<x-api-key>",
"x-business-number": "<x-business-number>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-business-number': '<x-business-number>'}
};
fetch('https://api.birdeye.com/resources/v2/business/hierarchy/info', 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.birdeye.com/resources/v2/business/hierarchy/info",
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: <x-api-key>",
"x-business-number: <x-business-number>"
],
]);
$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.birdeye.com/resources/v2/business/hierarchy/info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-business-number", "<x-business-number>")
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.birdeye.com/resources/v2/business/hierarchy/info")
.header("x-api-key", "<x-api-key>")
.header("x-business-number", "<x-business-number>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.birdeye.com/resources/v2/business/hierarchy/info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-business-number"] = '<x-business-number>'
response = http.request(request)
puts response.read_body{
"businessId": 1234567,
"businessNumber": 123456789012345,
"name": "Acme Retail",
"type": "Enterprise-Location",
"hierarchy": [
{
"levelId": 101,
"levelName": "Region",
"depth": 1,
"levelValueId": 5001,
"levelValueName": "West",
"children": [
{
"levelId": 102,
"levelName": "City",
"depth": 3,
"levelValueId": 6001,
"levelValueName": "Seattle",
"businessIds": [
2001,
2002
],
"businessNumbers": [
223456789012301,
223456789012302
]
},
{
"levelId": 102,
"levelName": "City",
"depth": 3,
"levelValueId": 6002,
"levelValueName": "Portland",
"businessIds": [
2003
],
"businessNumbers": [
223456789012303
]
}
],
"businessIds": [
2004
],
"businessNumbers": [
223456789012304
]
},
{
"levelId": 101,
"levelName": "Region",
"depth": 1,
"levelValueId": 5002,
"levelValueName": "East",
"children": [
{
"levelId": 103,
"levelName": "Area Manager",
"depth": 6,
"levelValueId": 7001,
"levelValueName": "Area 12",
"businessIds": [
2005
],
"businessNumbers": [
223456789012305
]
}
]
}
]
}{
"code": 1161,
"message": "Invalid API key"
}{
"code": 89,
"message": "Rate limit exceeded"
}Get Hierarchy v2
Get Hierarchy v2 API returns the business hierarchy of an enterprise or a location as a lightweight tree. Pass the business number of an enterprise or of a location in the x-business-number header. Each node represents a value of a hierarchy level (for example a region or a city), and the nodes below it are returned under children.
The businesses mapped to a node are returned as identifiers only (businessIds and businessNumbers). Details such as the business name and address are not included, which keeps the response small even for large enterprises. Use the Get Child Businesses API to fetch business details. Compared to Get Hierarchy, which also returns business details, this API is faster and returns a much smaller response.
Level names and values come from the hierarchy configured for the account. They carry no built-in meaning: for example, a value named Inactive is a regular hierarchy value that lists the businesses mapped to it.
curl --request GET \
--url https://api.birdeye.com/resources/v2/business/hierarchy/info \
--header 'x-api-key: <x-api-key>' \
--header 'x-business-number: <x-business-number>'import requests
url = "https://api.birdeye.com/resources/v2/business/hierarchy/info"
headers = {
"x-api-key": "<x-api-key>",
"x-business-number": "<x-business-number>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-business-number': '<x-business-number>'}
};
fetch('https://api.birdeye.com/resources/v2/business/hierarchy/info', 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.birdeye.com/resources/v2/business/hierarchy/info",
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: <x-api-key>",
"x-business-number: <x-business-number>"
],
]);
$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.birdeye.com/resources/v2/business/hierarchy/info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-business-number", "<x-business-number>")
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.birdeye.com/resources/v2/business/hierarchy/info")
.header("x-api-key", "<x-api-key>")
.header("x-business-number", "<x-business-number>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.birdeye.com/resources/v2/business/hierarchy/info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-business-number"] = '<x-business-number>'
response = http.request(request)
puts response.read_body{
"businessId": 1234567,
"businessNumber": 123456789012345,
"name": "Acme Retail",
"type": "Enterprise-Location",
"hierarchy": [
{
"levelId": 101,
"levelName": "Region",
"depth": 1,
"levelValueId": 5001,
"levelValueName": "West",
"children": [
{
"levelId": 102,
"levelName": "City",
"depth": 3,
"levelValueId": 6001,
"levelValueName": "Seattle",
"businessIds": [
2001,
2002
],
"businessNumbers": [
223456789012301,
223456789012302
]
},
{
"levelId": 102,
"levelName": "City",
"depth": 3,
"levelValueId": 6002,
"levelValueName": "Portland",
"businessIds": [
2003
],
"businessNumbers": [
223456789012303
]
}
],
"businessIds": [
2004
],
"businessNumbers": [
223456789012304
]
},
{
"levelId": 101,
"levelName": "Region",
"depth": 1,
"levelValueId": 5002,
"levelValueName": "East",
"children": [
{
"levelId": 103,
"levelName": "Area Manager",
"depth": 6,
"levelValueId": 7001,
"levelValueName": "Area 12",
"businessIds": [
2005
],
"businessNumbers": [
223456789012305
]
}
]
}
]
}{
"code": 1161,
"message": "Invalid API key"
}{
"code": 89,
"message": "Rate limit exceeded"
}Headers
e.g. application/json
Partner specific API key provided by Birdeye for data exchange.
Long business number of the business whose hierarchy you want to fetch, e.g. the business number of an enterprise or of a location.
Response
OK
Id of the business whose hierarchy is returned.
Business number of the business whose hierarchy is returned.
Name of the business.
Type of the business, e.g. Enterprise-Location.
Top level nodes of the hierarchy tree.
Show child attributes
Show child attributes