Contacts
Retrieve a contact
GET /dn/contacts/ returns one contact, including its address, groups, and items.
GET
/
dn
/
contacts
/
{id}
Retrieve a contact
curl --request GET \
--url https://app.detrack.com/api/v2/dn/contacts/{id} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://app.detrack.com/api/v2/dn/contacts/{id}"
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/{id}', 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/{id}",
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/{id}"
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/{id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.detrack.com/api/v2/dn/contacts/{id}")
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
}
]
}
}{
"code": "invalid_key",
"message": "Invalid key"
}{
"code": "forbidden"
}{
"code": "not_found",
"message": "Contact not found"
}Fetch one contact by its
id. If you don’t have the id, find the contact with List contacts and its q search.
A 404 means no contact has that id, or your API key’s user can’t see it. See Which contacts you can see.Authorizations
Your Detrack API key, from Integrations > API Key in the dashboard.
Path Parameters
The contact's id, from List contacts or Create a contact.
Example:
"65263b0c29e804cae4fedd76"
Response
The contact.
A saved recipient. Empty fields are null. The pick-up fields (pick_up_*) are returned only if your account uses point-to-point jobs.
Show child attributes
Show child attributes
Retrieve a contact
curl --request GET \
--url https://app.detrack.com/api/v2/dn/contacts/{id} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://app.detrack.com/api/v2/dn/contacts/{id}"
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/{id}', 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/{id}",
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/{id}"
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/{id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.detrack.com/api/v2/dn/contacts/{id}")
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
}
]
}
}{
"code": "invalid_key",
"message": "Invalid key"
}{
"code": "forbidden"
}{
"code": "not_found",
"message": "Contact not found"
}