List Sub-Location Types
curl --request GET \
--url https://api.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types \
--header 'x-client-key: <api-key>' \
--header 'x-client-secret: <api-key>'import requests
url = "https://api.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types"
headers = {
"x-client-key": "<api-key>",
"x-client-secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-client-key': '<api-key>', 'x-client-secret': '<api-key>'}
};
fetch('https://api.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types', 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.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types",
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-client-key: <api-key>",
"x-client-secret: <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.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-client-key", "<api-key>")
req.Header.Add("x-client-secret", "<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.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types")
.header("x-client-key", "<api-key>")
.header("x-client-secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-client-key"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "5ea865b5-1503-4cc4-975d-101ecf67a5e4",
"externalId": "FRIDGE",
"name": "Fridge",
"status": "active",
"attributes": [
{
"id": "8b1d2c3e-4f50-4a61-8b72-93a4b5c6d7e8",
"externalId": "ZONE",
"key": "zone",
"name": "Zone",
"type": "single_select",
"options": [
{
"id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"label": "Front",
"color": "#7C5CFC"
},
{
"id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
"label": "Back",
"color": "#22B8CF"
}
],
"isRequired": false
},
{
"id": "9c2e3d4f-5061-4b72-9c83-a4b5c6d7e8f9",
"externalId": "CAPACITY",
"key": "capacity",
"name": "Capacity",
"type": "number",
"options": [],
"isRequired": false
}
]
}
],
"extra_meta": {
"message": ""
}
}Enterprise Sub-Locations
List Sub-Location Types
Returns every sub-location type in the workspace with its attribute definitions and the externalId you mapped to each type and attribute (or null). Use it to reconcile your own ids and to look up attribute keys and option ids.
Requires the Public API workspace feature, CAN_MANAGE_LOCATIONS, and Sub-Locations enabled for the workspace (contact Xenia to enable it; until then every sub-location endpoint returns 404).
GET
/
api
/
v1
/
mgt
/
enterprise
/
workspaces
/
{workspaceId}
/
sub-location-types
List Sub-Location Types
curl --request GET \
--url https://api.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types \
--header 'x-client-key: <api-key>' \
--header 'x-client-secret: <api-key>'import requests
url = "https://api.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types"
headers = {
"x-client-key": "<api-key>",
"x-client-secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-client-key': '<api-key>', 'x-client-secret': '<api-key>'}
};
fetch('https://api.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types', 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.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types",
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-client-key: <api-key>",
"x-client-secret: <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.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-client-key", "<api-key>")
req.Header.Add("x-client-secret", "<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.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types")
.header("x-client-key", "<api-key>")
.header("x-client-secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xenia.team/api/v1/mgt/enterprise/workspaces/{workspaceId}/sub-location-types")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-client-key"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "5ea865b5-1503-4cc4-975d-101ecf67a5e4",
"externalId": "FRIDGE",
"name": "Fridge",
"status": "active",
"attributes": [
{
"id": "8b1d2c3e-4f50-4a61-8b72-93a4b5c6d7e8",
"externalId": "ZONE",
"key": "zone",
"name": "Zone",
"type": "single_select",
"options": [
{
"id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"label": "Front",
"color": "#7C5CFC"
},
{
"id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
"label": "Back",
"color": "#22B8CF"
}
],
"isRequired": false
},
{
"id": "9c2e3d4f-5061-4b72-9c83-a4b5c6d7e8f9",
"externalId": "CAPACITY",
"key": "capacity",
"name": "Capacity",
"type": "number",
"options": [],
"isRequired": false
}
]
}
],
"extra_meta": {
"message": ""
}
}