Depots
Retrieve a depot
GET /dn/depots/ returns a single depot object, including geocoded location and address fields.
GET
/
dn
/
depots
/
{name}
Retrieve a depot
curl --request GET \
--url https://app.detrack.com/api/v2/dn/depots/{name} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://app.detrack.com/api/v2/dn/depots/{name}"
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://app.detrack.com/api/v2/dn/depots/{name}', 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://app.detrack.com/api/v2/dn/depots/{name}",
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://app.detrack.com/api/v2/dn/depots/{name}"
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://app.detrack.com/api/v2/dn/depots/{name}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.detrack.com/api/v2/dn/depots/{name}")
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{
"data": {
"id": "68f0d416e8ec54cbf4a04dba",
"name": "Main Depot",
"address": "SM Megamall, EDSA corner Doña Julia Vargas Ave, Mandaluyong, 1550 Metro Manila",
"addr_1": "<string>",
"addr_2": "<string>",
"addr_3": "<string>",
"zip_code": "<string>",
"country": "<string>",
"city": "<string>",
"state": "<string>",
"country_id": "<string>",
"location": [
121.055626,
14.583941
],
"address_lat": 14.583941,
"address_lng": 121.055626
}
}{
"code": "invalid_key",
"message": "Invalid key"
}{
"code": "forbidden"
}{
"code": "not_found",
"message": "Depot not found"
}Fetch the details of one depot by its exact name. This is useful when you need to confirm the geocoded coordinates of a depot before assigning it to a route or job. The response includes the full address, geolocation array, and read-only
id.Retrieve a depot
curl --request GET \
--url https://app.detrack.com/api/v2/dn/depots/{name} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://app.detrack.com/api/v2/dn/depots/{name}"
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://app.detrack.com/api/v2/dn/depots/{name}', 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://app.detrack.com/api/v2/dn/depots/{name}",
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://app.detrack.com/api/v2/dn/depots/{name}"
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://app.detrack.com/api/v2/dn/depots/{name}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.detrack.com/api/v2/dn/depots/{name}")
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{
"data": {
"id": "68f0d416e8ec54cbf4a04dba",
"name": "Main Depot",
"address": "SM Megamall, EDSA corner Doña Julia Vargas Ave, Mandaluyong, 1550 Metro Manila",
"addr_1": "<string>",
"addr_2": "<string>",
"addr_3": "<string>",
"zip_code": "<string>",
"country": "<string>",
"city": "<string>",
"state": "<string>",
"country_id": "<string>",
"location": [
121.055626,
14.583941
],
"address_lat": 14.583941,
"address_lng": 121.055626
}
}{
"code": "invalid_key",
"message": "Invalid key"
}{
"code": "forbidden"
}{
"code": "not_found",
"message": "Depot not found"
}