Real-time Tracking WebSocket
curl --request WSS \
--url https://api.usedroptrail.com/ws/tracking/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usedroptrail.com/ws/tracking/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.request("WSS", url, headers=headers)
print(response.text)const options = {method: 'WSS', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usedroptrail.com/ws/tracking/{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://api.usedroptrail.com/ws/tracking/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "WSS",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.usedroptrail.com/ws/tracking/{id}"
req, _ := http.NewRequest("WSS", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.customMethod("WSS","https://api.usedroptrail.com/ws/tracking/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
class Net::HTTP::Wss < Net::HTTPRequest
METHOD = 'WSS'
REQUEST_HAS_BODY = 'false'
RESPONSE_HAS_BODY = true
end
url = URI("https://api.usedroptrail.com/ws/tracking/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Wss.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"type": "<string>",
"delivery_id": "<string>",
"timestamp": "<string>",
"data": {
"status": "<string>",
"location": {
"latitude": 123,
"longitude": 123
},
"notes": "<string>"
}
}Tracking
Real-time Tracking WebSocket
Establish a WebSocket connection to receive real-time tracking updates
WSS
/
ws
/
tracking
/
{id}
Real-time Tracking WebSocket
curl --request WSS \
--url https://api.usedroptrail.com/ws/tracking/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usedroptrail.com/ws/tracking/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.request("WSS", url, headers=headers)
print(response.text)const options = {method: 'WSS', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usedroptrail.com/ws/tracking/{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://api.usedroptrail.com/ws/tracking/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "WSS",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.usedroptrail.com/ws/tracking/{id}"
req, _ := http.NewRequest("WSS", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.customMethod("WSS","https://api.usedroptrail.com/ws/tracking/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
class Net::HTTP::Wss < Net::HTTPRequest
METHOD = 'WSS'
REQUEST_HAS_BODY = 'false'
RESPONSE_HAS_BODY = true
end
url = URI("https://api.usedroptrail.com/ws/tracking/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Wss.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"type": "<string>",
"delivery_id": "<string>",
"timestamp": "<string>",
"data": {
"status": "<string>",
"location": {
"latitude": 123,
"longitude": 123
},
"notes": "<string>"
}
}Connect via WebSocket to receive instant updates about a delivery’s location and status changes without polling.
Path Parameters
string
required
The unique identifier of the delivery request to track
Connection
The WebSocket connection will remain open until either party closes it. The server will send updates whenever the delivery’s location or status changes.Message Format
Updates are sent as JSON messages with the following structure:string
Type of update (LOCATION_UPDATE, STATUS_CHANGE)
string
The unique identifier of the delivery request
string
ISO 8601 timestamp when the update occurred
object