Contacts
List contacts
GET /dn/contacts returns a paginated list of your saved contacts. Search by name or company with q.
GET
/
dn
/
contacts
List contacts
curl --request GET \
--url https://app.detrack.com/api/v2/dn/contacts \
--header 'X-API-KEY: <api-key>'import requests
url = "https://app.detrack.com/api/v2/dn/contacts"
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/contacts', 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/contacts",
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/contacts"
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/contacts")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.detrack.com/api/v2/dn/contacts")
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": "65263b0c29e804cae4fedd76",
"deliver_to_collect_from": "James Li",
"last_name": "<string>",
"job_time": "<string>",
"customer": "<string>",
"company_name": "Detrack",
"address": "61 Kaki Bukit Ave 1, Singapore 417943",
"postal_code": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"address_3": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"address_lat": 123,
"address_lng": 123,
"phone_number": "65432178",
"fax_number": "<string>",
"notify_email": "test@example.com",
"zone": "<string>",
"instructions": "<string>",
"boxes": "<string>",
"cubic_meters": 123,
"cartons": 123,
"pieces": 123,
"envelopes": 123,
"pallets": 123,
"remarks": "<string>",
"account_number": "<string>",
"sales_person": "<string>",
"pick_up_from": "<string>",
"pick_up_time": "<string>",
"pick_up_address": "<string>",
"pick_up_address_1": "<string>",
"pick_up_address_2": "<string>",
"pick_up_address_3": "<string>",
"pick_up_city": "<string>",
"pick_up_state": "<string>",
"pick_up_country": "<string>",
"pick_up_postal_code": "<string>",
"pick_up_zone": "<string>",
"pick_up_lat": 123,
"pick_up_lng": 123,
"sender_phone_number": "<string>",
"groups": [
{
"id": "5e8b2f1a29e804cae4fe0a11",
"name": "North"
}
],
"items": [
{
"id": "6526409e29e804cae4fedd81",
"sku": "12345678",
"description": "iPad",
"quantity": 2,
"unit_price": 123,
"fixed_price": 123,
"minimum_quantity": 123,
"position": 0
}
]
}
],
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<string>"
},
"total_count": 1
}{
"code": "invalid_key",
"message": "Invalid key"
}{
"code": "forbidden"
}Retrieve the contacts in your Detrack address book. The response is paginated: use
page and limit to move through it, up to 100 contacts per page, and follow the URLs in links. total_count is the number of contacts that match.
Use q to search by recipient name, last name, or company name. For example, ?q=James returns every contact whose name, last name, or company name contains “James”.
For errors and rate limits, see Errors and Rate limits.Authorizations
Your Detrack API key, from Integrations > API Key in the dashboard.
Query Parameters
Page number.
Records per page, up to 100. A larger value returns 100 records.
Required range:
x <= 100Search text. Matches deliver_to_collect_from, last_name, or company_name (partial, case-insensitive).
Comma-separated fields to sort by, using the field names in the response. Prefix a field with - for descending, for example -company_name.
List contacts
curl --request GET \
--url https://app.detrack.com/api/v2/dn/contacts \
--header 'X-API-KEY: <api-key>'import requests
url = "https://app.detrack.com/api/v2/dn/contacts"
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/contacts', 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/contacts",
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/contacts"
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/contacts")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.detrack.com/api/v2/dn/contacts")
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": "65263b0c29e804cae4fedd76",
"deliver_to_collect_from": "James Li",
"last_name": "<string>",
"job_time": "<string>",
"customer": "<string>",
"company_name": "Detrack",
"address": "61 Kaki Bukit Ave 1, Singapore 417943",
"postal_code": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"address_3": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"address_lat": 123,
"address_lng": 123,
"phone_number": "65432178",
"fax_number": "<string>",
"notify_email": "test@example.com",
"zone": "<string>",
"instructions": "<string>",
"boxes": "<string>",
"cubic_meters": 123,
"cartons": 123,
"pieces": 123,
"envelopes": 123,
"pallets": 123,
"remarks": "<string>",
"account_number": "<string>",
"sales_person": "<string>",
"pick_up_from": "<string>",
"pick_up_time": "<string>",
"pick_up_address": "<string>",
"pick_up_address_1": "<string>",
"pick_up_address_2": "<string>",
"pick_up_address_3": "<string>",
"pick_up_city": "<string>",
"pick_up_state": "<string>",
"pick_up_country": "<string>",
"pick_up_postal_code": "<string>",
"pick_up_zone": "<string>",
"pick_up_lat": 123,
"pick_up_lng": 123,
"sender_phone_number": "<string>",
"groups": [
{
"id": "5e8b2f1a29e804cae4fe0a11",
"name": "North"
}
],
"items": [
{
"id": "6526409e29e804cae4fedd81",
"sku": "12345678",
"description": "iPad",
"quantity": 2,
"unit_price": 123,
"fixed_price": 123,
"minimum_quantity": 123,
"position": 0
}
]
}
],
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<string>"
},
"total_count": 1
}{
"code": "invalid_key",
"message": "Invalid key"
}{
"code": "forbidden"
}