Skip to main content
PATCH
/
vehicles
/
location
Update vehicle last-known location
curl --request PATCH \
  --url https://app.unitedlogistics.com.do/api/v1/vehicles/location \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message_id": 123,
  "latitude": 0,
  "longitude": 0,
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "external_id": 123,
  "edt": "<string>",
  "eid": 123,
  "spd": 123,
  "head": 123,
  "odo": 123,
  "alt": 123,
  "eng": 0,
  "driver_id": 4821,
  "extra": "<string>",
  "device_id": "<string>",
  "carnumber": "<string>"
}
'
import requests

url = "https://app.unitedlogistics.com.do/api/v1/vehicles/location"

payload = {
    "message_id": 123,
    "latitude": 0,
    "longitude": 0,
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "external_id": 123,
    "edt": "<string>",
    "eid": 123,
    "spd": 123,
    "head": 123,
    "odo": 123,
    "alt": 123,
    "eng": 0,
    "driver_id": 4821,
    "extra": "<string>",
    "device_id": "<string>",
    "carnumber": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    message_id: 123,
    latitude: 0,
    longitude: 0,
    id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    external_id: 123,
    edt: '<string>',
    eid: 123,
    spd: 123,
    head: 123,
    odo: 123,
    alt: 123,
    eng: 0,
    driver_id: 4821,
    extra: '<string>',
    device_id: '<string>',
    carnumber: '<string>'
  })
};

fetch('https://app.unitedlogistics.com.do/api/v1/vehicles/location', 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.unitedlogistics.com.do/api/v1/vehicles/location",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'message_id' => 123,
    'latitude' => 0,
    'longitude' => 0,
    'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'external_id' => 123,
    'edt' => '<string>',
    'eid' => 123,
    'spd' => 123,
    'head' => 123,
    'odo' => 123,
    'alt' => 123,
    'eng' => 0,
    'driver_id' => 4821,
    'extra' => '<string>',
    'device_id' => '<string>',
    'carnumber' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.unitedlogistics.com.do/api/v1/vehicles/location"

	payload := strings.NewReader("{\n  \"message_id\": 123,\n  \"latitude\": 0,\n  \"longitude\": 0,\n  \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"external_id\": 123,\n  \"edt\": \"<string>\",\n  \"eid\": 123,\n  \"spd\": 123,\n  \"head\": 123,\n  \"odo\": 123,\n  \"alt\": 123,\n  \"eng\": 0,\n  \"driver_id\": 4821,\n  \"extra\": \"<string>\",\n  \"device_id\": \"<string>\",\n  \"carnumber\": \"<string>\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://app.unitedlogistics.com.do/api/v1/vehicles/location")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"message_id\": 123,\n  \"latitude\": 0,\n  \"longitude\": 0,\n  \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"external_id\": 123,\n  \"edt\": \"<string>\",\n  \"eid\": 123,\n  \"spd\": 123,\n  \"head\": 123,\n  \"odo\": 123,\n  \"alt\": 123,\n  \"eng\": 0,\n  \"driver_id\": 4821,\n  \"extra\": \"<string>\",\n  \"device_id\": \"<string>\",\n  \"carnumber\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://app.unitedlogistics.com.do/api/v1/vehicles/location")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"message_id\": 123,\n  \"latitude\": 0,\n  \"longitude\": 0,\n  \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"external_id\": 123,\n  \"edt\": \"<string>\",\n  \"eid\": 123,\n  \"spd\": 123,\n  \"head\": 123,\n  \"odo\": 123,\n  \"alt\": 123,\n  \"eng\": 0,\n  \"driver_id\": 4821,\n  \"extra\": \"<string>\",\n  \"device_id\": \"<string>\",\n  \"carnumber\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "external_id": 123,
    "provider": "<string>",
    "location": {
      "message_id": 123,
      "vehicle_id": 123,
      "carnumber": "<string>",
      "device_id": "<string>",
      "edt": "<string>",
      "eid": 123,
      "latitude": 123,
      "longitude": 123,
      "spd": 123,
      "head": 123,
      "odo": 123,
      "alt": 123,
      "extra": "<string>",
      "eng": 123,
      "driver_id": 4821,
      "car_title": "<string>",
      "license_plate": "<string>",
      "icon_url": "<string>",
      "car_type": "<string>",
      "sub_type": "<string>"
    },
    "location_updated_at": "<string>"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing Authorization header.",
    "details": "<unknown>"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing Authorization header.",
    "details": "<unknown>"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing Authorization header.",
    "details": "<unknown>"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing Authorization header.",
    "details": "<unknown>"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing Authorization header.",
    "details": "<unknown>"
  }
}

Authorizations

Authorization
string
header
required

Authorization: Bearer ulk__. Cree la clave en Configuración → API.

Body

application/json
message_id
integer
required
latitude
number
required
Required range: -90 <= x <= 90
longitude
number
required
Required range: -180 <= x <= 180
id
string<uuid>
external_id
integer
provider
Available options:
karma,
internal
edt
string
eid
integer
spd
number
head
number
odo
number
alt
number
eng
integer
Required range: 0 <= x <= 1
driver_id
integer | null

Provider driver external_id currently operating this vehicle (drivers.external_id). Optional — pass null to clear.

Example:

4821

extra
string | null
device_id
string | null
carnumber
string | null

Response

OK

data
object
required