Introduction
This documentation aims to provide all the information you need to work with our API.
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your token by visiting your dashboard and clicking Generate API token.
Alarms
API for alarm log reports
Get alarm log
requires authentication
Returns alarm events filtered by date range, object, and alert group.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/alarmlog?datetime[]=2026-01-01&datetime[]=2026-01-31&object_id=ABC123&AlertGroup[]=1&AlertGroup[]=2&AlertGroup[]=3&offset=0&limit=30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/alarmlog"
);
const params = {
"datetime[0]": "2026-01-01",
"datetime[1]": "2026-01-31",
"object_id": "ABC123",
"AlertGroup[0]": "1",
"AlertGroup[1]": "2",
"AlertGroup[2]": "3",
"offset": "0",
"limit": "30",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/alarmlog';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => '2026-01-01',
'datetime[1]' => '2026-01-31',
'object_id' => 'ABC123',
'AlertGroup[0]' => '1',
'AlertGroup[1]' => '2',
'AlertGroup[2]' => '3',
'offset' => '0',
'limit' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/alarmlog'
params = {
'datetime[0]': '2026-01-01',
'datetime[1]': '2026-01-31',
'object_id': 'ABC123',
'AlertGroup[0]': '1',
'AlertGroup[1]': '2',
'AlertGroup[2]': '3',
'offset': '0',
'limit': '30',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get alarm history
requires authentication
Returns sent alarm records filtered by date range and object.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/alarmhistory?datetime[]=2026-01-01&datetime[]=2026-01-31&object_id=ABC123&offset=0&limit=30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/alarmhistory"
);
const params = {
"datetime[0]": "2026-01-01",
"datetime[1]": "2026-01-31",
"object_id": "ABC123",
"offset": "0",
"limit": "30",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/alarmhistory';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => '2026-01-01',
'datetime[1]' => '2026-01-31',
'object_id' => 'ABC123',
'offset' => '0',
'limit' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/alarmhistory'
params = {
'datetime[0]': '2026-01-01',
'datetime[1]': '2026-01-31',
'object_id': 'ABC123',
'offset': '0',
'limit': '30',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get alarm groups
requires authentication
Returns all available alarm groups.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/alarmgroups" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/alarmgroups"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/alarmgroups';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/alarmgroups'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send test alarm
requires authentication
Sends a test alarm email and/or SMS to the specified contact.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/testalarm" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/testalarm"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/testalarm';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/testalarm'
payload = {
"id": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List alarm configurations
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/alarmconfig" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/alarmconfig"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/alarmconfig';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/alarmconfig'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create alarm configuration
requires authentication
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/alarmconfig" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"Name\": \"Speed Alert\",
\"email\": \"alerts@example.com\",
\"Active\": true,
\"sms\": \"5555555\",
\"country_code\": \"+372\",
\"alarms\": [
1,
2,
3
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/alarmconfig"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"Name": "Speed Alert",
"email": "alerts@example.com",
"Active": true,
"sms": "5555555",
"country_code": "+372",
"alarms": [
1,
2,
3
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/alarmconfig';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'Name' => 'Speed Alert',
'email' => 'alerts@example.com',
'Active' => true,
'sms' => '5555555',
'country_code' => '+372',
'alarms' => [
1,
2,
3,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/alarmconfig'
payload = {
"Name": "Speed Alert",
"email": "alerts@example.com",
"Active": true,
"sms": "5555555",
"country_code": "+372",
"alarms": [
1,
2,
3
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get alarm configuration
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/alarmconfig/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/alarmconfig/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/alarmconfig/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/alarmconfig/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update alarm configuration
requires authentication
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/alarmconfig/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"Name\": \"Speed Alert\",
\"email\": \"alerts@example.com\",
\"Active\": true,
\"sms\": \"5555555\",
\"country_code\": \"+372\",
\"alarms\": [
1,
2,
3
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/alarmconfig/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"Name": "Speed Alert",
"email": "alerts@example.com",
"Active": true,
"sms": "5555555",
"country_code": "+372",
"alarms": [
1,
2,
3
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/alarmconfig/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'Name' => 'Speed Alert',
'email' => 'alerts@example.com',
'Active' => true,
'sms' => '5555555',
'country_code' => '+372',
'alarms' => [
1,
2,
3,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/alarmconfig/architecto'
payload = {
"Name": "Speed Alert",
"email": "alerts@example.com",
"Active": true,
"sms": "5555555",
"country_code": "+372",
"alarms": [
1,
2,
3
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete alarm configuration
requires authentication
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/alarmconfig/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/alarmconfig/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/alarmconfig/architecto';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/alarmconfig/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Booking
Booking retrieval
List bookings
requires authentication
Returns all bookings. Use mq=mobile to get grouped percentage data.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/booking" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mq\": \"desktop\",
\"day\": \"2025-01-15 00:00:00\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/booking"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mq": "desktop",
"day": "2025-01-15 00:00:00"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/booking';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mq' => 'desktop',
'day' => '2025-01-15 00:00:00',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/booking'
payload = {
"mq": "desktop",
"day": "2025-01-15 00:00:00"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"object_id": "123",
"driver_id": 1,
"start_time": "2025-01-15 08:00:00"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get booking
requires authentication
Returns a single booking by ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/booking/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/booking/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/booking/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/booking/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"data": {
"id": 1,
"object_id": "123",
"driver_id": 1
}
}
Example response (404):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get grouped bookings
requires authentication
Returns booking data grouped by day with occupancy percentage and ownership flag.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/bookinggrouped" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/bookinggrouped"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/bookinggrouped';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/bookinggrouped'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"data": {
"2025/01/15": {
"percent": 45,
"hasOwn": true
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List booking vehicles
requires authentication
Returns all bookable vehicles or available vehicles for a given datetime period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/bookingobjects?driver_id=1&datetime[]=architecto&id=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/bookingobjects"
);
const params = {
"driver_id": "1",
"datetime[0]": "architecto",
"id": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/bookingobjects';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'driver_id' => '1',
'datetime[0]' => 'architecto',
'id' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/bookingobjects'
params = {
'driver_id': '1',
'datetime[0]': 'architecto',
'id': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"data": [
{
"id": "ABC123",
"alias": "Truck 1"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List booking log entries
requires authentication
Returns booking log entries for the given datetime period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/bookinglog?datetime[]=architecto&offset=0&limit=30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/bookinglog"
);
const params = {
"datetime[0]": "architecto",
"offset": "0",
"limit": "30",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/bookinglog';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'offset' => '0',
'limit' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/bookinglog'
params = {
'datetime[0]': 'architecto',
'offset': '0',
'limit': '30',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"oid": "user1",
"datet": "2025-01-15 08:00:00",
"action": "SAVE",
"description": "...",
"booking_id": 1
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a booking report
requires authentication
Returns booking records enriched with driven distance (km) for the given period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/bookingreport?datetime[]=architecto&object_id=ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/bookingreport"
);
const params = {
"datetime[0]": "architecto",
"object_id": "ABC123",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/bookingreport';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'object_id' => 'ABC123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/bookingreport'
params = {
'datetime[0]': 'architecto',
'object_id': 'ABC123',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"object_id": "ABC123",
"driver_id": "1",
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"name": "John Doe",
"tehnKontakt": "+372 555 1234",
"memo": null,
"km": 125.4
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a booking
requires authentication
Creates a new booking with automatic pin generation. The booking period must be in the future. Sends a confirmation email to the authenticated user.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/booking" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"driver_id\": 1,
\"purpose\": \"Delivery\",
\"start_time\": \"2025-01-15 08:00:00\",
\"stop_time\": \"2025-01-15 17:00:00\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/booking"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"driver_id": 1,
"purpose": "Delivery",
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/booking';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'driver_id' => 1,
'purpose' => 'Delivery',
'start_time' => '2025-01-15 08:00:00',
'stop_time' => '2025-01-15 17:00:00',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/booking'
payload = {
"object_id": "ABC123",
"driver_id": 1,
"purpose": "Delivery",
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Created):
{
"data": {
"id": 1,
"object_id": "ABC123",
"alias": "Truck 1",
"driver_id": 1,
"driverName": "John Doe",
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"user_id": "user1",
"comment": null,
"pin": "1234"
}
}
Example response (400, Period not future):
{
"message": "Period_Must_Be_Future"
}
Example response (400, Conflict):
{
"message": "Driver_Or_Vehicle_Is_Busy"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a booking
requires authentication
Updates an existing booking. The stop time must be in the future. Sends a notification email to the authenticated user.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/booking/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"driver_id\": 1,
\"purpose\": \"Delivery\",
\"start_time\": \"2025-01-15 08:00:00\",
\"stop_time\": \"2025-01-15 17:00:00\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/booking/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"driver_id": 1,
"purpose": "Delivery",
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/booking/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'driver_id' => 1,
'purpose' => 'Delivery',
'start_time' => '2025-01-15 08:00:00',
'stop_time' => '2025-01-15 17:00:00',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/booking/architecto'
payload = {
"object_id": "ABC123",
"driver_id": 1,
"purpose": "Delivery",
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Updated):
{
"data": {
"id": 1,
"object_id": "ABC123",
"alias": "Truck 1",
"driver_id": 1,
"driverName": "John Doe",
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"user_id": "user1",
"comment": null,
"pin": "1234"
}
}
Example response (400, Period finished):
{
"message": "Period_Stop_Must_Be_Future"
}
Example response (400, Conflict):
{
"message": "Driver_Or_Vehicle_Is_Busy"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a booking
requires authentication
Deletes a booking. The booking period must be in the future (past bookings cannot be deleted). Sends a cancellation email to the authenticated user.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/booking/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/booking/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/booking/architecto';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/booking/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, Deleted):
Empty response
Example response (400, Period not future):
{
"message": "Period_Must_Be_Future"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Brigades
Brigade management
List brigades
requires authentication
Returns all brigades.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/brigades" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/brigades"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/brigades';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/brigades'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"brigName": "Morning Shift"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get brigade
requires authentication
Returns a single brigade by ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/brigades/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/brigades/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/brigades/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/brigades/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"data": {
"id": 1,
"brigName": "Morning Shift"
}
}
Example response (404):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a brigade
requires authentication
Creates a new brigade.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/brigades" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"brigName\": \"Morning Shift\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/brigades"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"brigName": "Morning Shift"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/brigades';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'brigName' => 'Morning Shift',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/brigades'
payload = {
"brigName": "Morning Shift"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"data": {
"id": 1,
"brigName": "Morning Shift"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update brigade
requires authentication
Updates an existing brigade.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/brigades/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"brigName\": \"Morning Shift\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/brigades/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"brigName": "Morning Shift"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/brigades/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'brigName' => 'Morning Shift',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/brigades/architecto'
payload = {
"brigName": "Morning Shift"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"message": "Updated"
}
Example response (404):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete brigade
requires authentication
Deletes a brigade.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/brigades/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/brigades/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/brigades/architecto';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/brigades/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DDD
DDD Account management
Get DDD account
requires authentication
Returns the DDD account information for the owner.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/dddaccount" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/dddaccount"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/dddaccount';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/dddaccount'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"data": {
"id": 1,
"expiryDate": "2025-12-31"
}
}
Example response (404):
{
"message": "Not Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Download multiple DDD files
requires authentication
Downloads multiple DDD files as a ZIP archive based on filters.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/ddddownload" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": [
16
],
\"DriverID\": [
\"architecto\"
],
\"file_type\": 7,
\"datetime\": [
\"2026-02-26T15:34:40\"
],
\"limit\": 30
}"
const url = new URL(
"https://testapi.metrotec.ee/api/ddddownload"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": [
16
],
"DriverID": [
"architecto"
],
"file_type": 7,
"datetime": [
"2026-02-26T15:34:40"
],
"limit": 30
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ddddownload';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => [
16,
],
'DriverID' => [
'architecto',
],
'file_type' => 7,
'datetime' => [
'2026-02-26T15:34:40',
],
'limit' => 30,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ddddownload'
payload = {
"object_id": [
16
],
"DriverID": [
"architecto"
],
"file_type": 7,
"datetime": [
"2026-02-26T15:34:40"
],
"limit": 30
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (200, Success):
Binary ZIP content
Example response (422):
{
"message": "Validation error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Download a single DDD file
requires authentication
Downloads a single DDD file as a ZIP archive.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/ddddownload/123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/ddddownload/123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ddddownload/123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ddddownload/123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
Binary ZIP content
Example response (404):
{
"error": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List DDD drivers
requires authentication
Returns a list of drivers with DDD card information.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/ddddrivers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"archive\": false,
\"limit\": 30
}"
const url = new URL(
"https://testapi.metrotec.ee/api/ddddrivers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"archive": false,
"limit": 30
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ddddrivers';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'archive' => false,
'limit' => 30,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ddddrivers'
payload = {
"archive": false,
"limit": 30
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"name": "John",
"fname": "Doe",
"driverName": "John Doe",
"driverCardId": "ABC123",
"refreshRate": 30
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get DDD driver
requires authentication
Returns a single driver with DDD card information.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/ddddrivers/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/ddddrivers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ddddrivers/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ddddrivers/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"data": {
"id": 1,
"name": "John",
"fname": "Doe",
"driverName": "John Doe",
"driverCardId": "ABC123",
"refreshRate": 30
}
}
Example response (404):
{
"message": "Not Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update DDD drivers
requires authentication
Updates the refresh rate for all drivers belonging to the owner.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/ddddrivers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"refreshRate\": 30,
\"archive\": \"0\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/ddddrivers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"refreshRate": 30,
"archive": "0"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ddddrivers';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'refreshRate' => 30,
'archive' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ddddrivers'
payload = {
"refreshRate": 30,
"archive": "0"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"refreshRate": 30
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List DDD vehicles
requires authentication
Returns a list of vehicles with DDD information and tacho data.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/dddvehicles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"limit\": 30
}"
const url = new URL(
"https://testapi.metrotec.ee/api/dddvehicles"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"limit": 30
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/dddvehicles';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'limit' => 30,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/dddvehicles'
payload = {
"limit": 30
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"alias": "Truck 1",
"refreshRate": 30
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get DDD vehicle
requires authentication
Returns a single vehicle with DDD information.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/dddvehicles/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/dddvehicles/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/dddvehicles/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/dddvehicles/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"data": {
"id": 1,
"alias": "Truck 1",
"refreshRate": 30,
"ins_date": "2025-01-15 10:00:00"
}
}
Example response (404):
{
"message": "Not Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update DDD vehicles
requires authentication
Updates the refresh rate for all vehicles belonging to the owner.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/dddvehicles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"refreshRate\": 30
}"
const url = new URL(
"https://testapi.metrotec.ee/api/dddvehicles"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"refreshRate": 30
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/dddvehicles';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'refreshRate' => 30,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/dddvehicles'
payload = {
"refreshRate": 30
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"refreshRate": 30
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List DDD files
requires authentication
Returns a list of downloaded DDD files with optional filtering.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/dddfiles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": [
16
],
\"DriverID\": [
\"architecto\"
],
\"file_type\": 7,
\"datetime\": [
\"2026-02-26T15:34:40\"
],
\"offset\": 0,
\"archive\": false,
\"limit\": 30,
\"latest\": false
}"
const url = new URL(
"https://testapi.metrotec.ee/api/dddfiles"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": [
16
],
"DriverID": [
"architecto"
],
"file_type": 7,
"datetime": [
"2026-02-26T15:34:40"
],
"offset": 0,
"archive": false,
"limit": 30,
"latest": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/dddfiles';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => [
16,
],
'DriverID' => [
'architecto',
],
'file_type' => 7,
'datetime' => [
'2026-02-26T15:34:40',
],
'offset' => 0,
'archive' => false,
'limit' => 30,
'latest' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/dddfiles'
payload = {
"object_id": [
16
],
"DriverID": [
"architecto"
],
"file_type": 7,
"datetime": [
"2026-02-26T15:34:40"
],
"offset": 0,
"archive": false,
"limit": 30,
"latest": false
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"object_id": 123,
"file_type": 7,
"start": "2025-01-01 00:00:00",
"end": "2025-01-15 23:59:59"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List DDD logs
requires authentication
Returns DDD activity logs including file downloads and requests.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/dddlog" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"123\",
\"datetime\": [
\"2026-02-26T15:34:40\"
],
\"offset\": 0,
\"limit\": 30
}"
const url = new URL(
"https://testapi.metrotec.ee/api/dddlog"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "123",
"datetime": [
"2026-02-26T15:34:40"
],
"offset": 0,
"limit": 30
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/dddlog';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => '123',
'datetime' => [
'2026-02-26T15:34:40',
],
'offset' => 0,
'limit' => 30,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/dddlog'
payload = {
"object_id": "123",
"datetime": [
"2026-02-26T15:34:40"
],
"offset": 0,
"limit": 30
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"object_id": 123,
"ins_date": "2025-01-15 10:00:00",
"log": "File downloaded"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List driver status records
requires authentication
Returns driver status records for the given period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/ddddriversstatus" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"123\",
\"driver_id\": 1,
\"datetime\": [
\"2026-02-26T15:34:40\"
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/ddddriversstatus"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "123",
"driver_id": 1,
"datetime": [
"2026-02-26T15:34:40"
]
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ddddriversstatus';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => '123',
'driver_id' => 1,
'datetime' => [
'2026-02-26T15:34:40',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ddddriversstatus'
payload = {
"object_id": "123",
"driver_id": 1,
"datetime": [
"2026-02-26T15:34:40"
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"object_id": 123,
"time": "2025-01-15 10:00:00",
"status": 1,
"driver_name": "John Doe"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get driver status summary
requires authentication
Returns aggregated status summary with time spent in each status.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/ddddriversstatus/summary" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"123\",
\"driver_id\": 1,
\"datetime\": [
\"2026-02-26T15:34:40\"
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/ddddriversstatus/summary"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "123",
"driver_id": 1,
"datetime": [
"2026-02-26T15:34:40"
]
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ddddriversstatus/summary';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => '123',
'driver_id' => 1,
'datetime' => [
'2026-02-26T15:34:40',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ddddriversstatus/summary'
payload = {
"object_id": "123",
"driver_id": 1,
"datetime": [
"2026-02-26T15:34:40"
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"1": 3600,
"2": 7200,
"route_length": 150.5
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a DDD request
requires authentication
Creates a new DDD file download request for a vehicle.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/dddrequests" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"123\",
\"file_type\": 7,
\"start\": \"2025-01-01 00:00:00\",
\"end\": \"2025-01-31 23:59:59\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/dddrequests"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "123",
"file_type": 7,
"start": "2025-01-01 00:00:00",
"end": "2025-01-31 23:59:59"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/dddrequests';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => '123',
'file_type' => 7,
'start' => '2025-01-01 00:00:00',
'end' => '2025-01-31 23:59:59',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/dddrequests'
payload = {
"object_id": "123",
"file_type": 7,
"start": "2025-01-01 00:00:00",
"end": "2025-01-31 23:59:59"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"data": {
"id": 1,
"object_id": "123",
"file_type": 7,
"handled": 0
}
}
Example response (400):
{
"message": "Request_In_Progress"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create DDD log request
requires authentication
Creates a new DDD log request entry to track download sessions.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/dddrequest" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"123\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/dddrequest"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/dddrequest';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => '123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/dddrequest'
payload = {
"object_id": "123"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"data": {
"id": 1,
"object_id": "123",
"sender": "user@example.com"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Close DDD log request
requires authentication
Marks a DDD log request as closed by setting the stop time.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/dddrequest/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/dddrequest/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/dddrequest/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/dddrequest/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers)
response.json()Example response (200, Success):
{
"data": {
"id": 1,
"object_id": "123",
"stop_time": "2025-01-15 10:00:00"
}
}
Example response (404):
{
"message": "Not Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Drivers
Closed Registrations
Closed driver-vehicle registration records filtered by period.
List closed registrations
requires authentication
Returns closed driver-vehicle registrations for a given date period with optional filters and engine working time.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/closedreg?datetime[]=architecto&driver_id=42&object_id=ABC123&offset=0&limit=30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/closedreg"
);
const params = {
"datetime[0]": "architecto",
"driver_id": "42",
"object_id": "ABC123",
"offset": "0",
"limit": "30",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/closedreg';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'driver_id' => '42',
'object_id' => 'ABC123',
'offset' => '0',
'limit' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/closedreg'
params = {
'datetime[0]': 'architecto',
'driver_id': '42',
'object_id': 'ABC123',
'offset': '0',
'limit': '30',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": 1,
"object_id": "ABC123",
"driver_id": 42,
"name": "John",
"fname": "Doe",
"startUse": "2026-01-15 08:00:00",
"stopUse": "2026-01-15 17:00:00",
"code": "A1",
"mode": 1,
"m_on": "08:30:00"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
QR Codes
Generate QR code images for vehicle objects.
Generate QR code
requires authentication
Returns a PNG image of a QR code containing the given object ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/qrcode/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/qrcode/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/qrcode/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/qrcode/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
<Binary PNG image>
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Vehicle Registration (QR Code)
Register and unregister driver-vehicle assignments via QR code scanning.
List the recent registrations
requires authentication
Returns the last 10 driver-vehicle registration records for the current driver.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehicledriversqr" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehicledriversqr"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicledriversqr';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicledriversqr'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"object_id": "ABC123",
"driver_id": 42,
"startUse": "2026-01-15 08:00:00",
"stopUse": "2026-01-15 17:00:00"
}
]
Example response (400, No driver ID):
{
"message": "No_Driver_Id"
}
Example response (403, Not a driver):
{
"message": "Drivers_Only"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Register a vehicle
requires authentication
Creates a new driver-vehicle registration via QR code. Auto-closes any existing registration for the vehicle. Requires a vehicle status check if the VehStatusCheck module is active.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/vehicledriversqr" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"check_id\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehicledriversqr"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"check_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicledriversqr';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'check_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicledriversqr'
payload = {
"object_id": "ABC123",
"check_id": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"object_id": "ABC123",
"driver_id": 42,
"startUse": "2026-01-15 08:00:00",
"stopUse": null
}
Example response (400, Driver busy):
{
"message": "Driver_Is_Busy"
}
Example response (400, Already registered):
{
"message": "Driver_Is_Already_Registered"
}
Example response (400, In repair):
{
"message": "Vehicle_Already_In_Repair"
}
Example response (400, Check missing):
{
"message": "Veh_Check_Missing"
}
Example response (403, Object not allowed):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Close registration
requires authentication
Closes the active driver-vehicle registration. If no active registration exists, returns the last closed record.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/vehicledriversqr" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehicledriversqr"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicledriversqr';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicledriversqr'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers)
response.json()Example response (200, Closed):
{
"id": 1,
"object_id": "ABC123",
"driver_id": 42,
"startUse": "2026-01-15 08:00:00",
"stopUse": "2026-01-15 17:00:00"
}
Example response (200, No active):
{
"id": 1,
"object_id": "ABC123",
"driver_id": 42,
"startUse": "2026-01-14 08:00:00",
"stopUse": "2026-01-14 17:00:00"
}
Example response (403, Not a driver):
{
"message": "Drivers_Only"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Vehicle Registration (Booking)
Register driver-vehicle assignments via booking records.
Register a vehicle via booking
requires authentication
Creates a new driver-vehicle registration from a booking record. Validates that the booking period is current and the driver matches the booking assignment.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/vehicledriversbooking" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"booking_id\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehicledriversbooking"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"booking_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicledriversbooking';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'booking_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicledriversbooking'
payload = {
"booking_id": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"object_id": "ABC123",
"driver_id": 42,
"startUse": "2026-01-15 08:00:00",
"stopUse": null
}
Example response (400, Period not current):
{
"message": "Period_Must_Be_Now"
}
Example response (400, Driver busy):
{
"message": "Driver_Is_Busy"
}
Example response (400, Already registered):
{
"message": "Driver_Is_Already_Registered"
}
Example response (403, Driver mismatch):
{
"message": "NotAllowed"
}
Example response (404, Booking not found):
{
"message": "NotFound"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Registration Edit
Edit fuel data on driver-vehicle registration records.
Update fuel data
requires authentication
Updates fuel fields (fuelStart, fuelEnd, billFuel) on a driver-vehicle registration record. Requires extended user permissions.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/vehicle/drivers/edit/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"fuelStart\": 45.5,
\"fuelEnd\": 30.2,
\"billFuel\": 15.3
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehicle/drivers/edit/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"fuelStart": 45.5,
"fuelEnd": 30.2,
"billFuel": 15.3
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicle/drivers/edit/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'fuelStart' => 45.5,
'fuelEnd' => 30.2,
'billFuel' => 15.3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicle/drivers/edit/1'
payload = {
"fuelStart": 45.5,
"fuelEnd": 30.2,
"billFuel": 15.3
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"driver_id": 42,
"name": "John",
"fname": "Doe",
"driverCode": "A1",
"code": "QR1",
"startUse": "2026-01-15 08:00:00",
"stopUse": "2026-01-15 17:00:00",
"fuelStart": 45.5,
"fuelEnd": 30.2,
"billFuel": 15.3
}
Example response (403, Not allowed):
{
"message": "NotAllowed"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Vehicle Registrations
Manage driver-vehicle registration records (manual assignment by dispatchers).
List active registrations
requires authentication
Returns all currently active (open) driver-vehicle registration records.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehicle/drivers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehicle/drivers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicle/drivers';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicle/drivers'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"object_id": "ABC123",
"driver_id": 42,
"name": "John",
"fname": "Doe",
"code": "A1",
"startUse": "2026-01-15 08:00:00",
"stopUse": null
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get registration
requires authentication
Returns a single driver-vehicle registration record by ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehicle/drivers/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehicle/drivers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicle/drivers/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicle/drivers/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"driver_id": 42,
"name": "John",
"fname": "Doe",
"code": "A1",
"startUse": "2026-01-15 08:00:00",
"stopUse": "2026-01-15 17:00:00"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create registration
requires authentication
Creates a new driver-vehicle registration. Validates that the period is valid and neither the vehicle nor driver is currently busy.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/vehicle/drivers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"startUse\": \"2026-01-15 08:00:00\",
\"stopUse\": \"2026-01-15 17:00:00\",
\"driver_id\": 42
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehicle/drivers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"startUse": "2026-01-15 08:00:00",
"stopUse": "2026-01-15 17:00:00",
"driver_id": 42
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicle/drivers';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'startUse' => '2026-01-15 08:00:00',
'stopUse' => '2026-01-15 17:00:00',
'driver_id' => 42,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicle/drivers'
payload = {
"object_id": "ABC123",
"startUse": "2026-01-15 08:00:00",
"stopUse": "2026-01-15 17:00:00",
"driver_id": 42
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"object_id": "ABC123",
"driver_id": 42,
"name": "John",
"fname": "Doe",
"code": "A1",
"startUse": "2026-01-15 08:00:00",
"stopUse": null
}
Example response (400, Wrong period):
{
"message": "Wrong_Period"
}
Example response (400, Vehicle busy):
{
"message": "Vehicle_Is_Busy"
}
Example response (400, Driver busy):
{
"message": "Driver_Is_Busy"
}
Example response (404, Driver not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update registration
requires authentication
Updates an existing driver-vehicle registration record. Validates period and driver availability when changing the driver.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/vehicle/drivers/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"startUse\": \"2026-01-15 08:00:00\",
\"stopUse\": \"2026-01-15 17:00:00\",
\"driver_id\": 42
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehicle/drivers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"startUse": "2026-01-15 08:00:00",
"stopUse": "2026-01-15 17:00:00",
"driver_id": 42
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicle/drivers/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'startUse' => '2026-01-15 08:00:00',
'stopUse' => '2026-01-15 17:00:00',
'driver_id' => 42,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicle/drivers/1'
payload = {
"object_id": "ABC123",
"startUse": "2026-01-15 08:00:00",
"stopUse": "2026-01-15 17:00:00",
"driver_id": 42
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"driver_id": 42,
"name": "John",
"fname": "Doe",
"code": "A1",
"startUse": "2026-01-15 08:00:00",
"stopUse": "2026-01-15 17:00:00"
}
Example response (400, Wrong period):
{
"message": "Wrong_Period"
}
Example response (400, Driver busy):
{
"message": "Driver_Is_Busy_Long"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete registration
requires authentication
Deletes a driver-vehicle registration record.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/vehicle/drivers/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehicle/drivers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicle/drivers/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicle/drivers/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (403, Constraint violation):
{
"message": "Constraint_violation"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Driver Keys
Manage driver identification keys (RFID, iButton, etc.).
List all keys
requires authentication
Returns all driver keys with associated driver and user information.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/driverkeys" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/driverkeys"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/driverkeys';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/driverkeys'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"name": "Main Key",
"code": "KEY001",
"type": 1,
"driver": 1,
"dr_id": 42,
"driverName": "John",
"fname": "Doe",
"driverCardId": "DC001",
"user": "USR1",
"userName": "Admin"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a key
requires authentication
Returns a single driver key record by ID with the decoded change log.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/driverkeys/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/driverkeys/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/driverkeys/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/driverkeys/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"name": "Main Key",
"code": "KEY001",
"type": 1,
"driver": 1,
"dr_id": null,
"driverName": null,
"fname": null,
"driverCardId": null,
"user": null,
"userName": null
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a key
requires authentication
Creates a new driver key record.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/driverkeys" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Main Key\",
\"code\": \"KEY001\",
\"type\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/driverkeys"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Main Key",
"code": "KEY001",
"type": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/driverkeys';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Main Key',
'code' => 'KEY001',
'type' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/driverkeys'
payload = {
"name": "Main Key",
"code": "KEY001",
"type": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"name": "Main Key",
"code": "KEY001",
"type": 1,
"driver": null,
"dr_id": null,
"driverName": null,
"fname": null,
"driverCardId": null,
"user": null,
"userName": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update key
requires authentication
Updates a driver key record. Only changed fields are persisted and logged.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/driverkeys/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Main Key\",
\"code\": \"KEY001\",
\"driver\": 1,
\"type\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/driverkeys/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Main Key",
"code": "KEY001",
"driver": 1,
"type": 1
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/driverkeys/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Main Key',
'code' => 'KEY001',
'driver' => 1,
'type' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/driverkeys/1'
payload = {
"name": "Main Key",
"code": "KEY001",
"driver": 1,
"type": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 1,
"name": "Updated Key",
"code": "KEY001",
"type": 1,
"driver": 1
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete key
requires authentication
Deletes a driver key record.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/driverkeys/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/driverkeys/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/driverkeys/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/driverkeys/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (403, Constraint violation):
{
"message": "Constraint_violation"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Drivers
Manage driver records with key assignment tracking and change logging.
List drivers
requires authentication
Returns all drivers with optional filtering by user association and archive status.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/drivers?usersOnly=1&archive=0" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/drivers"
);
const params = {
"usersOnly": "1",
"archive": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/drivers';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'usersOnly' => '1',
'archive' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/drivers'
params = {
'usersOnly': '1',
'archive': '0',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": 1,
"name": "John",
"fname": "Doe",
"full_name": "John Doe",
"gsm": "+37255512345",
"comment": "Senior driver",
"p1": null,
"p2": null,
"p3": null,
"user_id": null,
"driverCardId": "DC001",
"key_id": 1,
"code": "KEY001",
"keyName": "Main Key",
"driver": 1,
"archive": 0
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get the driver
requires authentication
Returns a single driver record by ID with a decoded change log.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/drivers/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/drivers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/drivers/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/drivers/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"name": "John",
"fname": "Doe",
"full_name": "John Doe",
"gsm": "+37255512345",
"comment": null,
"p1": null,
"p2": null,
"p3": null,
"user_id": null,
"driverCardId": "DC001",
"key_id": 1,
"code": "KEY001",
"keyName": "Main Key",
"driver": 1,
"archive": 0
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create the driver
requires authentication
Creates a new driver record. If a key_id is provided and already assigned to another driver, the key is released from the previous driver first.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/drivers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"John\",
\"fname\": \"Doe\",
\"gsm\": \"+37255512345\",
\"comment\": \"Senior driver\",
\"key_id\": 1,
\"p1\": \"Value 1\",
\"p2\": \"Value 2\",
\"p3\": \"Value 3\",
\"archive\": 0
}"
const url = new URL(
"https://testapi.metrotec.ee/api/drivers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "John",
"fname": "Doe",
"gsm": "+37255512345",
"comment": "Senior driver",
"key_id": 1,
"p1": "Value 1",
"p2": "Value 2",
"p3": "Value 3",
"archive": 0
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/drivers';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'John',
'fname' => 'Doe',
'gsm' => '+37255512345',
'comment' => 'Senior driver',
'key_id' => 1,
'p1' => 'Value 1',
'p2' => 'Value 2',
'p3' => 'Value 3',
'archive' => 0,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/drivers'
payload = {
"name": "John",
"fname": "Doe",
"gsm": "+37255512345",
"comment": "Senior driver",
"key_id": 1,
"p1": "Value 1",
"p2": "Value 2",
"p3": "Value 3",
"archive": 0
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"name": "John",
"fname": "Doe",
"full_name": "John Doe",
"gsm": "+37255512345",
"comment": null,
"p1": null,
"p2": null,
"p3": null,
"user_id": null,
"driverCardId": null,
"key_id": 1,
"code": "KEY001",
"keyName": "Main Key",
"driver": 1,
"archive": 0
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update driver
requires authentication
Updates a driver record. Handles key reassignment with logging when key_id changes.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/drivers/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"John\",
\"fname\": \"Doe\",
\"gsm\": \"+37255512345\",
\"comment\": \"Senior driver\",
\"key_id\": 1,
\"p1\": \"Value 1\",
\"p2\": \"Value 2\",
\"p3\": \"Value 3\",
\"archive\": 0
}"
const url = new URL(
"https://testapi.metrotec.ee/api/drivers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "John",
"fname": "Doe",
"gsm": "+37255512345",
"comment": "Senior driver",
"key_id": 1,
"p1": "Value 1",
"p2": "Value 2",
"p3": "Value 3",
"archive": 0
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/drivers/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'John',
'fname' => 'Doe',
'gsm' => '+37255512345',
'comment' => 'Senior driver',
'key_id' => 1,
'p1' => 'Value 1',
'p2' => 'Value 2',
'p3' => 'Value 3',
'archive' => 0,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/drivers/1'
payload = {
"name": "John",
"fname": "Doe",
"gsm": "+37255512345",
"comment": "Senior driver",
"key_id": 1,
"p1": "Value 1",
"p2": "Value 2",
"p3": "Value 3",
"archive": 0
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 1,
"name": "John",
"fname": "Doe",
"full_name": "John Doe",
"gsm": "+37255512345",
"comment": null,
"p1": null,
"p2": null,
"p3": null,
"user_id": null,
"driverCardId": "DC001",
"key_id": 1,
"code": "KEY001",
"keyName": "Main Key",
"driver": 1,
"archive": 0
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete (archive) driver
requires authentication
Archives a driver record, releases assigned key, and cleans up DDD files.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/drivers/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/drivers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/drivers/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/drivers/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Export API
Export API for retrieving last data (current vehicle positions and status).
List all last data (Export API)
requires authentication
Returns the latest data for all vehicles accessible by the authenticated user.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/lastdata" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/lastdata"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/lastdata';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/lastdata'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"ID": 1,
"objectID": "ABC123",
"alias": "Truck 1",
"Xpos": "24.75",
"Ypos": "59.43",
"Counter1": 50.5,
"Counter2": 0,
"GMTime": "2025-01-15 14:30:00",
"Speed": 60,
"Heading": 180,
"Input": 0,
"LastCommunicationLocalTime": "2025-01-15 16:30:00",
"Content": "",
"Power": 12.5,
"BatLevel": 4.2,
"NoGPSFix": 0,
"t1": 0,
"t2": 0,
"t3": 0,
"t4": 0,
"Counter": 1475,
"GroupID": 1,
"GroupName": "Trucks",
"Odo": 150000,
"MotoHrs": 3500,
"status": null
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show last data by vehicle (Export API)
requires authentication
Returns the latest data for a specific vehicle.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/lastdata/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/lastdata/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/lastdata/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/lastdata/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"ID": 1,
"objectID": "ABC123",
"alias": "Truck 1",
"Xpos": "24.75",
"Ypos": "59.43",
"Counter1": 50.5,
"Counter2": 0,
"GMTime": "2025-01-15 14:30:00",
"Speed": 60,
"Heading": 180,
"Input": 0,
"LastCommunicationLocalTime": "2025-01-15 16:30:00",
"Content": "",
"Power": 12.5,
"BatLevel": 4.2,
"NoGPSFix": 0,
"t1": 0,
"t2": 0,
"t3": 0,
"t4": 0,
"Counter": 1475,
"GroupID": 1,
"GroupName": "Trucks",
"Odo": 150000,
"MotoHrs": 3500,
"status": null
}
Example response (404, Not found):
{
"error": "Vehicle_Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List all drive reports (Export API)
requires authentication
Returns drive reports for all vehicles within a date range. The maximum period is 7 days.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/drivereport/2025-01-1508:00:00/2025-01-1517:00:00" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/drivereport/2025-01-1508:00:00/2025-01-1517:00:00"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/drivereport/2025-01-1508:00:00/2025-01-1517:00:00';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/drivereport/2025-01-1508:00:00/2025-01-1517:00:00'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"ID": 1,
"objectID": "ABC123",
"startTime": "2025-01-15 08:30:00",
"previousStopTime": "2025-01-15 08:00:00",
"stopTime": "2025-01-15 09:15:00",
"stopEnd": "2025-01-15 09:20:00",
"routeLengthKM": 45.2,
"drivingTimeSeconds": 2700,
"pauseTimeSeconds": 300,
"averageSpeed": 60,
"maxSpeed": 90,
"AddressAtStartingPoint": "Main St 1",
"AddressAtEndPoint": "Oak Ave 5",
"status": 0,
"driverCardId": "DRV001",
"driverName": "John Doe"
}
]
Example response (400, Period too long):
{
"error": "Ordered period should not exceed 7 days"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show drive reports by vehicle (Export API)
requires authentication
Returns drive reports for a specific vehicle within a date range. The maximum period is 7 days.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/drivereport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/drivereport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/drivereport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/drivereport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"ID": 1,
"objectID": "ABC123",
"startTime": "2025-01-15 08:30:00",
"previousStopTime": "2025-01-15 08:00:00",
"stopTime": "2025-01-15 09:15:00",
"stopEnd": "2025-01-15 09:20:00",
"routeLengthKM": 45.2,
"drivingTimeSeconds": 2700,
"pauseTimeSeconds": 300,
"averageSpeed": 60,
"maxSpeed": 90,
"AddressAtStartingPoint": "Main St 1",
"AddressAtEndPoint": "Oak Ave 5",
"status": 0,
"driverCardId": "DRV001",
"driverName": "John Doe"
}
]
Example response (400, Period too long):
{
"error": "Ordered period should not exceed 7 days"
}
Example response (404, Not found):
{
"error": "Vehicle_Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List all fuel reports (Export API)
requires authentication
Returns fuel reports for all vehicles within a date range. The maximum period is 7 days.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/fuelreport/2025-01-1508:00:00/2025-01-1517:00:00" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/fuelreport/2025-01-1508:00:00/2025-01-1517:00:00"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fuelreport/2025-01-1508:00:00/2025-01-1517:00:00';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fuelreport/2025-01-1508:00:00/2025-01-1517:00:00'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"ID": 1,
"objectID": "ABC123",
"startTime": "2025-01-15 08:00:00",
"stopTime": "2025-01-15 08:30:00",
"maxTime": "2025-01-15 08:30:00",
"fuelBeforeL": 120.5,
"fuelAfterL": 180,
"routeLengthKM": 25.3,
"fuelAddress": "Main St 1"
}
]
Example response (400, Period too long):
{
"error": "Ordered period should not exceed 7 days"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show fuel reports by vehicle (Export API)
requires authentication
Returns fuel reports for a specific vehicle within a date range. The maximum period is 7 days.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/fuelreport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/fuelreport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fuelreport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fuelreport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"ID": 1,
"objectID": "ABC123",
"startTime": "2025-01-15 08:00:00",
"stopTime": "2025-01-15 08:30:00",
"maxTime": "2025-01-15 08:30:00",
"fuelBeforeL": 120.5,
"fuelAfterL": 180,
"routeLengthKM": 25.3,
"fuelAddress": "Main St 1"
}
]
Example response (400, Period too long):
{
"error": "Ordered period should not exceed 7 days"
}
Example response (404, Not found):
{
"error": "Vehicle_Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List all engine reports (Export API)
requires authentication
Returns engine reports for all vehicles within a date range. The maximum period is 7 days.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/enginereport/2025-01-1508:00:00/2025-01-1517:00:00" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/enginereport/2025-01-1508:00:00/2025-01-1517:00:00"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/enginereport/2025-01-1508:00:00/2025-01-1517:00:00';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/enginereport/2025-01-1508:00:00/2025-01-1517:00:00'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"ID": 1,
"objectID": "ABC123",
"startTime": "2025-01-15 08:00:00",
"stopTime": "2025-01-15 09:30:00",
"stopEnd": "2025-01-15 09:35:00",
"runningTime": "01:30:00",
"input": 7,
"status": 0,
"distance": 45.2,
"fuel": 12.5
}
]
Example response (400, Period too long):
{
"error": "Ordered period should not exceed 7 days"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show engine reports by vehicle (Export API)
requires authentication
Returns engine reports for a specific vehicle within a date range. The maximum period is 7 days.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/enginereport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/enginereport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/enginereport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/enginereport/2025-01-1508:00:00/2025-01-1517:00:00/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"ID": 1,
"objectID": "ABC123",
"startTime": "2025-01-15 08:00:00",
"stopTime": "2025-01-15 09:30:00",
"stopEnd": "2025-01-15 09:35:00",
"runningTime": "01:30:00",
"input": 7,
"status": 0,
"distance": 45.2,
"fuel": 12.5
}
]
Example response (400, Period too long):
{
"error": "Ordered period should not exceed 7 days"
}
Example response (404, Not found):
{
"error": "Vehicle_Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show route log entry (Export API)
requires authentication
Returns the last route log entry before the given time for a specific vehicle, including reverse geocoded location.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/routelog/2025-01-1508:00:00/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/routelog/2025-01-1508:00:00/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routelog/2025-01-1508:00:00/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routelog/2025-01-1508:00:00/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"GMTime": "2025-01-15 07:58:00",
"fuel": 120.5,
"lat": "59.43",
"lon": "24.75",
"input": 64,
"t1": 21,
"t2": 0,
"t3": 0,
"t4": 0,
"location": "Estonia, Tallinn, Main St 1"
}
Example response (404, Not found):
{
"error": "Vehicle_Not_Found"
}
Example response (404, No data):
{
"error": "Data_Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List all driver assignments (Export API)
requires authentication
Returns driver-vehicle assignments for all vehicles within a date range. The maximum period is 7 days.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/drivers/2025-01-1508:00:00/2025-01-1517:00:00" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/drivers/2025-01-1508:00:00/2025-01-1517:00:00"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/drivers/2025-01-1508:00:00/2025-01-1517:00:00';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/drivers/2025-01-1508:00:00/2025-01-1517:00:00'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"objectID": "ABC123",
"startUse": "2025-01-15 08:00:00",
"stopUse": "2025-01-15 17:00:00",
"name": "John Doe"
}
]
Example response (400, Period too long):
{
"error": "Ordered period should not exceed 7 days"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show driver assignments by vehicle (Export API)
requires authentication
Returns driver-vehicle assignments for a specific vehicle within a date range. The maximum period is 7 days.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/drivers/2025-01-1508:00:00/2025-01-1517:00:00/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/drivers/2025-01-1508:00:00/2025-01-1517:00:00/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/drivers/2025-01-1508:00:00/2025-01-1517:00:00/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/drivers/2025-01-1508:00:00/2025-01-1517:00:00/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"objectID": "ABC123",
"startUse": "2025-01-15 08:00:00",
"stopUse": "2025-01-15 17:00:00",
"name": "John Doe"
}
]
Example response (400, Period too long):
{
"error": "Ordered period should not exceed 7 days"
}
Example response (404, Not found):
{
"error": "Vehicle_Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List all stock data (Export API)
requires authentication
Returns the latest stock data for all vehicles accessible by the authenticated user. Includes tank and customer mapping information.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/stockdata" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/stockdata"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/stockdata';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/stockdata'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"ID": 1,
"objectID": "ABC123",
"alias": "Tank 1",
"Xpos": "24.75",
"Ypos": "59.43",
"Counter1": 50.5,
"Counter2": 0,
"GMTime": "2025-01-15 14:30:00",
"Speed": 0,
"Heading": 180,
"Input": 0,
"LastCommunicationLocalTime": "2025-01-15 16:30:00",
"Content": "",
"Power": 12.5,
"BatLevel": 4.2,
"NoGPSFix": 0,
"t1": 0,
"t2": 0,
"t3": 0,
"t4": 0,
"Counter": 1475,
"GroupID": 1,
"GroupName": "Tanks",
"Odo": 0,
"MotoHrs": 0,
"status": null,
"CustomerID": "CUST001",
"TankNr": "T-100",
"next_refill_time": "2025-01-20 08:00:00",
"tank_vol": 5000
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show stock data by vehicle (Export API)
requires authentication
Returns the latest stock data for a specific vehicle.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/stockdata/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/stockdata/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/stockdata/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/stockdata/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"ID": 1,
"objectID": "ABC123",
"alias": "Tank 1",
"Xpos": "24.75",
"Ypos": "59.43",
"Counter1": 50.5,
"Counter2": 0,
"GMTime": "2025-01-15 14:30:00",
"Speed": 0,
"Heading": 180,
"Input": 0,
"LastCommunicationLocalTime": "2025-01-15 16:30:00",
"Content": "",
"Power": 12.5,
"BatLevel": 4.2,
"NoGPSFix": 0,
"t1": 0,
"t2": 0,
"t3": 0,
"t4": 0,
"Counter": 1475,
"GroupID": 1,
"GroupName": "Tanks",
"Odo": 0,
"MotoHrs": 0,
"status": null,
"CustomerID": "CUST001",
"TankNr": "T-100",
"next_refill_time": "2025-01-20 08:00:00",
"tank_vol": 5000
}
Example response (404, Not found):
{
"error": "Vehicle_Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Files
APIs for managing files
Get all files for a pivot
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/files?pivot_type=route_tasks&pivot_id=12345" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/files"
);
const params = {
"pivot_type": "route_tasks",
"pivot_id": "12345",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/files';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'pivot_type' => 'route_tasks',
'pivot_id' => '12345',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/files'
params = {
'pivot_type': 'route_tasks',
'pivot_id': '12345',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
[
{
"id": 1,
"pivot_id": "12345",
"pivot_type": "route_tasks",
"defined_name": "document.pdf",
"mime": "application/pdf",
"file_type": "other",
"uploaded_at": "2025-11-28T10:00:00.000000Z",
"url": "https://api.example.com/cli_img/metrotec_12345_abc123.pdf"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Upload a new file
requires authentication
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/files" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "pivot_type=route_tasks"\
--form "pivot_id=12345"\
--form "max_files=5"\
--form "hidden="\
--form "file_type=image"\
--form "auto_crop="\
--form "auto_type=webp"\
--form "file=@/tmp/phpp3uj6i8dc8fl41KzTYv" const url = new URL(
"https://testapi.metrotec.ee/api/files"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('pivot_type', 'route_tasks');
body.append('pivot_id', '12345');
body.append('max_files', '5');
body.append('hidden', '');
body.append('file_type', 'image');
body.append('auto_crop', '');
body.append('auto_type', 'webp');
body.append('file', document.querySelector('input[name="file"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/files';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'pivot_type',
'contents' => 'route_tasks'
],
[
'name' => 'pivot_id',
'contents' => '12345'
],
[
'name' => 'max_files',
'contents' => '5'
],
[
'name' => 'hidden',
'contents' => ''
],
[
'name' => 'file_type',
'contents' => 'image'
],
[
'name' => 'auto_crop',
'contents' => ''
],
[
'name' => 'auto_type',
'contents' => 'webp'
],
[
'name' => 'file',
'contents' => fopen('/tmp/phpp3uj6i8dc8fl41KzTYv', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/files'
files = {
'pivot_type': (None, 'route_tasks'),
'pivot_id': (None, '12345'),
'max_files': (None, '5'),
'hidden': (None, ''),
'file_type': (None, 'image'),
'auto_crop': (None, ''),
'auto_type': (None, 'webp'),
'file': open('/tmp/phpp3uj6i8dc8fl41KzTYv', 'rb')}
payload = {
"pivot_type": "route_tasks",
"pivot_id": "12345",
"max_files": 5,
"hidden": false,
"file_type": "image",
"auto_crop": false,
"auto_type": "webp"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'multipart/form-data',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, files=files)
response.json()Example response (201):
{
"id": 1,
"pivot_id": "12345",
"pivot_type": "route_tasks",
"defined_name": "document.pdf",
"mime": "application/pdf",
"file_type": "other",
"uploaded_at": "2025-11-28T10:00:00.000000Z",
"url": "https://api.example.com/cli_img/metrotec_12345_abc123.pdf"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a specific file
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/files/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/files/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/files/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/files/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"id": 1,
"pivot_id": "12345",
"pivot_type": "route_tasks",
"defined_name": "document.pdf",
"mime": "application/pdf",
"file_type": "other",
"uploaded_at": "2025-11-28T10:00:00.000000Z",
"url": "https://api.example.com/cli_img/metrotec_12345_abc123.pdf"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a file
requires authentication
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/files/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_type\": \"cmr\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/files/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_type": "cmr"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/files/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_type' => 'cmr',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/files/1'
payload = {
"file_type": "cmr"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"id": 1,
"pivot_id": "12345",
"pivot_type": "route_tasks",
"defined_name": "document.pdf",
"mime": "application/pdf",
"file_type": "cmr",
"uploaded_at": "2025-11-28T10:00:00.000000Z",
"url": "https://api.example.com/cli_img/metrotec_12345_abc123.pdf"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a file
requires authentication
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/files/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/files/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/files/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/files/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, success):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add a drawing overlay to an existing image
requires authentication
Takes an existing image file and overlays a PNG drawing on top of it. The original file is replaced with the new combined image.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/drawing/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "file=@/tmp/phpl031pv126jae23gzKkj" const url = new URL(
"https://testapi.metrotec.ee/api/drawing/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('file', document.querySelector('input[name="file"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/drawing/1';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'file',
'contents' => fopen('/tmp/phpl031pv126jae23gzKkj', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/drawing/1'
files = {
'file': open('/tmp/phpl031pv126jae23gzKkj', 'rb')}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'multipart/form-data',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, files=files)
response.json()Example response (201):
{
"id": 1,
"pivot_id": "12345",
"pivot_type": "route_tasks",
"defined_name": "photo.png",
"mime": "image/png",
"file_type": "image",
"uploaded_at": "2025-11-28T10:00:00.000000Z",
"url": "https://api.example.com/cli_img/metrotec_12345_abc123.png"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Upload signature for route tasks
requires authentication
Uploads a signature image and associates it with one or more route tasks.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/signature" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "ids[]=16"\
--form "pivot_type=signatures"\
--form "file_type=receiver_signature"\
--form "signature=@/tmp/phpaogu7viggt9j9tpUN0A" const url = new URL(
"https://testapi.metrotec.ee/api/signature"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('ids[]', '16');
body.append('pivot_type', 'signatures');
body.append('file_type', 'receiver_signature');
body.append('signature', document.querySelector('input[name="signature"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/signature';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'ids[]',
'contents' => '16'
],
[
'name' => 'pivot_type',
'contents' => 'signatures'
],
[
'name' => 'file_type',
'contents' => 'receiver_signature'
],
[
'name' => 'signature',
'contents' => fopen('/tmp/phpaogu7viggt9j9tpUN0A', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/signature'
files = {
'ids[]': (None, '16'),
'pivot_type': (None, 'signatures'),
'file_type': (None, 'receiver_signature'),
'signature': open('/tmp/phpaogu7viggt9j9tpUN0A', 'rb')}
payload = {
"ids": [
16
],
"pivot_type": "signatures",
"file_type": "receiver_signature"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'multipart/form-data',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, files=files)
response.json()Example response (201):
[
{
"id": 1,
"pivot_id": "12345",
"pivot_type": "signatures",
"defined_name": "signature.png",
"mime": "image/png",
"file_type": "receiver_signature",
"uploaded_at": "2025-11-28T10:00:00.000000Z",
"url": "https://api.example.com/signatures/metrotec_12345_abc123.png"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Geo Zones
Geo zones management
List geo zones
requires authentication
Returns all geo zones with their objects.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/geozones" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/geozones"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/geozones';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/geozones'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{"data": [{"id": 1, "name": "Zone A", "geometry": {...}, "zObjects": []}]}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get geo zone
requires authentication
Returns a single geo zone with full details.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/geozones/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/geozones/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/geozones/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/geozones/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{"data": {"id": 1, "name": "Zone A", "geometry": {...}, "zObjects": [], "cAlarmState": false}}
Example response (404):
{
"message": "noGeozoneError"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create geo zone
requires authentication
Creates a new geo zone.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/geozones" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"geometry\": {
\"type\": \"Polygon\",
\"coordinates\": [
[
[
24.7,
59.4
],
[
24.8,
59.4
],
[
24.8,
59.5
],
[
24.7,
59.5
],
[
24.7,
59.4
]
]
],
\"radius\": 4326.41688
},
\"name\": \"Warehouse Zone\",
\"cAlarmState\": false,
\"countAlarm\": 2,
\"zObjects\": [
\"architecto\"
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/geozones"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
24.7,
59.4
],
[
24.8,
59.4
],
[
24.8,
59.5
],
[
24.7,
59.5
],
[
24.7,
59.4
]
]
],
"radius": 4326.41688
},
"name": "Warehouse Zone",
"cAlarmState": false,
"countAlarm": 2,
"zObjects": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/geozones';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'geometry' => [
'type' => 'Polygon',
'coordinates' => [
[
[
24.7,
59.4,
],
[
24.8,
59.4,
],
[
24.8,
59.5,
],
[
24.7,
59.5,
],
[
24.7,
59.4,
],
],
],
'radius' => 4326.41688,
],
'name' => 'Warehouse Zone',
'cAlarmState' => false,
'countAlarm' => 2,
'zObjects' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/geozones'
payload = {
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
24.7,
59.4
],
[
24.8,
59.4
],
[
24.8,
59.5
],
[
24.7,
59.5
],
[
24.7,
59.4
]
]
],
"radius": 4326.41688
},
"name": "Warehouse Zone",
"cAlarmState": false,
"countAlarm": 2,
"zObjects": [
"architecto"
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"data": {
"id": 1,
"name": "Zone A"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update geo zone
requires authentication
Updates an existing geo zone.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/geozones/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"geometry\": {
\"type\": \"Polygon\",
\"coordinates\": [
[
[
24.7,
59.4
],
[
24.8,
59.4
],
[
24.8,
59.5
],
[
24.7,
59.5
],
[
24.7,
59.4
]
]
],
\"radius\": 4326.41688
},
\"name\": \"Warehouse Zone\",
\"cAlarmState\": false,
\"countAlarm\": 2,
\"zObjects\": [
\"architecto\"
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/geozones/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
24.7,
59.4
],
[
24.8,
59.4
],
[
24.8,
59.5
],
[
24.7,
59.5
],
[
24.7,
59.4
]
]
],
"radius": 4326.41688
},
"name": "Warehouse Zone",
"cAlarmState": false,
"countAlarm": 2,
"zObjects": [
"architecto"
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/geozones/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'geometry' => [
'type' => 'Polygon',
'coordinates' => [
[
[
24.7,
59.4,
],
[
24.8,
59.4,
],
[
24.8,
59.5,
],
[
24.7,
59.5,
],
[
24.7,
59.4,
],
],
],
'radius' => 4326.41688,
],
'name' => 'Warehouse Zone',
'cAlarmState' => false,
'countAlarm' => 2,
'zObjects' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/geozones/architecto'
payload = {
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
24.7,
59.4
],
[
24.8,
59.4
],
[
24.8,
59.5
],
[
24.7,
59.5
],
[
24.7,
59.4
]
]
],
"radius": 4326.41688
},
"name": "Warehouse Zone",
"cAlarmState": false,
"countAlarm": 2,
"zObjects": [
"architecto"
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"message": "Updated"
}
Example response (404):
{
"message": "noGeozoneError"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete geo zone
requires authentication
Deletes a geo zone.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/geozones/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/geozones/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/geozones/architecto';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/geozones/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404):
{
"message": "noGeozoneError"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List geo zone object assignments
requires authentication
Returns all object assignments to geo zones.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/geotoobject" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/geotoobject"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/geotoobject';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/geotoobject'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"geozoneID": 1,
"object_id": "123",
"geo_id": 5
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Assign object to geo zone
requires authentication
Creates a new object-to-geozone assignment.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/geotoobject" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"123\",
\"geozoneID\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/geotoobject"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "123",
"geozoneID": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/geotoobject';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => '123',
'geozoneID' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/geotoobject'
payload = {
"object_id": "123",
"geozoneID": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"data": {
"id": 1,
"geozoneID": 1,
"object_id": "123"
}
}
Example response (400):
{
"message": "GeoToObject_Exists"
}
Example response (400):
{
"message": "No_Device_Class"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove object from geo zone
requires authentication
Deletes an object-to-geozone assignment.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/geotoobject/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/geotoobject/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/geotoobject/architecto';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/geotoobject/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (400):
{
"message": "No_Device_Class"
}
Example response (404):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Inputs
Vehicle input name management (digital I/O labels).
List all inputs
requires authentication
Returns all input names grouped by vehicle object ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/inputs" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/inputs"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/inputs';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/inputs'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": "ABC123",
"inputs": [
{
"id": 1,
"nr": 1,
"name": "Ignition",
"color": "#FF0000"
}
]
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show inputs for a vehicle
requires authentication
Returns all input names for a specific vehicle.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/inputs/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/inputs/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/inputs/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/inputs/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"nr": 1,
"name": "Ignition",
"color": "#FF0000",
"object_id": "ABC123"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create input
requires authentication
Creates a new input name for a vehicle. The input number must be unique per vehicle.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/inputs/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"nr\": 1,
\"name\": \"Ignition\",
\"color\": \"#FF0000\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/inputs/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"nr": 1,
"name": "Ignition",
"color": "#FF0000"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/inputs/ABC123';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'nr' => 1,
'name' => 'Ignition',
'color' => '#FF0000',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/inputs/ABC123'
payload = {
"nr": 1,
"name": "Ignition",
"color": "#FF0000"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 5,
"nr": 1,
"name": "Ignition",
"color": "#FF0000",
"object_id": "ABC123"
}
Example response (400, Duplicate nr):
{
"message": "Not_Unique_Input_Nr"
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update input
requires authentication
Updates an existing input name. Input number must remain unique per vehicle.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/inputs/ABC123/5" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"nr\": 1,
\"name\": \"Ignition\",
\"color\": \"#FF0000\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/inputs/ABC123/5"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"nr": 1,
"name": "Ignition",
"color": "#FF0000"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/inputs/ABC123/5';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'nr' => 1,
'name' => 'Ignition',
'color' => '#FF0000',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/inputs/ABC123/5'
payload = {
"nr": 1,
"name": "Ignition",
"color": "#FF0000"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 5,
"nr": 1,
"name": "Ignition On",
"color": "#00FF00",
"object_id": "ABC123"
}
Example response (400, Duplicate nr):
{
"message": "Not_Unique_Input_Nr"
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete input
requires authentication
Deletes an input name record.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/inputs/ABC123/5" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/inputs/ABC123/5"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/inputs/ABC123/5';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/inputs/ABC123/5'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete all inputs for a vehicle
requires authentication
Removes all input name records for a specific vehicle.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/inputs/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/inputs/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/inputs/ABC123';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/inputs/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, Success):
Empty response
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Input Settings
Admin input name settings with object_id in the request body.
List all input settings
requires authentication
Returns all input name records across all vehicles.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/input-settings" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/input-settings"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/input-settings';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/input-settings'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"nr": 1,
"name": "Ignition",
"color": "#FF0000",
"object_id": "ABC123"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show input setting
requires authentication
Returns a single input name record by its ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/input-settings/5" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/input-settings/5"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/input-settings/5';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/input-settings/5'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 5,
"nr": 1,
"name": "Ignition",
"color": "#FF0000",
"object_id": "ABC123"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create input setting
requires authentication
Creates a new input name record. The input number must be unique per vehicle.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/input-settings" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"nr\": 1,
\"name\": \"Ignition\",
\"color\": \"#FF0000\",
\"object_id\": \"ABC123\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/input-settings"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"nr": 1,
"name": "Ignition",
"color": "#FF0000",
"object_id": "ABC123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/input-settings';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'nr' => 1,
'name' => 'Ignition',
'color' => '#FF0000',
'object_id' => 'ABC123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/input-settings'
payload = {
"nr": 1,
"name": "Ignition",
"color": "#FF0000",
"object_id": "ABC123"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 5,
"nr": 1,
"name": "Ignition",
"color": "#FF0000",
"object_id": "ABC123"
}
Example response (400, Duplicate nr):
{
"message": "Not_Unique_Input_Nr"
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update input setting
requires authentication
Updates an existing input name record. The input number must remain unique per vehicle.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/input-settings/5" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"nr\": 1,
\"name\": \"Ignition\",
\"color\": \"#FF0000\",
\"object_id\": \"ABC123\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/input-settings/5"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"nr": 1,
"name": "Ignition",
"color": "#FF0000",
"object_id": "ABC123"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/input-settings/5';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'nr' => 1,
'name' => 'Ignition',
'color' => '#FF0000',
'object_id' => 'ABC123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/input-settings/5'
payload = {
"nr": 1,
"name": "Ignition",
"color": "#FF0000",
"object_id": "ABC123"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 5,
"nr": 1,
"name": "Ignition On",
"color": "#00FF00",
"object_id": "ABC123"
}
Example response (400, Duplicate nr):
{
"message": "Not_Unique_Input_Nr"
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete input setting
requires authentication
Deletes an input name record.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/input-settings/5" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/input-settings/5"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/input-settings/5';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/input-settings/5'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Temperature Names
Temperature sensor name settings per vehicle. The {id} parameter is the vehicle object_id.
List all temperature settings
requires authentication
Returns temperature name records for all vehicles.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/temperature" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/temperature"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/temperature';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/temperature'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": "ABC123",
"temperatures": [
{
"temp_key": "t1",
"name": "Fridge",
"color": "#FF0000"
}
],
"category_name": "Trucks"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show temperature setting
requires authentication
Returns a single temperature name record by vehicle object ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/temperature/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/temperature/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/temperature/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/temperature/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": "ABC123",
"temperatures": [
{
"temp_key": "t1",
"name": "Fridge",
"color": "#FF0000"
}
]
}
Example response (204, Not found):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Upsert temperature setting
requires authentication
Creates or updates temperature names for a vehicle. If a record exists for the given vehicle, it is updated; otherwise a new record is created.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/temperature/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"temperatures\": [
{
\"temp_key\": \"t1\",
\"name\": \"Fridge\",
\"color\": \"#FF0000\"
}
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/temperature/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"temperatures": [
{
"temp_key": "t1",
"name": "Fridge",
"color": "#FF0000"
}
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/temperature/ABC123';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'temperatures' => [
[
'temp_key' => 't1',
'name' => 'Fridge',
'color' => '#FF0000',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/temperature/ABC123'
payload = {
"temperatures": [
{
"temp_key": "t1",
"name": "Fridge",
"color": "#FF0000"
}
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": "ABC123",
"temperatures": [
{
"temp_key": "t1",
"name": "Fridge",
"color": "#FF0000"
}
]
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete temperature setting
requires authentication
Removes temperature names for a vehicle.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/temperature/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/temperature/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/temperature/ABC123';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/temperature/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Invoices
APIs for managing invoices
Get invoices
requires authentication
Returns invoices filtered by date range and other criteria. Unpaid invoices are always included regardless of date filter.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/invoice?datetime%5B%5D=%5B%222025-01-01%22%2C+%222025-01-31%22%5D&oid=metrotec&manager=admin&paid=0&offset=0" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"datetime\": [
\"2025-01-01\",
\"2025-01-31\"
],
\"oid\": \"metrotec\",
\"manager\": \"admin\",
\"paid\": 0,
\"offset\": 0
}"
const url = new URL(
"https://testapi.metrotec.ee/api/invoice"
);
const params = {
"datetime[]": "["2025-01-01", "2025-01-31"]",
"oid": "metrotec",
"manager": "admin",
"paid": "0",
"offset": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"datetime": [
"2025-01-01",
"2025-01-31"
],
"oid": "metrotec",
"manager": "admin",
"paid": 0,
"offset": 0
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/invoice';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[]' => '["2025-01-01", "2025-01-31"]',
'oid' => 'metrotec',
'manager' => 'admin',
'paid' => '0',
'offset' => '0',
],
'json' => [
'datetime' => [
'2025-01-01',
'2025-01-31',
],
'oid' => 'metrotec',
'manager' => 'admin',
'paid' => 0,
'offset' => 0,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/invoice'
payload = {
"datetime": [
"2025-01-01",
"2025-01-31"
],
"oid": "metrotec",
"manager": "admin",
"paid": 0,
"offset": 0
}
params = {
'datetime[]': '["2025-01-01", "2025-01-31"]',
'oid': 'metrotec',
'manager': 'admin',
'paid': '0',
'offset': '0',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (200):
{
"data": [
{
"id": 1,
"inv_date": "2025-01-15 00:00:00",
"payment_date": "2025-02-15 00:00:00",
"inv_sum": 150.5,
"paid": 0,
"name": "Manager Name",
"comments": "Monthly invoice",
"manager": "admin",
"oid": "metrotec",
"inv_name": "Company Name",
"paidD": "unpaid"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Download invoice PDF
requires authentication
Returns the invoice PDF file for download.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/invoice/123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/invoice/123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/invoice/123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/invoice/123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
Binary PDF content
Example response (404):
{
"message": "Not Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Last Data
Send a location link via SMS for a vehicle or POI.
Send location via SMS
requires authentication
Sends a Google Maps location link via SMS for either a vehicle or a POI.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/sendlocation/vehicle/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"country_code\": \"+370\",
\"phone_nr\": \"61234567\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/sendlocation/vehicle/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"country_code": "+370",
"phone_nr": "61234567"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/sendlocation/vehicle/ABC123';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'country_code' => '+370',
'phone_nr' => '61234567',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/sendlocation/vehicle/ABC123'
payload = {
"country_code": "+370",
"phone_nr": "61234567"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"ok": 1
}
Example response (404, Not found):
{
"error": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List all profiles
requires authentication
Returns all last data profiles, filtered optionally by organization ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/lastdataprofile?oid=org123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/lastdataprofile"
);
const params = {
"oid": "org123",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/lastdataprofile';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'oid' => 'org123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/lastdataprofile'
params = {
'oid': 'org123',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": 1,
"oid": "org123",
"mainFields": [
1,
2
],
"hasMore": 1,
"is_hybrid_view": 0,
"main_table": [
3,
4
],
"extended_table": [
5,
6
]
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show a profile
requires authentication
Returns a single last data profile by ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/lastdataprofile/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/lastdataprofile/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/lastdataprofile/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/lastdataprofile/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"oid": "org123",
"mainFields": [
1,
2
],
"hasMore": 1,
"is_hybrid_view": 0,
"main_table": [
3,
4
],
"extended_table": [
5,
6
]
}
Example response (404, Not found):
{
"error": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a profile
requires authentication
Creates a new last data profile. Field arrays are converted from IDs to JSON for storage.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/lastdataprofile" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"oid\": \"org123\",
\"mainFields\": [
1,
2,
3
],
\"hasMore\": true,
\"is_hybrid_view\": false,
\"main_table\": [
1,
2
],
\"extended_table\": [
3,
4
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/lastdataprofile"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"oid": "org123",
"mainFields": [
1,
2,
3
],
"hasMore": true,
"is_hybrid_view": false,
"main_table": [
1,
2
],
"extended_table": [
3,
4
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/lastdataprofile';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'oid' => 'org123',
'mainFields' => [
1,
2,
3,
],
'hasMore' => true,
'is_hybrid_view' => false,
'main_table' => [
1,
2,
],
'extended_table' => [
3,
4,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/lastdataprofile'
payload = {
"oid": "org123",
"mainFields": [
1,
2,
3
],
"hasMore": true,
"is_hybrid_view": false,
"main_table": [
1,
2
],
"extended_table": [
3,
4
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Created):
{
"id": 1,
"oid": "org123",
"mainFields": [
1,
2
],
"hasMore": 1,
"is_hybrid_view": 0,
"main_table": [
3,
4
],
"extended_table": [
5,
6
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a profile
requires authentication
Updates an existing last data profile. Field arrays are converted from IDs to JSON for storage.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/lastdataprofile/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"oid\": \"org123\",
\"mainFields\": [
1,
2,
3
],
\"hasMore\": true,
\"is_hybrid_view\": false,
\"main_table\": [
1,
2
],
\"extended_table\": [
3,
4
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/lastdataprofile/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"oid": "org123",
"mainFields": [
1,
2,
3
],
"hasMore": true,
"is_hybrid_view": false,
"main_table": [
1,
2
],
"extended_table": [
3,
4
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/lastdataprofile/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'oid' => 'org123',
'mainFields' => [
1,
2,
3,
],
'hasMore' => true,
'is_hybrid_view' => false,
'main_table' => [
1,
2,
],
'extended_table' => [
3,
4,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/lastdataprofile/1'
payload = {
"oid": "org123",
"mainFields": [
1,
2,
3
],
"hasMore": true,
"is_hybrid_view": false,
"main_table": [
1,
2
],
"extended_table": [
3,
4
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Updated):
{
"id": 1,
"oid": "org123",
"mainFields": [
1,
2
],
"hasMore": 1,
"is_hybrid_view": 0,
"main_table": [
3,
4
],
"extended_table": [
5,
6
]
}
Example response (404, Not found):
{
"error": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a profile
requires authentication
Deletes a last data profile by ID.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/lastdataprofile/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/lastdataprofile/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/lastdataprofile/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/lastdataprofile/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Deleted):
{
"ok": 1
}
Example response (404, Not found):
{
"error": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Navigation
Retrieve parsed navigation messages for a vehicle.
List navi messages
requires authentication
Returns the last navigation messages (answers and requests) for the given vehicle.
Send navi request
requires authentication
Sends a navigation request to a vehicle. Long messages (FMT/FMS) are split into chunks automatically.
List navi requests (Export API)
requires authentication
Returns navigation requests for a vehicle within a date range. The maximum period is 7 days.
Send navi request (Export API)
requires authentication
Creates a navigation request for a vehicle. Supports MESSAGE, GETDESTINATION, SETLOCATION, CONTROL, and COMMAND types.
List SMS requests (Export API)
requires authentication
Returns SMS requests for a vehicle within a date range. The maximum period is 7 days.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/smsrequests/2025-01-1508:00:00/2025-01-1517:00:00/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/smsrequests/2025-01-1508:00:00/2025-01-1517:00:00/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/smsrequests/2025-01-1508:00:00/2025-01-1517:00:00/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/smsrequests/2025-01-1508:00:00/2025-01-1517:00:00/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"ID": 1,
"objectID": "ABC123",
"Content": "Check engine",
"handled": 0,
"date": "2025-01-15 14:30:00"
}
]
Example response (400, Period too long):
{
"error": "Ordered period should not exceed 7 days"
}
Example response (404, No access):
{
"error": "Vehicle_Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send SMS request (Export API)
requires authentication
Creates an SMS request for a vehicle.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/smsrequests" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"msg\": \"Check engine status\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/smsrequests"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"msg": "Check engine status"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/smsrequests';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'msg' => 'Check engine status',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/smsrequests'
payload = {
"object_id": "ABC123",
"msg": "Check engine status"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Created):
{
"id": 1,
"object_id": "ABC123",
"Content": "Check engine status",
"handled": 0,
"date": "2025-01-15 14:30:00"
}
Example response (401, No access):
{
"error": "Not_Allowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List SMS answers (Export API)
requires authentication
Returns SMS answers for a vehicle within a date range. The maximum period is 7 days.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/smsanswers/2025-01-1508:00:00/2025-01-1517:00:00/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/smsanswers/2025-01-1508:00:00/2025-01-1517:00:00/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/smsanswers/2025-01-1508:00:00/2025-01-1517:00:00/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/smsanswers/2025-01-1508:00:00/2025-01-1517:00:00/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"ID": 1,
"objectID": "ABC123",
"time": "2025-01-15 14:30:00",
"content": "Engine OK"
}
]
Example response (400, Period too long):
{
"error": "Ordered period should not exceed 7 days"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List navi answers (Export API)
requires authentication
Returns navi answers for a vehicle within a date range. Maximum period is 7 days. Content is parsed through the navi text parser (FMA/FMT/FMS formats).
POI
Points of Interest management
List POI
requires authentication
Returns all Points of Interest, optionally filtered by name.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/poi" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"q\": \"Office\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/poi"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"q": "Office"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poi';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'q' => 'Office',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poi'
payload = {
"q": "Office"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"name": "Office",
"lat": 59.437,
"lon": 24.745
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get POI
requires authentication
Returns a single Point of Interest by ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/poi/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/poi/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poi/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poi/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"data": {
"id": 1,
"name": "Office",
"lat": 59.437,
"lon": 24.745
}
}
Example response (404):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create POI
requires authentication
Creates a new Point of Interest.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/poi" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": 1,
\"lon\": 24.745369,
\"lat\": 59.437221,
\"radius\": 100,
\"name\": \"Main Office\",
\"comment\": \"Headquarters\",
\"rgAddress\": \"Narva mnt 5, Tallinn\",
\"phone_nr\": \"5551234\",
\"country_code\": \"+372\",
\"contact_name\": \"John Doe\",
\"purpose\": 0,
\"old_id\": 16
}"
const url = new URL(
"https://testapi.metrotec.ee/api/poi"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": 1,
"lon": 24.745369,
"lat": 59.437221,
"radius": 100,
"name": "Main Office",
"comment": "Headquarters",
"rgAddress": "Narva mnt 5, Tallinn",
"phone_nr": "5551234",
"country_code": "+372",
"contact_name": "John Doe",
"purpose": 0,
"old_id": 16
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poi';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'type' => 1,
'lon' => 24.745369,
'lat' => 59.437221,
'radius' => 100,
'name' => 'Main Office',
'comment' => 'Headquarters',
'rgAddress' => 'Narva mnt 5, Tallinn',
'phone_nr' => '5551234',
'country_code' => '+372',
'contact_name' => 'John Doe',
'purpose' => 0,
'old_id' => 16,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poi'
payload = {
"type": 1,
"lon": 24.745369,
"lat": 59.437221,
"radius": 100,
"name": "Main Office",
"comment": "Headquarters",
"rgAddress": "Narva mnt 5, Tallinn",
"phone_nr": "5551234",
"country_code": "+372",
"contact_name": "John Doe",
"purpose": 0,
"old_id": 16
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"data": {
"id": 1,
"name": "Office",
"lat": 59.437,
"lon": 24.745
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update POI
requires authentication
Updates an existing Point of Interest.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/poi/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": 1,
\"lon\": 24.745369,
\"lat\": 59.437221,
\"radius\": 100,
\"name\": \"Main Office\",
\"comment\": \"Headquarters\",
\"rgAddress\": \"Narva mnt 5, Tallinn\",
\"phone_nr\": \"5551234\",
\"country_code\": \"+372\",
\"contact_name\": \"John Doe\",
\"purpose\": 0
}"
const url = new URL(
"https://testapi.metrotec.ee/api/poi/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": 1,
"lon": 24.745369,
"lat": 59.437221,
"radius": 100,
"name": "Main Office",
"comment": "Headquarters",
"rgAddress": "Narva mnt 5, Tallinn",
"phone_nr": "5551234",
"country_code": "+372",
"contact_name": "John Doe",
"purpose": 0
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poi/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'type' => 1,
'lon' => 24.745369,
'lat' => 59.437221,
'radius' => 100,
'name' => 'Main Office',
'comment' => 'Headquarters',
'rgAddress' => 'Narva mnt 5, Tallinn',
'phone_nr' => '5551234',
'country_code' => '+372',
'contact_name' => 'John Doe',
'purpose' => 0,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poi/architecto'
payload = {
"type": 1,
"lon": 24.745369,
"lat": 59.437221,
"radius": 100,
"name": "Main Office",
"comment": "Headquarters",
"rgAddress": "Narva mnt 5, Tallinn",
"phone_nr": "5551234",
"country_code": "+372",
"contact_name": "John Doe",
"purpose": 0
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"message": "Updated"
}
Example response (404):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete POI
requires authentication
Deletes a Point of Interest.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/poi/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/poi/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poi/architecto';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poi/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Search POI by name
requires authentication
Searches for Points of Interest by name. Returns up to 10 results.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/poisearch" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"q\": \"Office\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/poisearch"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"q": "Office"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poisearch';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'q' => 'Office',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poisearch'
payload = {
"q": "Office"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"lat": 59.437,
"lon": 24.745,
"name": "Office"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List POI groups
requires authentication
Returns all POI groups with custom names merged with defaults.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/poigroups" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/poigroups"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poigroups';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poigroups'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"type_name": "A"
},
{
"id": 2,
"type_name": "B"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update POI group
requires authentication
Updates the name of a POI group. Creates the record if it doesn't exist.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/poigroups/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type_name\": \"Warehouses\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/poigroups/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type_name": "Warehouses"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poigroups/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'type_name' => 'Warehouses',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poigroups/architecto'
payload = {
"type_name": "Warehouses"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"message": "Updated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List POI reports
requires authentication
Returns a list of POI reports with optional filtering.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/poireport" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"in\": [
16
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/poireport"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"in": [
16
]
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poireport';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'in' => [
16,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poireport'
payload = {
"in": [
16
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"status": 0,
"type": "poi",
"group": "vehicle"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get POI report details
requires authentication
Returns detailed rows for a specific POI report.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/poireport/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/poireport/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poireport/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poireport/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"type_name": "Office",
"object_id": 123
}
]
}
Example response (404):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a POI report
requires authentication
Creates a new POI report request.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/poireport" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"datetime\": [
\"2026-02-26T15:34:38\"
],
\"type\": \"poi\",
\"type_id\": 1,
\"group\": \"vehicle\",
\"group_id\": \"123\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/poireport"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"datetime": [
"2026-02-26T15:34:38"
],
"type": "poi",
"type_id": 1,
"group": "vehicle",
"group_id": "123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poireport';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'datetime' => [
'2026-02-26T15:34:38',
],
'type' => 'poi',
'type_id' => 1,
'group' => 'vehicle',
'group_id' => '123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poireport'
payload = {
"datetime": [
"2026-02-26T15:34:38"
],
"type": "poi",
"type_id": 1,
"group": "vehicle",
"group_id": "123"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"data": {
"id": 1,
"status": 0,
"type": "poi"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a POI report
requires authentication
Deletes a POI report by ID.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/poireport/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/poireport/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/poireport/architecto';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/poireport/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reports
Route log data with calculated fields
List route log entries
requires authentication
Returns route log entries with calculated fields (fuel, distance, drive time, CAN data) for the given object and period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/routelog?datetime[]=architecto&obj=ABC123&offset=-1&limit=30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/routelog"
);
const params = {
"datetime[0]": "architecto",
"obj": "ABC123",
"offset": "-1",
"limit": "30",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routelog';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'obj' => 'ABC123',
'offset' => '-1',
'limit' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routelog'
params = {
'datetime[0]': 'architecto',
'obj': 'ABC123',
'offset': '-1',
'limit': '30',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"s": 60,
"v1": 12,
"v2": 50,
"mh": 3600,
"i": 64,
"tt": 120,
"dt": 100,
"t": 1705305600,
"st": 0,
"lt": 59.437,
"ln": 24.753,
"km": 1.5,
"ff": 50,
"tf": 0.5,
"f": 50,
"f1": 25,
"f2": 25,
"d": 1.5,
"t1": null,
"t2": null,
"t3": null,
"t4": null,
"r": 2,
"k": 0,
"odo": null
}
]
}
Example response (403, Object not allowed):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get IO log grouped
requires authentication
Returns grouped IO log entries by day and input, with accumulated distance, fuel, running time, and count. Includes planned fuel consumption for supported vehicle types.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/iolog?datetime[]=architecto&object_id=ABC123&input[]=16&fuel=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/iolog"
);
const params = {
"datetime[0]": "architecto",
"object_id": "ABC123",
"input[0]": "16",
"fuel": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/iolog';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'object_id' => 'ABC123',
'input[0]' => '16',
'fuel' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/iolog'
params = {
'datetime[0]': 'architecto',
'object_id': 'ABC123',
'input[0]': '16',
'fuel': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"2025-01-15": {
"7": {
"distance": 125.4,
"fuel": 15.2,
"running_time": 7200,
"times": 3
}
}
}
Example response (200, No data):
null
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get IO log detail
requires authentication
Returns detailed IO log entries grouped by day and input, including splitted distance and fuel data.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/iologdetail?datetime[]=architecto&object_id=ABC123&input[]=16&fuel=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/iologdetail"
);
const params = {
"datetime[0]": "architecto",
"object_id": "ABC123",
"input[0]": "16",
"fuel": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/iologdetail';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'object_id' => 'ABC123',
'input[0]' => '16',
'fuel' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/iologdetail'
params = {
'datetime[0]': 'architecto',
'object_id': 'ABC123',
'input[0]': '16',
'fuel': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"2025-01-15": {
"7": [
{
"distance": 12.5,
"fuel": 3,
"running_time": 3600,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 09:00:00"
}
]
}
}
Example response (200, No data):
null
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get IO periods
requires authentication
Returns IO activity periods grouped by day and input, with start/stop times in seconds. Multi-day periods are split across days.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/ioperiods?datetime[]=architecto&object_id=ABC123&input[]=16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/ioperiods"
);
const params = {
"datetime[0]": "architecto",
"object_id": "ABC123",
"input[0]": "16",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ioperiods';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'object_id' => 'ABC123',
'input[0]' => '16',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ioperiods'
params = {
'datetime[0]': 'architecto',
'object_id': 'ABC123',
'input[0]': '16',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"15.01.2025": {
"7": [
[
28800,
64800
]
]
}
}
Example response (200, No data):
null
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get working hours log
requires authentication
Returns working hours diary entries grouped by day and input, with multi-day periods split across days. Supports lookup by driver or vehicle.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/whlog?datetime[]=architecto&id=ABC123&key=vehicle" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/whlog"
);
const params = {
"datetime[0]": "architecto",
"id": "ABC123",
"key": "vehicle",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/whlog';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'id' => 'ABC123',
'key' => 'vehicle',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/whlog'
params = {
'datetime[0]': 'architecto',
'id': 'ABC123',
'key': 'vehicle',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"15.01.2025": {
"7": [
{
"start_time": "2025-01-15 06:00:00",
"stop_time": "2025-01-15 18:00:00",
"localBegin": "08:00:00",
"localEnd": "20:00:00",
"driverID": "1",
"name": "John Doe",
"duration": 43200,
"object_id": "ABC123",
"id": 1
}
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get drive periods
requires authentication
Returns drive activity periods grouped by day, with start/stop times in seconds. Cross-day periods are split.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/driveperiods?datetime[]=architecto&object_id=ABC123&driverId=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/driveperiods"
);
const params = {
"datetime[0]": "architecto",
"object_id": "ABC123",
"driverId": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/driveperiods';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'object_id' => 'ABC123',
'driverId' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/driveperiods'
params = {
'datetime[0]': 'architecto',
'object_id': 'ABC123',
'driverId': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"15.01.2025": [
[
28800,
64800
]
]
}
Example response (200, No data):
null
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get work periods
requires authentication
Returns work activity periods grouped by day, with start/stop times in seconds. Supports filtering by vehicle or driver. Cross-day periods are split.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/workperiods?datetime[]=architecto&object_id=ABC123&driverID=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/workperiods"
);
const params = {
"datetime[0]": "architecto",
"object_id": "ABC123",
"driverID": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/workperiods';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'object_id' => 'ABC123',
'driverID' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/workperiods'
params = {
'datetime[0]': 'architecto',
'object_id': 'ABC123',
'driverID': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"15.01.2025": [
[
28800,
64800
]
]
}
Example response (200, No data):
null
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get CO2 report
requires authentication
Returns CO2 emissions data grouped by vehicle, with total distance, engine type, and fuel source breakdown.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/co2report?datetime[]=architecto&object_id=ABC123&categoryID=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/co2report"
);
const params = {
"datetime[0]": "architecto",
"object_id": "ABC123",
"categoryID": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/co2report';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'object_id' => 'ABC123',
'categoryID' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/co2report'
params = {
'datetime[0]': 'architecto',
'object_id': 'ABC123',
'categoryID': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": "ABC123",
"object_id": "ABC123",
"total_km": 125.4,
"engine_type": "diesel",
"co2_sources": [
{
"quantity": 50,
"co2_per_unit": 2640,
"fuel_name": "Diesel"
}
]
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get route on map
requires authentication
Generates a PNG image of the route plotted on a map for the given object and period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/routemap?datetime[]=architecto&object_id=ABC123&width=900&height=450" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/routemap"
);
const params = {
"datetime[0]": "architecto",
"object_id": "ABC123",
"width": "900",
"height": "450",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routemap';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'object_id' => 'ABC123',
'width' => '900',
'height' => '450',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routemap'
params = {
'datetime[0]': 'architecto',
'object_id': 'ABC123',
'width': '900',
'height': '450',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
Binary PNG image
Example response (500, Failed):
{
"message": "Failed to generate map image"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get encoded route log
requires authentication
Returns polyline-encoded route log data optimized for rendering. Supports multiple data types (fuel, input, temps, powers, rpm, keypad, path/speed).
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/routeloge?datetime[]=architecto&obj=ABC123&type=default" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/routeloge"
);
const params = {
"datetime[0]": "architecto",
"obj": "ABC123",
"type": "default",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routeloge';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'obj' => 'ABC123',
'type' => 'default',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routeloge'
params = {
'datetime[0]': 'architecto',
'obj': 'ABC123',
'type': 'default',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"poly": [
"BFsBF..."
],
"iterations": 1,
"cnt": 500,
"startTime": [
1705305600
],
"keys": [
[
"y",
"x",
"t",
"Speed"
]
]
}
Example response (403, Object not allowed):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List raw log entries
requires authentication
Returns raw route log entries with fuel delta and time delta calculations for the given object and period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/rawlog/ABC123?datetime[]=architecto&offset=0&limit=30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/rawlog/ABC123"
);
const params = {
"datetime[0]": "architecto",
"offset": "0",
"limit": "30",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/rawlog/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'offset' => '0',
'limit' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/rawlog/ABC123'
params = {
'datetime[0]': 'architecto',
'offset': '0',
'limit': '30',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"data": [
{
"id": 1,
"Speed": 60,
"t1": null,
"t2": null,
"t3": null,
"t4": null,
"distance": 1.5,
"csqlevel": 20,
"lat": 59.437,
"lng": 24.753,
"adc1": 50,
"adc2": 12,
"input": "10000000",
"fd": 0.5,
"Counter": 45.2,
"td": 30,
"GMTime": "2025-01-15 08:00:00"
}
]
}
Example response (403, Object not allowed):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get interval route log
requires authentication
Returns route log records at the specified interval for the given object and period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/intervalroutelog/ABC123?datetime[]=architecto&interval=5&offset=0&limit=30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/intervalroutelog/ABC123"
);
const params = {
"datetime[0]": "architecto",
"interval": "5",
"offset": "0",
"limit": "30",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/intervalroutelog/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'interval' => '5',
'offset' => '0',
'limit' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/intervalroutelog/ABC123'
params = {
'datetime[0]': 'architecto',
'interval': '5',
'offset': '0',
'limit': '30',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": 1,
"Speed": 80,
"GMTime": "2025-01-15 08:05:00",
"t1": 20.5,
"t2": 21,
"t3": null,
"t4": null
}
]
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update temperature values
requires authentication
Updates temperature sensor values for a specific route log record.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/intervalroutelog/ABC123/456" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"t1\": 20.5,
\"t2\": 21
}"
const url = new URL(
"https://testapi.metrotec.ee/api/intervalroutelog/ABC123/456"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"t1": 20.5,
"t2": 21
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/intervalroutelog/ABC123/456';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
't1' => 20.5,
't2' => 21.0,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/intervalroutelog/ABC123/456'
payload = {
"t1": 20.5,
"t2": 21
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"rlid": 456,
"t1": 20.5,
"t2": 21,
"t3": null,
"t4": null
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete raw log entries
requires authentication
Deletes specific raw log entries by their IDs for the given object.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/rawlog/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ids\": [
16
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/rawlog/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ids": [
16
]
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/rawlog/ABC123';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'ids' => [
16,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/rawlog/ABC123'
payload = {
"ids": [
16
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers, json=payload)
response.json()Example response (204, Deleted):
Empty response
Example response (403, Object not allowed):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get the main pivot report
requires authentication
Returns a pivot report with headers, data rows grouped by object or category, and totals.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/pivot?datetime[]=architecto&groupBy=object&categoryId=1&fuelType=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/pivot"
);
const params = {
"datetime[0]": "architecto",
"groupBy": "object",
"categoryId": "1",
"fuelType": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/pivot';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'groupBy' => 'object',
'categoryId' => '1',
'fuelType' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/pivot'
params = {
'datetime[0]': 'architecto',
'groupBy': 'object',
'categoryId': '1',
'fuelType': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"headers": [
"field1",
"field2"
],
"data": [],
"total": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get detail pivot report
requires authentication
Returns a detailed pivot report for a specific object with headers, daily data rows, and totals.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/pivot/ABC123?datetime[]=architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/pivot/ABC123"
);
const params = {
"datetime[0]": "architecto",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/pivot/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/pivot/ABC123'
params = {
'datetime[0]': 'architecto',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"headers": [
"field1",
"field2"
],
"data": [],
"total": {}
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get day pivot report
requires authentication
Returns a detailed pivot report for a specific object and single day.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/daypivot/ABC123?date=2025-01-15" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/daypivot/ABC123"
);
const params = {
"date": "2025-01-15",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/daypivot/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'date' => '2025-01-15',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/daypivot/ABC123'
params = {
'date': '2025-01-15',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"headers": [
"field1",
"field2"
],
"data": [],
"total": {}
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get WH pivot report by driver
requires authentication
Returns a working hours pivot report for a specific driver with daily breakdown.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/whdriverpivot/123?datetime[]=architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/whdriverpivot/123"
);
const params = {
"datetime[0]": "architecto",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/whdriverpivot/123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/whdriverpivot/123'
params = {
'datetime[0]': 'architecto',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"headers": [
"field1",
"field2"
],
"data": [],
"total": {}
}
Example response (403, Forbidden):
{
"message": "DriverNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get WH pivot report
requires authentication
Returns a working hours pivot report for a specific object with daily breakdown.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/whpivot/ABC123?datetime[]=architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/whpivot/ABC123"
);
const params = {
"datetime[0]": "architecto",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/whpivot/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/whpivot/ABC123'
params = {
'datetime[0]': 'architecto',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"headers": [
"field1",
"field2"
],
"data": [],
"total": {}
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get drive report
requires authentication
Returns all drive records for the given object and period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/drives?datetime[]=architecto&obj=ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/drives"
);
const params = {
"datetime[0]": "architecto",
"obj": "ABC123",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/drives';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'obj' => 'ABC123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/drives'
params = {
'datetime[0]': 'architecto',
'obj': 'ABC123',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": 123,
"route_length": 150.5,
"status": 1,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 12:00:00",
"driving_time": 3600,
"RevGeoS": "Vilnius",
"RevGeoE": "Kaunas"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get speed report
requires authentication
Returns speed data for the given object and period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/speed?datetime[]=architecto&object_id=ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/speed"
);
const params = {
"datetime[0]": "architecto",
"object_id": "ABC123",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/speed';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'object_id' => 'ABC123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/speed'
params = {
'datetime[0]': 'architecto',
'object_id': 'ABC123',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"Speed": 80,
"distance": 1.5,
"workBegin": "15.01.2025",
"time_diff": 30,
"gm": "2025-01-15 08:05:00"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get travel diary
requires authentication
Returns travel diary records for the given period. Drivers get records by their driver ID, other users must specify an object ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/traveldiary?datetime[]=architecto&object_id=ABC123&offset=0&limit=30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/traveldiary"
);
const params = {
"datetime[0]": "architecto",
"object_id": "ABC123",
"offset": "0",
"limit": "30",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/traveldiary';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'object_id' => 'ABC123',
'offset' => '0',
'limit' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/traveldiary'
params = {
'datetime[0]': 'architecto',
'object_id': 'ABC123',
'offset': '0',
'limit': '30',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": 123,
"object_id": "ABC123",
"day": "2025-01-15",
"name": "John",
"fname": "Doe",
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 12:00:00",
"route_length": 150.5,
"driving_time": 3600,
"max_speed": 120
}
]
Example response (404, No object ID):
{
"message": "No_Object_Id_Defined"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get travel diary record details
requires authentication
Returns a single travel diary record with its route points.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/traveldiary/123?routeOnly=" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/traveldiary/123"
);
const params = {
"routeOnly": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/traveldiary/123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'routeOnly' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/traveldiary/123'
params = {
'routeOnly': '0',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
{
"id": 123,
"object_id": "ABC123",
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 12:00:00",
"route": [
{
"lat": 54.6872,
"lng": 25.2797,
"t": "2025-01-15 08:05:00",
"d": 0.5,
"id": 1
}
]
}
Example response (404, Not found):
{
"message": "NotFound"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update travel diary record
requires authentication
Updates the private drive flag and/or description of a travel diary record.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/traveldiary/123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"is_private_drive\": true,
\"drive_description\": \"Business trip to Vilnius\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/traveldiary/123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"is_private_drive": true,
"drive_description": "Business trip to Vilnius"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/traveldiary/123';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'is_private_drive' => true,
'drive_description' => 'Business trip to Vilnius',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/traveldiary/123'
payload = {
"is_private_drive": true,
"drive_description": "Business trip to Vilnius"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 123,
"is_private_drive": true,
"drive_description": "Business trip"
}
Example response (403, Forbidden):
{
"message": "Forbidden"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Split a drive record
requires authentication
Splits a drive record into two parts at the specified route log point. Returns the two resulting drive records.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/splitdrives/123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"splitAt\": 12345
}"
const url = new URL(
"https://testapi.metrotec.ee/api/splitdrives/123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"splitAt": 12345
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/splitdrives/123';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'splitAt' => 12345,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/splitdrives/123'
payload = {
"splitAt": 12345
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
[
{
"id": 123,
"object_id": "ABC123",
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 12:00:00"
},
{
"id": 124,
"object_id": "ABC123",
"start_time": "2025-01-15 12:05:00",
"stop_time": "2025-01-15 17:00:00"
}
]
Example response (400, Cannot split):
{
"message": "No_Split_Here"
}
Example response (404, Not found):
{
"message": "NotFound"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Join drive records
requires authentication
Joins a drive record with the next one. The original record is deleted and the joined record is returned.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/joindrives/123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/joindrives/123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/joindrives/123';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/joindrives/123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 124,
"object_id": "ABC123",
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00"
}
Example response (400, Cannot join):
{
"message": "NotJoined"
}
Example response (404, Not found):
{
"message": "NotFound"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List fuel records
requires authentication
Returns a list of fuel records for the given period with optional filters.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/fuel?datetime=2024-01-01+00%3A00%3A00%2C2024-01-31+23%3A59%3A59&object_id=ABC123&driverid=1&driverid2=2&RevGeo=Street&offset=0&limit=30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/fuel"
);
const params = {
"datetime": "2024-01-01 00:00:00,2024-01-31 23:59:59",
"object_id": "ABC123",
"driverid": "1",
"driverid2": "2",
"RevGeo": "Street",
"offset": "0",
"limit": "30",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fuel';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime' => '2024-01-01 00:00:00,2024-01-31 23:59:59',
'object_id' => 'ABC123',
'driverid' => '1',
'driverid2' => '2',
'RevGeo' => 'Street',
'offset' => '0',
'limit' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fuel'
params = {
'datetime': '2024-01-01 00:00:00,2024-01-31 23:59:59',
'object_id': 'ABC123',
'driverid': '1',
'driverid2': '2',
'RevGeo': 'Street',
'offset': '0',
'limit': '30',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": 1,
"object_id": "ABC123",
"StartTime": "2024-01-01 08:00:00",
"EndTime": "2024-01-01 09:00:00",
"amount": 50
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a fuel record
requires authentication
Creates a new fuel record from two route log points. Updates the status of both route log records.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/fuel" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id1\": 100,
\"id2\": 200,
\"object_id\": \"ABC123\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/fuel"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id1": 100,
"id2": 200,
"object_id": "ABC123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fuel';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'id1' => 100,
'id2' => 200,
'object_id' => 'ABC123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fuel'
payload = {
"id1": 100,
"id2": 200,
"object_id": "ABC123"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1
}
Example response (400, Invalid points):
{
"message": "Wrong_Points_Id"
}
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update fuel record
requires authentication
Updates the bill sum of a fuel record.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/fuel/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"billSum\": 150
}"
const url = new URL(
"https://testapi.metrotec.ee/api/fuel/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"billSum": 150
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fuel/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'billSum' => 150,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fuel/1'
payload = {
"billSum": 150
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"billSum": 150
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete fuel record
requires authentication
Deletes a fuel record and clears the fuel status from the route log.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/fuel/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/fuel/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fuel/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fuel/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, Success):
Empty response
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Route Tasks
Task geozone information
Get task geozone
requires authentication
Returns the geozone associated with a specific task.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/zonetask/12345" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/zonetask/12345"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/zonetask/12345';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/zonetask/12345'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"id": 1,
"name": "Zone A",
"lat": 59.123,
"lng": 24.456,
"geometry": "...",
"countAlarm": {
"maxqtty": 5
}
}
Example response (404):
{
"message": "Not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get tasks PDF by task IDs
requires authentication
Generates a PDF report for the specified task IDs.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/taskspdf?nr[]=1&nr[]=2&nr[]=3" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"nr\": [
16
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/taskspdf"
);
const params = {
"nr[0]": "1",
"nr[1]": "2",
"nr[2]": "3",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"nr": [
16
]
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/taskspdf';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'nr[0]' => '1',
'nr[1]' => '2',
'nr[2]' => '3',
],
'json' => [
'nr' => [
16,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/taskspdf'
payload = {
"nr": [
16
]
}
params = {
'nr[0]': '1',
'nr[1]': '2',
'nr[2]': '3',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (200, PDF file):
PDF binary content
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get tasks by date period
requires authentication
Returns all tasks within the specified date period (max 7 days).
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/tasksbyperiod?datetime[]=2025-01-01+00%3A00%3A00&datetime[]=2025-01-07+23%3A59%3A59" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"datetime\": \"architecto\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/tasksbyperiod"
);
const params = {
"datetime[0]": "2025-01-01 00:00:00",
"datetime[1]": "2025-01-07 23:59:59",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"datetime": "architecto"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/tasksbyperiod';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => '2025-01-01 00:00:00',
'datetime[1]' => '2025-01-07 23:59:59',
],
'json' => [
'datetime' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/tasksbyperiod'
payload = {
"datetime": "architecto"
}
params = {
'datetime[0]': '2025-01-01 00:00:00',
'datetime[1]': '2025-01-07 23:59:59',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get tasks report
requires authentication
Returns a filtered and paginated list of route tasks for reporting.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/routetasks?start_time[]=2025-01-01+00%3A00%3A00&start_time[]=2025-01-31+23%3A59%3A59&object_id=ABC123&order_ref=architecto&status=architecto&isDetailed=1&offset=0&limit=30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/routetasks"
);
const params = {
"start_time[0]": "2025-01-01 00:00:00",
"start_time[1]": "2025-01-31 23:59:59",
"object_id": "ABC123",
"order_ref": "architecto",
"status": "architecto",
"isDetailed": "1",
"offset": "0",
"limit": "30",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasks';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'start_time[0]' => '2025-01-01 00:00:00',
'start_time[1]' => '2025-01-31 23:59:59',
'object_id' => 'ABC123',
'order_ref' => 'architecto',
'status' => 'architecto',
'isDetailed' => '1',
'offset' => '0',
'limit' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasks'
params = {
'start_time[0]': '2025-01-01 00:00:00',
'start_time[1]': '2025-01-31 23:59:59',
'object_id': 'ABC123',
'order_ref': 'architecto',
'status': 'architecto',
'isDetailed': '1',
'offset': '0',
'limit': '30',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
[
{
"id": 1,
"object_id": "ABC123",
"status": 1,
"start_time": "2025-01-01 10:00:00"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a specific task
Returns a single route task with files, signatures and products.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/routetasks/16" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/routetasks/16"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasks/16';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasks/16'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Example response (404, Task not found):
{
"message": "Not Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a task
Updates an existing route task. All base fields are optional on update. Additional profile-specific fields are listed per scenario below.
Status Changes:
- Setting status to 4 (rejected) will deactivate the task and remove group assignment
- Setting status to 3 (completed) or 7 (signed) triggers task-specific completion logic
Request Body per Profile
Rudus
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Construction Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"preparation_time": "2025-01-15 07:30:00",
"volume": 8.5,
"client_id": "CLIENT123",
"ordered_volume": 10,
"delivered_volume": 8.2,
"pumped_volume": 8,
"dn_trash": "0.5",
"dn_plastic": "1.2",
"dn_water": "10.5",
"categoryID": 15,
"client_emails": [
"client@example.com"
],
"last_cargo": 0,
"geozone_entered_at": "2025-01-15 11:20:00",
"arrived_at": "2025-01-15 11:15:00",
"geozone_left_at": "2025-01-15 11:50:00",
"work_finished_at": "2025-01-15 11:45:00",
"concrete_type": "C30/37",
"concrete_strength_class": "C30",
"environmental_class": "XC3",
"dmax": "16",
"consistency_class": "S3",
"cement_type": "CEM II/A-LL 42,5N",
"additives": "Superplasticizer",
"concrete_extra_info": "High durability",
"concrete_extra_info2": "Special finish",
"unload_method": "Pump",
"driving_instructions": "Use back entrance",
"offer_number": "OFF-2025-123",
"work_order_number": "WO-2025-456",
"notes": "Handle with care",
"operator_name": "John Smith",
"pumper_name": "ABC Pumping Ltd",
"pump_type": "Stationary",
"factory_id": 5,
"client_address": "123 Construction Ave",
"other_object_id": "PUMP-01",
"products": [
{
"product_id": 1,
"quantity": 8.5,
"weight": 150
}
]
}
Padapigi
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"product_name": "Electronic Components",
"project_nr": "PROJ-2025-10",
"weight": 15000,
"amount": 24,
"carrier": "Baltic Express",
"receiver_email": "receiver@example.com",
"receiver_name": "Tech Solutions UAB",
"directo_invoice": "987654",
"own_transport": true,
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Directo
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_email": "john@example.com",
"contact_sender": "SENDER123",
"contact_receiver": "ABC Logistics Ltd",
"contact_trailer": "TRL456",
"contact_order": "ORD-DIR-100",
"contact_delivery_term": "DAP",
"contact_language": "eng",
"delivery_name": "ABC Logistics Ltd",
"delivery_address1": "Industrial Street 15",
"delivery_address2": "Riga, LV-1234",
"delivery_address3": "Latvia",
"start_address1": "Warehouse A",
"start_address2": "Tallinn Port",
"start_address3": "Estonia",
"weight": 15000,
"amount": 24,
"hash": "abc123def456",
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Esvika
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"amount": 24,
"weight": 15000,
"vehicle_type": "Curtainsider",
"carrier": "Baltic Express",
"order_number": "ORD-FI-2025-100",
"unloading_time": 45,
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Olaret
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Port Terminal, Tallinn",
"order_ref": "ORD-2025-001",
"status": 1,
"worder": "WO_2025_456",
"do_send": true,
"containerno": "MSCU1234567",
"products": [
{
"product_id": 1,
"quantity": 1,
"weight": 5000
}
]
}
LotusTimber
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Timber Yard, PΓ€rnu",
"order_ref": "ORD-2025-001",
"status": 1,
"customer_id": 1,
"carrier_id": 2,
"trailer_nr": "TRL-789",
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"receiver_name": "Tech Solutions UAB",
"receiver_email": "receiver@example.com",
"products": [
{
"product_id": 1,
"quantity": 30,
"weight": 25000
}
]
}
Veokeskus
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"amount": 24,
"weight": 15000,
"receiver_email": "receiver@example.com",
"receiver_name": "Tech Solutions UAB",
"vehicle_type": "Curtainsider",
"unloading_time": 45,
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Morobell
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"receiver_email": "receiver@example.com",
"receiver_name": "Tech Solutions UAB",
"added_documents": "CMR, invoice",
"seal_number": "SEAL-12345",
"fish_document_id": 1,
"products": [
{
"product_id": 1,
"quantity": 10,
"weight": 500
}
]
}
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/routetasks/16" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"lat\": 59.437,
\"lon\": 24.7536,
\"start_time\": \"2025-01-15 08:00:00\",
\"stop_time\": \"2025-01-15 17:00:00\",
\"start_lat\": 59.437,
\"start_lon\": 24.7536,
\"start_address\": \"Warehouse, Tallinn\",
\"task_address\": \"Customer Site, Tartu\",
\"order_ref\": \"ORD-2025-001\",
\"order_details\": \"Fragile goods - handle with care\",
\"task_description\": \"Deliver package to reception\",
\"task_notes\": \"Call customer before arrival\",
\"cancel_reason\": \"Customer not available\",
\"status\": 1,
\"planned_km\": 150,
\"is_not_own_vehicle\": false,
\"active\": true,
\"group_id\": 1,
\"customer_id\": 1,
\"carrier_id\": 2,
\"sender_id\": 3,
\"trailer_nr\": \"TRL-001\",
\"order_id\": 16,
\"driver_notes\": \"Delivered successfully\",
\"products\": [
{
\"product_id\": 1,
\"quantity\": 10,
\"weight\": 100
},
{
\"product_name\": \"Custom product\",
\"quantity\": 5
}
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/routetasks/16"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"start_lat": 59.437,
"start_lon": 24.7536,
"start_address": "Warehouse, Tallinn",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"order_details": "Fragile goods - handle with care",
"task_description": "Deliver package to reception",
"task_notes": "Call customer before arrival",
"cancel_reason": "Customer not available",
"status": 1,
"planned_km": 150,
"is_not_own_vehicle": false,
"active": true,
"group_id": 1,
"customer_id": 1,
"carrier_id": 2,
"sender_id": 3,
"trailer_nr": "TRL-001",
"order_id": 16,
"driver_notes": "Delivered successfully",
"products": [
{
"product_id": 1,
"quantity": 10,
"weight": 100
},
{
"product_name": "Custom product",
"quantity": 5
}
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasks/16';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'lat' => 59.437,
'lon' => 24.7536,
'start_time' => '2025-01-15 08:00:00',
'stop_time' => '2025-01-15 17:00:00',
'start_lat' => 59.437,
'start_lon' => 24.7536,
'start_address' => 'Warehouse, Tallinn',
'task_address' => 'Customer Site, Tartu',
'order_ref' => 'ORD-2025-001',
'order_details' => 'Fragile goods - handle with care',
'task_description' => 'Deliver package to reception',
'task_notes' => 'Call customer before arrival',
'cancel_reason' => 'Customer not available',
'status' => 1,
'planned_km' => 150,
'is_not_own_vehicle' => false,
'active' => true,
'group_id' => 1,
'customer_id' => 1,
'carrier_id' => 2,
'sender_id' => 3,
'trailer_nr' => 'TRL-001',
'order_id' => 16,
'driver_notes' => 'Delivered successfully',
'products' => [
[
'product_id' => 1,
'quantity' => 10,
'weight' => 100,
],
[
'product_name' => 'Custom product',
'quantity' => 5,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasks/16'
payload = {
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"start_lat": 59.437,
"start_lon": 24.7536,
"start_address": "Warehouse, Tallinn",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"order_details": "Fragile goods - handle with care",
"task_description": "Deliver package to reception",
"task_notes": "Call customer before arrival",
"cancel_reason": "Customer not available",
"status": 1,
"planned_km": 150,
"is_not_own_vehicle": false,
"active": true,
"group_id": 1,
"customer_id": 1,
"carrier_id": 2,
"sender_id": 3,
"trailer_nr": "TRL-001",
"order_id": 16,
"driver_notes": "Delivered successfully",
"products": [
{
"product_id": 1,
"quantity": 10,
"weight": 100
},
{
"product_name": "Custom product",
"quantity": 5
}
]
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (403, Forbidden):
{
"message": "Forbidden"
}
Example response (403, Invalid Period):
{
"message": "Invalid period"
}
Example response (409, Duplicate Order Ref):
{
"message": "Duplicate order reference"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get all tasks
Returns a list of route tasks for the authenticated user. By default, only active tasks are returned.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/tasks?all=&offset=0&limit=30&files=" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/tasks"
);
const params = {
"all": "0",
"offset": "0",
"limit": "30",
"files": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/tasks';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'all' => '0',
'offset' => '0',
'limit' => '30',
'files' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/tasks'
params = {
'all': '0',
'offset': '0',
'limit': '30',
'files': '0',
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Standard Task):
[
{
"id": 12346,
"oid": "metrotec",
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.754,
"start_lat": null,
"start_lon": null,
"start_address": null,
"start_time": "2025-01-20 08:00:00",
"stop_time": "2025-01-20 17:00:00",
"order_ref": "ORDER-2025-001",
"order_details": null,
"task_address": "Tallinn, Estonia",
"task_description": "Standard delivery task",
"cancel_reason": null,
"status": 1,
"created_at": "2025-01-19 16:00:00",
"updated_at": "2025-01-19 16:00:00",
"work_started_at": null,
"work_finished_at": null,
"arrived_at": null,
"geozone_entered_at": null,
"geozone_left_at": null,
"sender": "DispatchSystem",
"tracking_nr": "abc123xyz789def456",
"task_notes": null,
"active": true,
"group_id": null,
"fish_document_id": null,
"is_not_own_vehicle": false,
"customer_id": null,
"carrier_id": null,
"trailer_nr": null,
"sender_id": null,
"driver_notes": null,
"hasGz": false,
"planned_km": null,
"distance": null,
"products": [],
"files": [],
"signatures": [],
"waypoints": [],
"audits": [],
"waybills": []
}
]
Example response (200, Rudus Task):
[
{
"id": 12345,
"oid": "metrotec",
"object_id": "RUDUS-01",
"lat": 59.437,
"lon": 24.754,
"start_lat": 59.395,
"start_lon": 24.662,
"start_address": "Factory, Tallinn",
"start_time": "2025-01-20 08:00:00",
"stop_time": "2025-01-20 12:00:00",
"order_ref": "RUDUS-2025-001",
"order_details": "Client: Construction Site A",
"task_address": "Construction Site A, Tallinn",
"task_description": "Concrete delivery C30/37",
"cancel_reason": null,
"status": 2,
"created_at": "2025-01-19 15:30:00",
"updated_at": "2025-01-20 08:15:00",
"work_started_at": "2025-01-20 08:05:00",
"work_finished_at": "2025-01-20 11:45:00",
"arrived_at": "2025-01-20 11:15:00",
"geozone_entered_at": "2025-01-20 11:20:00",
"geozone_left_at": "2025-01-20 11:50:00",
"sender": "RudusAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "Special delivery",
"active": true,
"group_id": 10,
"fish_document_id": null,
"is_not_own_vehicle": false,
"customer_id": null,
"carrier_id": null,
"trailer_nr": null,
"sender_id": null,
"driver_notes": null,
"hasGz": false,
"planned_km": null,
"distance": null,
"concrete_type": "C30/37",
"concrete_strength_class": "C30",
"environmental_class": "XC3",
"dmax": "16",
"consistency_class": "S3",
"cement_type": "CEM II/A-LL 42,5N",
"additives": "Superplasticizer",
"concrete_extra_info": "High durability",
"concrete_extra_info2": "Special finish required",
"preparation_time": "2025-01-20 07:30:00",
"volume": 8.5,
"unload_method": "Pump",
"driving_instructions": "Use back entrance",
"client_id": "CLIENT123",
"offer_number": "OFF-2025-123",
"ordered_volume": 10,
"delivered_volume": 8.2,
"pumped_volume": 8,
"work_order_number": "WO-2025-456",
"notes": "Handle with care",
"operator_name": "John Smith",
"pumper_name": "ABC Pumping Ltd",
"pump_type": "Stationary",
"factory_id": 5,
"client_address": "123 Construction Ave",
"dn_trash": "0.5",
"dn_water": "10.5",
"dn_plastic": "1.2",
"client_email": null,
"client_emails": [
"client@example.com",
"manager@example.com"
],
"last_cargo": 0,
"other_object_id": "PUMP-01",
"products": [],
"files": [],
"signatures": [],
"waypoints": [],
"audits": [],
"waybills": []
}
]
Example response (200, Padapigi Task):
[
{
"id": 12347,
"oid": "metrotec",
"object_id": "TRUCK-05",
"lat": 59.437,
"lon": 24.754,
"start_lat": 59.395,
"start_lon": 24.662,
"start_address": "Warehouse A, Tallinn",
"start_time": "2025-01-20 06:00:00",
"stop_time": "2025-01-20 18:00:00",
"order_ref": "PAD-2025-100",
"order_details": "CMR delivery to Latvia",
"task_address": "Warehouse District, Tallinn",
"task_description": "International delivery to Latvia",
"cancel_reason": null,
"status": 2,
"created_at": "2025-01-19 14:00:00",
"updated_at": "2025-01-20 06:30:00",
"work_started_at": "2025-01-20 06:15:00",
"work_finished_at": null,
"arrived_at": null,
"geozone_entered_at": null,
"geozone_left_at": null,
"sender": "PadapigiAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "CMR documents prepared",
"active": true,
"group_id": 15,
"fish_document_id": null,
"is_not_own_vehicle": false,
"customer_id": null,
"carrier_id": null,
"trailer_nr": null,
"sender_id": null,
"driver_notes": null,
"hasGz": false,
"planned_km": null,
"distance": null,
"contact_name": "John Doe",
"contact_country_code": "+371",
"contact_phone_nr": "21234567",
"product_name": "Electronic Components",
"receiver_email": "receiver@example.lv",
"receiver_name": "ABC Logistics Ltd",
"project_nr": "PROJ-2025-10",
"directo_invoice": "987654",
"carrier": "Baltic Express",
"weight": 15000,
"amount": 24,
"own_transport": true,
"products": [],
"files": [],
"signatures": [],
"waypoints": [],
"audits": [],
"waybills": []
}
]
Example response (200, Directo Task):
[
{
"id": 12348,
"oid": "metrotec",
"object_id": "INT-TRUCK-02",
"lat": 54.687,
"lon": 25.279,
"start_lat": 59.437,
"start_lon": 24.754,
"start_address": "Tallinn Logistics Center",
"start_time": "2025-01-20 05:00:00",
"stop_time": "2025-01-21 18:00:00",
"order_ref": "DIR-2025-055",
"order_details": "Electronics to Lithuania",
"task_address": "Vilnius, Lithuania",
"task_description": "Electronics transport to Lithuania",
"cancel_reason": null,
"status": 2,
"created_at": "2025-01-19 12:00:00",
"updated_at": "2025-01-20 05:45:00",
"work_started_at": "2025-01-20 05:30:00",
"work_finished_at": null,
"arrived_at": null,
"geozone_entered_at": null,
"geozone_left_at": null,
"sender": "DirectoAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "Border documents ready",
"active": true,
"group_id": 20,
"fish_document_id": null,
"is_not_own_vehicle": false,
"customer_id": null,
"carrier_id": null,
"trailer_nr": null,
"sender_id": null,
"driver_notes": "Contact receiver 1 hour before arrival",
"hasGz": false,
"planned_km": null,
"distance": null,
"contact_name": "Maria Vasileva",
"contact_email": "maria@example.lt",
"contact_sender": "SENDER123",
"contact_receiver": "ABC Logistics Ltd",
"contact_trailer": "TRL456",
"contact_order": "ORD-DIR-055",
"contact_delivery_term": "DAP",
"contact_language": "en",
"delivery_name": "Tech Solutions UAB",
"delivery_address": "Vilnius, Lithuania",
"delivery_address1": "Industrial Street 15",
"delivery_address2": "Vilnius, LT-01100",
"delivery_address3": "Lithuania",
"phone": "+37061234567",
"start_address1": "Logistics Center",
"start_address2": "Tallinn Port",
"start_address3": "Estonia",
"sent_time": null,
"weight": 12000,
"hash": "abc123def456",
"amount": 150,
"products": [],
"files": [],
"signatures": [],
"waypoints": [],
"audits": [],
"waybills": []
}
]
Example response (200, Esvika Task):
[
{
"id": 12349,
"oid": "metrotec",
"object_id": "ESV-TRUCK-08",
"lat": 60.169,
"lon": 24.938,
"start_lat": 59.437,
"start_lon": 24.754,
"start_address": "Tallinn Distribution Center",
"start_time": "2025-01-20 07:00:00",
"stop_time": "2025-01-20 16:00:00",
"order_ref": "ESV-2025-220",
"order_details": "Container to Helsinki Port",
"task_address": "Helsinki Port, Finland",
"task_description": "Container transport to Helsinki",
"cancel_reason": null,
"status": 2,
"created_at": "2025-01-19 13:30:00",
"updated_at": "2025-01-20 07:20:00",
"work_started_at": "2025-01-20 07:10:00",
"work_finished_at": null,
"arrived_at": null,
"geozone_entered_at": null,
"geozone_left_at": null,
"sender": "EsvikaAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "Ferry booking confirmed",
"active": true,
"group_id": 25,
"fish_document_id": null,
"is_not_own_vehicle": false,
"customer_id": null,
"carrier_id": null,
"trailer_nr": null,
"sender_id": null,
"driver_notes": null,
"hasGz": false,
"planned_km": null,
"distance": null,
"contact_name": "Pekka Virtanen",
"contact_country_code": "+358",
"contact_phone_nr": "401234567",
"amount": 1,
"weight": 22000,
"order_number": "ORD-FI-2025-100",
"carrier": "Nordic Transport Oy",
"vehicle_type": "Curtainsider",
"receiver_name": "Helsinki Logistics Oy",
"receiver_email": "receiver@logistics.fi",
"unloading_time": 45,
"products": [],
"files": [],
"signatures": [],
"waypoints": [],
"audits": [],
"waybills": []
}
]
Example response (200, Olaret Task):
[
{
"id": 12350,
"oid": "metrotec",
"object_id": "CONTAINER-TRUCK-03",
"lat": 59.437,
"lon": 24.754,
"start_lat": null,
"start_lon": null,
"start_address": null,
"start_time": "2025-01-20 09:00:00",
"stop_time": "2025-01-20 15:00:00",
"order_ref": "OLA-2025-456",
"order_details": "Container pickup",
"task_address": "Container Terminal, Port of Tallinn",
"task_description": "Container pickup and delivery",
"cancel_reason": null,
"status": 1,
"created_at": "2025-01-19 17:00:00",
"updated_at": "2025-01-19 17:00:00",
"work_started_at": null,
"work_finished_at": null,
"arrived_at": null,
"geozone_entered_at": null,
"geozone_left_at": null,
"sender": "OlaretAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "Terminal gate code: 1234",
"active": true,
"group_id": null,
"fish_document_id": null,
"is_not_own_vehicle": false,
"customer_id": null,
"carrier_id": null,
"trailer_nr": null,
"sender_id": null,
"driver_notes": null,
"hasGz": false,
"planned_km": null,
"distance": null,
"worder": "WO_2025_456",
"do_send": true,
"containerno": "MSCU1234567",
"products": [],
"files": [],
"signatures": [],
"waypoints": [],
"audits": [],
"waybills": []
}
]
Example response (200, LotusTimber Task):
[
{
"id": 12351,
"oid": "metrotec",
"object_id": "TIMBER-TRUCK-01",
"lat": 58.378,
"lon": 26.729,
"start_lat": 59.437,
"start_lon": 24.754,
"start_address": "Timber Yard, Tallinn",
"start_time": "2025-01-20 06:00:00",
"stop_time": "2025-01-20 14:00:00",
"order_ref": "LOTUS-2025-001",
"order_details": "Timber delivery to sawmill",
"task_address": "Sawmill, Tartu",
"task_description": "Timber transport",
"cancel_reason": null,
"status": 2,
"created_at": "2025-01-19 15:00:00",
"updated_at": "2025-01-20 06:30:00",
"work_started_at": "2025-01-20 06:15:00",
"work_finished_at": null,
"arrived_at": null,
"geozone_entered_at": null,
"geozone_left_at": null,
"sender": "LotusTimberAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "Handle with care",
"active": true,
"group_id": null,
"fish_document_id": null,
"is_not_own_vehicle": false,
"customer_id": 1,
"carrier_id": 2,
"trailer_nr": "TRL-789",
"sender_id": null,
"driver_notes": null,
"hasGz": false,
"planned_km": null,
"distance": null,
"products": [],
"files": [],
"signatures": [],
"waypoints": [],
"audits": [],
"waybills": []
}
]
Example response (200, Veokeskus Task):
[
{
"id": 12350,
"oid": "metrotec",
"object_id": "VEO-TRUCK-01",
"lat": 59.437,
"lon": 24.754,
"start_lat": 59.395,
"start_lon": 24.662,
"start_address": "Tallinn Warehouse",
"start_time": "2025-01-20 08:00:00",
"stop_time": "2025-01-20 17:00:00",
"order_ref": "VEO-2025-001",
"order_details": "Full truck load delivery",
"task_address": "Tartu, Estonia",
"task_description": "Delivery to distribution center",
"cancel_reason": null,
"status": 2,
"created_at": "2025-01-19 14:00:00",
"updated_at": "2025-01-20 08:15:00",
"work_started_at": "2025-01-20 08:05:00",
"work_finished_at": null,
"arrived_at": null,
"geozone_entered_at": null,
"geozone_left_at": null,
"sender": "VeokeskusAPI",
"tracking_nr": "veo123abc789xyz456",
"task_notes": "Delivery note required",
"active": true,
"group_id": 30,
"fish_document_id": null,
"is_not_own_vehicle": false,
"customer_id": null,
"carrier_id": null,
"trailer_nr": null,
"sender_id": null,
"driver_notes": null,
"hasGz": false,
"planned_km": null,
"distance": null,
"contact_name": "Mart Tamm",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"amount": 24,
"weight": 18000,
"order_number": null,
"carrier": null,
"vehicle_type": "Box truck",
"receiver_name": "Tartu Logistics OU",
"receiver_email": "receiver@logistics.ee",
"unloading_time": 60,
"products": [],
"files": [],
"signatures": [],
"waypoints": [],
"audits": [],
"waybills": []
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new task
Creates a new route task. The available fields depend on the user's profile type. All task types share common base fields (documented below), with additional profile-specific fields listed per scenario.
Validation overrides by profile:
- Rudus, Padapigi, Directo, Esvika, Veokeskus, Morobell:
object_idbecomes optional (nullable) - Rudus, Directo:
latandlonbecome optional (nullable) - Directo:
task_addressmax length constraint is removed
Request Body per Profile
Rudus
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Construction Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"preparation_time": "2025-01-15 07:30:00",
"volume": 8.5,
"client_id": "CLIENT123",
"ordered_volume": 10,
"delivered_volume": 8.2,
"pumped_volume": 8,
"dn_trash": "0.5",
"dn_plastic": "1.2",
"dn_water": "10.5",
"categoryID": 15,
"client_emails": [
"client@example.com"
],
"last_cargo": 0,
"geozone_entered_at": "2025-01-15 11:20:00",
"arrived_at": "2025-01-15 11:15:00",
"geozone_left_at": "2025-01-15 11:50:00",
"work_finished_at": "2025-01-15 11:45:00",
"concrete_type": "C30/37",
"concrete_strength_class": "C30",
"environmental_class": "XC3",
"dmax": "16",
"consistency_class": "S3",
"cement_type": "CEM II/A-LL 42,5N",
"additives": "Superplasticizer",
"concrete_extra_info": "High durability",
"concrete_extra_info2": "Special finish",
"unload_method": "Pump",
"driving_instructions": "Use back entrance",
"offer_number": "OFF-2025-123",
"work_order_number": "WO-2025-456",
"notes": "Handle with care",
"operator_name": "John Smith",
"pumper_name": "ABC Pumping Ltd",
"pump_type": "Stationary",
"factory_id": 5,
"client_address": "123 Construction Ave",
"other_object_id": "PUMP-01",
"products": [
{
"product_id": 1,
"quantity": 8.5,
"weight": 150
}
]
}
Padapigi
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"product_name": "Electronic Components",
"project_nr": "PROJ-2025-10",
"weight": 15000,
"amount": 24,
"carrier": "Baltic Express",
"receiver_email": "receiver@example.com",
"receiver_name": "Tech Solutions UAB",
"directo_invoice": "987654",
"own_transport": true,
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Directo
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_email": "john@example.com",
"contact_sender": "SENDER123",
"contact_receiver": "ABC Logistics Ltd",
"contact_trailer": "TRL456",
"contact_order": "ORD-DIR-100",
"contact_delivery_term": "DAP",
"contact_language": "eng",
"delivery_name": "ABC Logistics Ltd",
"delivery_address1": "Industrial Street 15",
"delivery_address2": "Riga, LV-1234",
"delivery_address3": "Latvia",
"start_address1": "Warehouse A",
"start_address2": "Tallinn Port",
"start_address3": "Estonia",
"weight": 15000,
"amount": 24,
"hash": "abc123def456",
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Esvika
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"amount": 24,
"weight": 15000,
"vehicle_type": "Curtainsider",
"carrier": "Baltic Express",
"order_number": "ORD-FI-2025-100",
"unloading_time": 45,
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Olaret
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Port Terminal, Tallinn",
"order_ref": "ORD-2025-001",
"status": 1,
"worder": "WO_2025_456",
"do_send": true,
"containerno": "MSCU1234567",
"products": [
{
"product_id": 1,
"quantity": 1,
"weight": 5000
}
]
}
LotusTimber
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Timber Yard, PΓ€rnu",
"order_ref": "ORD-2025-001",
"status": 1,
"customer_id": 1,
"carrier_id": 2,
"trailer_nr": "TRL-789",
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"receiver_name": "Tech Solutions UAB",
"receiver_email": "receiver@example.com",
"products": [
{
"product_id": 1,
"quantity": 30,
"weight": 25000
}
]
}
Veokeskus
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"amount": 24,
"weight": 15000,
"receiver_email": "receiver@example.com",
"receiver_name": "Tech Solutions UAB",
"vehicle_type": "Curtainsider",
"unloading_time": 45,
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Morobell
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"receiver_email": "receiver@example.com",
"receiver_name": "Tech Solutions UAB",
"added_documents": "CMR, invoice",
"seal_number": "SEAL-12345",
"fish_document_id": 1,
"products": [
{
"product_id": 1,
"quantity": 10,
"weight": 500
}
]
}
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/tasks" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"lat\": 59.437,
\"lon\": 24.7536,
\"start_time\": \"2025-01-15 08:00:00\",
\"stop_time\": \"2025-01-15 17:00:00\",
\"start_lat\": 59.437,
\"start_lon\": 24.7536,
\"start_address\": \"Warehouse, Tallinn\",
\"task_address\": \"Customer Site, Tartu\",
\"order_ref\": \"ORD-2025-001\",
\"order_details\": \"Fragile goods - handle with care\",
\"task_description\": \"Deliver package to reception\",
\"task_notes\": \"Call customer before arrival\",
\"cancel_reason\": \"Customer not available\",
\"status\": 1,
\"planned_km\": 150,
\"is_not_own_vehicle\": false,
\"active\": true,
\"group_id\": 1,
\"customer_id\": 1,
\"carrier_id\": 2,
\"sender_id\": 3,
\"trailer_nr\": \"TRL-001\",
\"order_id\": 16,
\"driver_notes\": \"Delivered successfully\",
\"products\": [
{
\"product_id\": 1,
\"quantity\": 10,
\"weight\": 100
},
{
\"product_name\": \"Custom product\",
\"quantity\": 5
}
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/tasks"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"start_lat": 59.437,
"start_lon": 24.7536,
"start_address": "Warehouse, Tallinn",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"order_details": "Fragile goods - handle with care",
"task_description": "Deliver package to reception",
"task_notes": "Call customer before arrival",
"cancel_reason": "Customer not available",
"status": 1,
"planned_km": 150,
"is_not_own_vehicle": false,
"active": true,
"group_id": 1,
"customer_id": 1,
"carrier_id": 2,
"sender_id": 3,
"trailer_nr": "TRL-001",
"order_id": 16,
"driver_notes": "Delivered successfully",
"products": [
{
"product_id": 1,
"quantity": 10,
"weight": 100
},
{
"product_name": "Custom product",
"quantity": 5
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/tasks';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'lat' => 59.437,
'lon' => 24.7536,
'start_time' => '2025-01-15 08:00:00',
'stop_time' => '2025-01-15 17:00:00',
'start_lat' => 59.437,
'start_lon' => 24.7536,
'start_address' => 'Warehouse, Tallinn',
'task_address' => 'Customer Site, Tartu',
'order_ref' => 'ORD-2025-001',
'order_details' => 'Fragile goods - handle with care',
'task_description' => 'Deliver package to reception',
'task_notes' => 'Call customer before arrival',
'cancel_reason' => 'Customer not available',
'status' => 1,
'planned_km' => 150,
'is_not_own_vehicle' => false,
'active' => true,
'group_id' => 1,
'customer_id' => 1,
'carrier_id' => 2,
'sender_id' => 3,
'trailer_nr' => 'TRL-001',
'order_id' => 16,
'driver_notes' => 'Delivered successfully',
'products' => [
[
'product_id' => 1,
'quantity' => 10,
'weight' => 100,
],
[
'product_name' => 'Custom product',
'quantity' => 5,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/tasks'
payload = {
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"start_lat": 59.437,
"start_lon": 24.7536,
"start_address": "Warehouse, Tallinn",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"order_details": "Fragile goods - handle with care",
"task_description": "Deliver package to reception",
"task_notes": "Call customer before arrival",
"cancel_reason": "Customer not available",
"status": 1,
"planned_km": 150,
"is_not_own_vehicle": false,
"active": true,
"group_id": 1,
"customer_id": 1,
"carrier_id": 2,
"sender_id": 3,
"trailer_nr": "TRL-001",
"order_id": 16,
"driver_notes": "Delivered successfully",
"products": [
{
"product_id": 1,
"quantity": 10,
"weight": 100
},
{
"product_name": "Custom product",
"quantity": 5
}
]
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Standard Task):
{
"id": 12346,
"oid": "metrotec",
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.754,
"start_lat": null,
"start_lon": null,
"start_address": null,
"start_time": "2025-01-20 08:00:00",
"stop_time": "2025-01-20 17:00:00",
"order_ref": "ORDER-2025-001",
"order_details": null,
"task_address": "Tallinn, Estonia",
"task_description": "Standard delivery task",
"cancel_reason": null,
"status": 1,
"created_at": "2025-01-19 16:00:00",
"updated_at": "2025-01-19 16:00:00",
"sender": "DispatchSystem",
"tracking_nr": "abc123xyz789def456",
"task_notes": null,
"active": true,
"group_id": null,
"is_not_own_vehicle": false,
"products": [],
"files": [],
"signatures": []
}
Example response (201, Rudus Task):
{
"id": 12345,
"oid": "metrotec",
"object_id": "RUDUS-01",
"lat": 59.437,
"lon": 24.754,
"start_lat": 59.395,
"start_lon": 24.662,
"start_address": "Factory, Tallinn",
"start_time": "2025-01-20 08:00:00",
"stop_time": "2025-01-20 12:00:00",
"order_ref": "RUDUS-2025-001",
"order_details": "Client: Construction Site A",
"task_address": "Construction Site A, Tallinn",
"task_description": "Concrete delivery C30/37",
"cancel_reason": null,
"status": 1,
"created_at": "2025-01-19 15:30:00",
"updated_at": "2025-01-19 15:30:00",
"sender": "RudusAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "Special delivery",
"active": true,
"group_id": 10,
"is_not_own_vehicle": false,
"preparation_time": "2025-01-20 07:30:00",
"volume": 8.5,
"client_id": "CLIENT123",
"ordered_volume": 10,
"delivered_volume": 8.2,
"pumped_volume": 8,
"dn_trash": "0.5",
"dn_plastic": "1.2",
"dn_water": "10.5",
"categoryID": 15,
"client_emails": [
"client@example.com",
"manager@example.com"
],
"last_cargo": 0,
"concrete_type": "C30/37",
"concrete_strength_class": "C30",
"environmental_class": "XC3",
"dmax": "16",
"consistency_class": "S3",
"cement_type": "CEM II/A-LL 42,5N",
"additives": "Superplasticizer",
"concrete_extra_info": "High durability",
"concrete_extra_info2": "Special finish required",
"unload_method": "Pump",
"driving_instructions": "Use back entrance",
"offer_number": "OFF-2025-123",
"work_order_number": "WO-2025-456",
"notes": "Handle with care",
"operator_name": "John Smith",
"pumper_name": "ABC Pumping Ltd",
"pump_type": "Stationary",
"factory_id": 5,
"client_address": "123 Construction Ave",
"other_object_id": "PUMP-01",
"products": [],
"files": [],
"signatures": []
}
Example response (201, Padapigi Task):
{
"id": 12347,
"oid": "metrotec",
"object_id": "TRUCK-05",
"lat": 59.437,
"lon": 24.754,
"start_lat": 59.395,
"start_lon": 24.662,
"start_address": "Warehouse A, Tallinn",
"start_time": "2025-01-20 06:00:00",
"stop_time": "2025-01-20 18:00:00",
"order_ref": "PAD-2025-100",
"order_details": "CMR delivery to Latvia",
"task_address": "Warehouse District, Tallinn",
"task_description": "International delivery to Latvia",
"cancel_reason": null,
"status": 1,
"created_at": "2025-01-19 14:00:00",
"updated_at": "2025-01-19 14:00:00",
"sender": "PadapigiAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "CMR documents prepared",
"active": false,
"group_id": 15,
"is_not_own_vehicle": false,
"contact_name": "John Doe",
"contact_email": "john.doe@example.com",
"contact_sender": "SENDER123",
"contact_receiver": "ABC Logistics Ltd",
"contact_trailer": "TRL456",
"contact_order": "ORD-PAD-100",
"contact_delivery_term": "DAP",
"contact_language": "en",
"delivery_name": "ABC Logistics Ltd",
"delivery_address1": "Industrial Street 15",
"delivery_address2": "Riga, LV-1234",
"delivery_address3": "Latvia",
"start_address1": "Warehouse A",
"start_address2": "Tallinn Port",
"start_address3": "Estonia",
"weight": 15000,
"amount": 24,
"hash": "abc123def456",
"products": [],
"files": [],
"signatures": []
}
Example response (201, Directo Task):
{
"id": 12348,
"oid": "metrotec",
"object_id": "INT-TRUCK-02",
"lat": 54.687,
"lon": 25.279,
"start_lat": 59.437,
"start_lon": 24.754,
"start_address": "Tallinn Logistics Center",
"start_time": "2025-01-20 05:00:00",
"stop_time": "2025-01-21 18:00:00",
"order_ref": "DIR-2025-055",
"order_details": "Electronics to Lithuania",
"task_address": "Vilnius, Lithuania",
"task_description": "Electronics transport to Lithuania",
"cancel_reason": null,
"status": 1,
"created_at": "2025-01-19 12:00:00",
"updated_at": "2025-01-19 12:00:00",
"sender": "DirectoAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "Border documents ready",
"active": false,
"group_id": 20,
"is_not_own_vehicle": false,
"amount": 150,
"contact_name": "Maria Vasileva",
"contact_country_code": "+370",
"contact_phone_nr": "61234567",
"product_name": "Electronic Components",
"project_nr": "PROJ-2025-10",
"weight": 12000,
"carrier": "Baltic Express",
"receiver_email": "receiver@example.lt",
"receiver_name": "Tech Solutions UAB",
"directo_invoice": "987654",
"driver_notes": "Contact receiver 1 hour before arrival",
"own_transport": true,
"products": [],
"files": [],
"signatures": []
}
Example response (201, Esvika Task):
{
"id": 12349,
"oid": "metrotec",
"object_id": "ESV-TRUCK-08",
"lat": 60.169,
"lon": 24.938,
"start_lat": 59.437,
"start_lon": 24.754,
"start_address": "Tallinn Distribution Center",
"start_time": "2025-01-20 07:00:00",
"stop_time": "2025-01-20 16:00:00",
"order_ref": "ESV-2025-220",
"order_details": "Container to Helsinki Port",
"task_address": "Helsinki Port, Finland",
"task_description": "Container transport to Helsinki",
"cancel_reason": null,
"status": 1,
"created_at": "2025-01-19 13:30:00",
"updated_at": "2025-01-19 13:30:00",
"sender": "EsvikaAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "Ferry booking confirmed",
"active": false,
"group_id": 25,
"is_not_own_vehicle": false,
"contact_name": "Pekka Virtanen",
"contact_country_code": "+358",
"contact_phone_nr": "401234567",
"amount": 1,
"weight": 22000,
"vehicle_type": "Curtainsider",
"carrier": "Nordic Transport Oy",
"order_number": "ORD-FI-2025-100",
"unloading_time": 45,
"products": [],
"files": [],
"signatures": []
}
Example response (201, Olaret Task):
{
"id": 12350,
"oid": "metrotec",
"object_id": "CONTAINER-TRUCK-03",
"lat": 59.437,
"lon": 24.754,
"start_lat": null,
"start_lon": null,
"start_address": null,
"start_time": "2025-01-20 09:00:00",
"stop_time": "2025-01-20 15:00:00",
"order_ref": "OLA-2025-456",
"order_details": "Container pickup",
"task_address": "Container Terminal, Port of Tallinn",
"task_description": "Container pickup and delivery",
"cancel_reason": null,
"status": 1,
"created_at": "2025-01-19 17:00:00",
"updated_at": "2025-01-19 17:00:00",
"sender": "OlaretAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "Terminal gate code: 1234",
"active": true,
"group_id": null,
"is_not_own_vehicle": false,
"worder": "WO_2025_456",
"containerno": "MSCU1234567",
"do_send": true,
"products": [],
"files": [],
"signatures": []
}
Example response (201, LotusTimber Task):
{
"id": 12351,
"oid": "metrotec",
"object_id": "TIMBER-TRUCK-01",
"lat": 58.378,
"lon": 26.729,
"start_lat": 59.437,
"start_lon": 24.754,
"start_address": "Timber Yard, Tallinn",
"start_time": "2025-01-20 06:00:00",
"stop_time": "2025-01-20 14:00:00",
"order_ref": "LOTUS-2025-001",
"order_details": "Timber delivery to sawmill",
"customer_id": 1,
"carrier_id": 2,
"trailer_nr": "TRL-789",
"task_address": "Sawmill, Tartu",
"task_description": "Timber transport",
"cancel_reason": null,
"status": 1,
"created_at": "2025-01-19 15:00:00",
"updated_at": "2025-01-19 15:00:00",
"sender": "LotusTimberAPI",
"tracking_nr": "abc123xyz789def456",
"task_notes": "Handle with care",
"active": true,
"group_id": null,
"is_not_own_vehicle": false,
"products": [
{
"id": 1,
"name": "Pine Logs",
"pivot": {
"route_task_id": 12351,
"product_id": 1,
"quantity": "25.00",
"weight": "1500.00",
"created_at": "2025-01-19 15:00:00",
"updated_at": "2025-01-19 15:00:00"
}
},
{
"id": 2,
"name": "Spruce Logs",
"pivot": {
"route_task_id": 12351,
"product_id": 2,
"quantity": "15.00",
"weight": "900.00",
"created_at": "2025-01-19 15:00:00",
"updated_at": "2025-01-19 15:00:00"
}
}
],
"files": [],
"signatures": []
}
Example response (201, Veokeskus Task):
{
"id": 12350,
"oid": "metrotec",
"object_id": "VEO-TRUCK-01",
"lat": 59.437,
"lon": 24.754,
"start_lat": 59.395,
"start_lon": 24.662,
"start_address": "Tallinn Warehouse",
"start_time": "2025-01-20 08:00:00",
"stop_time": "2025-01-20 17:00:00",
"order_ref": "VEO-2025-001",
"order_details": "Full truck load delivery",
"task_address": "Tartu, Estonia",
"task_description": "Delivery to distribution center",
"cancel_reason": null,
"status": 1,
"created_at": "2025-01-20 07:00:00",
"updated_at": "2025-01-20 07:00:00",
"sender": "VeokeskusAPI",
"tracking_nr": "veo123abc789xyz456",
"task_notes": "Delivery note required",
"active": false,
"group_id": 30,
"is_not_own_vehicle": false,
"contact_name": "Mart Tamm",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"amount": 24,
"weight": 18000,
"vehicle_type": "Box truck",
"receiver_email": "receiver@logistics.ee",
"receiver_name": "Tartu Logistics OÜ",
"unloading_time": 60,
"products": [],
"files": [],
"signatures": [],
"waypoints": []
}
Example response (400, Validation Error):
{
"message": "Lat_Lon_Must_Be_Defined"
}
Example response (409, Duplicate Order Ref):
{
"message": "Duplicate order reference"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a specific task
Returns a single route task with files, signatures and products.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/tasks/16" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/tasks/16"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/tasks/16';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/tasks/16'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Example response (404, Task not found):
{
"message": "Not Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a task
Updates an existing route task. All base fields are optional on update. Additional profile-specific fields are listed per scenario below.
Status Changes:
- Setting status to 4 (rejected) will deactivate the task and remove group assignment
- Setting status to 3 (completed) or 7 (signed) triggers task-specific completion logic
Request Body per Profile
Rudus
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Construction Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"preparation_time": "2025-01-15 07:30:00",
"volume": 8.5,
"client_id": "CLIENT123",
"ordered_volume": 10,
"delivered_volume": 8.2,
"pumped_volume": 8,
"dn_trash": "0.5",
"dn_plastic": "1.2",
"dn_water": "10.5",
"categoryID": 15,
"client_emails": [
"client@example.com"
],
"last_cargo": 0,
"geozone_entered_at": "2025-01-15 11:20:00",
"arrived_at": "2025-01-15 11:15:00",
"geozone_left_at": "2025-01-15 11:50:00",
"work_finished_at": "2025-01-15 11:45:00",
"concrete_type": "C30/37",
"concrete_strength_class": "C30",
"environmental_class": "XC3",
"dmax": "16",
"consistency_class": "S3",
"cement_type": "CEM II/A-LL 42,5N",
"additives": "Superplasticizer",
"concrete_extra_info": "High durability",
"concrete_extra_info2": "Special finish",
"unload_method": "Pump",
"driving_instructions": "Use back entrance",
"offer_number": "OFF-2025-123",
"work_order_number": "WO-2025-456",
"notes": "Handle with care",
"operator_name": "John Smith",
"pumper_name": "ABC Pumping Ltd",
"pump_type": "Stationary",
"factory_id": 5,
"client_address": "123 Construction Ave",
"other_object_id": "PUMP-01",
"products": [
{
"product_id": 1,
"quantity": 8.5,
"weight": 150
}
]
}
Padapigi
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"product_name": "Electronic Components",
"project_nr": "PROJ-2025-10",
"weight": 15000,
"amount": 24,
"carrier": "Baltic Express",
"receiver_email": "receiver@example.com",
"receiver_name": "Tech Solutions UAB",
"directo_invoice": "987654",
"own_transport": true,
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Directo
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_email": "john@example.com",
"contact_sender": "SENDER123",
"contact_receiver": "ABC Logistics Ltd",
"contact_trailer": "TRL456",
"contact_order": "ORD-DIR-100",
"contact_delivery_term": "DAP",
"contact_language": "eng",
"delivery_name": "ABC Logistics Ltd",
"delivery_address1": "Industrial Street 15",
"delivery_address2": "Riga, LV-1234",
"delivery_address3": "Latvia",
"start_address1": "Warehouse A",
"start_address2": "Tallinn Port",
"start_address3": "Estonia",
"weight": 15000,
"amount": 24,
"hash": "abc123def456",
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Esvika
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"amount": 24,
"weight": 15000,
"vehicle_type": "Curtainsider",
"carrier": "Baltic Express",
"order_number": "ORD-FI-2025-100",
"unloading_time": 45,
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Olaret
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Port Terminal, Tallinn",
"order_ref": "ORD-2025-001",
"status": 1,
"worder": "WO_2025_456",
"do_send": true,
"containerno": "MSCU1234567",
"products": [
{
"product_id": 1,
"quantity": 1,
"weight": 5000
}
]
}
LotusTimber
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Timber Yard, PΓ€rnu",
"order_ref": "ORD-2025-001",
"status": 1,
"customer_id": 1,
"carrier_id": 2,
"trailer_nr": "TRL-789",
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"receiver_name": "Tech Solutions UAB",
"receiver_email": "receiver@example.com",
"products": [
{
"product_id": 1,
"quantity": 30,
"weight": 25000
}
]
}
Veokeskus
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"amount": 24,
"weight": 15000,
"receiver_email": "receiver@example.com",
"receiver_name": "Tech Solutions UAB",
"vehicle_type": "Curtainsider",
"unloading_time": 45,
"products": [
{
"product_id": 1,
"quantity": 24,
"weight": 15000
}
]
}
Morobell
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"receiver_email": "receiver@example.com",
"receiver_name": "Tech Solutions UAB",
"added_documents": "CMR, invoice",
"seal_number": "SEAL-12345",
"fish_document_id": 1,
"products": [
{
"product_id": 1,
"quantity": 10,
"weight": 500
}
]
}
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/tasks/16" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"lat\": 59.437,
\"lon\": 24.7536,
\"start_time\": \"2025-01-15 08:00:00\",
\"stop_time\": \"2025-01-15 17:00:00\",
\"start_lat\": 59.437,
\"start_lon\": 24.7536,
\"start_address\": \"Warehouse, Tallinn\",
\"task_address\": \"Customer Site, Tartu\",
\"order_ref\": \"ORD-2025-001\",
\"order_details\": \"Fragile goods - handle with care\",
\"task_description\": \"Deliver package to reception\",
\"task_notes\": \"Call customer before arrival\",
\"cancel_reason\": \"Customer not available\",
\"status\": 1,
\"planned_km\": 150,
\"is_not_own_vehicle\": false,
\"active\": true,
\"group_id\": 1,
\"customer_id\": 1,
\"carrier_id\": 2,
\"sender_id\": 3,
\"trailer_nr\": \"TRL-001\",
\"order_id\": 16,
\"driver_notes\": \"Delivered successfully\",
\"products\": [
{
\"product_id\": 1,
\"quantity\": 10,
\"weight\": 100
},
{
\"product_name\": \"Custom product\",
\"quantity\": 5
}
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/tasks/16"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"start_lat": 59.437,
"start_lon": 24.7536,
"start_address": "Warehouse, Tallinn",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"order_details": "Fragile goods - handle with care",
"task_description": "Deliver package to reception",
"task_notes": "Call customer before arrival",
"cancel_reason": "Customer not available",
"status": 1,
"planned_km": 150,
"is_not_own_vehicle": false,
"active": true,
"group_id": 1,
"customer_id": 1,
"carrier_id": 2,
"sender_id": 3,
"trailer_nr": "TRL-001",
"order_id": 16,
"driver_notes": "Delivered successfully",
"products": [
{
"product_id": 1,
"quantity": 10,
"weight": 100
},
{
"product_name": "Custom product",
"quantity": 5
}
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/tasks/16';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'lat' => 59.437,
'lon' => 24.7536,
'start_time' => '2025-01-15 08:00:00',
'stop_time' => '2025-01-15 17:00:00',
'start_lat' => 59.437,
'start_lon' => 24.7536,
'start_address' => 'Warehouse, Tallinn',
'task_address' => 'Customer Site, Tartu',
'order_ref' => 'ORD-2025-001',
'order_details' => 'Fragile goods - handle with care',
'task_description' => 'Deliver package to reception',
'task_notes' => 'Call customer before arrival',
'cancel_reason' => 'Customer not available',
'status' => 1,
'planned_km' => 150,
'is_not_own_vehicle' => false,
'active' => true,
'group_id' => 1,
'customer_id' => 1,
'carrier_id' => 2,
'sender_id' => 3,
'trailer_nr' => 'TRL-001',
'order_id' => 16,
'driver_notes' => 'Delivered successfully',
'products' => [
[
'product_id' => 1,
'quantity' => 10,
'weight' => 100,
],
[
'product_name' => 'Custom product',
'quantity' => 5,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/tasks/16'
payload = {
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2025-01-15 08:00:00",
"stop_time": "2025-01-15 17:00:00",
"start_lat": 59.437,
"start_lon": 24.7536,
"start_address": "Warehouse, Tallinn",
"task_address": "Customer Site, Tartu",
"order_ref": "ORD-2025-001",
"order_details": "Fragile goods - handle with care",
"task_description": "Deliver package to reception",
"task_notes": "Call customer before arrival",
"cancel_reason": "Customer not available",
"status": 1,
"planned_km": 150,
"is_not_own_vehicle": false,
"active": true,
"group_id": 1,
"customer_id": 1,
"carrier_id": 2,
"sender_id": 3,
"trailer_nr": "TRL-001",
"order_id": 16,
"driver_notes": "Delivered successfully",
"products": [
{
"product_id": 1,
"quantity": 10,
"weight": 100
},
{
"product_name": "Custom product",
"quantity": 5
}
]
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (403, Forbidden):
{
"message": "Forbidden"
}
Example response (403, Invalid Period):
{
"message": "Invalid period"
}
Example response (409, Duplicate Order Ref):
{
"message": "Duplicate order reference"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a task
Deletes a route task and its associated extra data from the task-type-specific table.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/tasks/16" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/tasks/16"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/tasks/16';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/tasks/16'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, Success):
Empty response
Example response (403, Forbidden):
{
"message": "Forbidden"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get related tasks
requires authentication
Returns tasks related to a specific object type and task ID.
Get tasks by order reference numbers
requires authentication
Returns tasks matching the specified order reference numbers with profile data.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/routetasksbynr?nr[]=12345&nr[]=12346" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"nr\": [
16
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/routetasksbynr"
);
const params = {
"nr[0]": "12345",
"nr[1]": "12346",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"nr": [
16
]
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasksbynr';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'nr[0]' => '12345',
'nr[1]' => '12346',
],
'json' => [
'nr' => [
16,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasksbynr'
payload = {
"nr": [
16
]
}
params = {
'nr[0]': '12345',
'nr[1]': '12346',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get tasks by work order
requires authentication
Returns all tasks matching the specified work order number with profile data.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/routetasksbywofull/12345" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/routetasksbywofull/12345"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasksbywofull/12345';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasksbywofull/12345'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Search field values
requires authentication
Returns matching values for autocomplete suggestions.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/search/carrier?query=trans" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"query\": \"b\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/search/carrier"
);
const params = {
"query": "trans",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"query": "b"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/search/carrier';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'query' => 'trans',
],
'json' => [
'query' => 'b',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/search/carrier'
payload = {
"query": "b"
}
params = {
'query': 'trans',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (200):
[
"Transport ABC",
"Transport XYZ"
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get open tasks
requires authentication
Returns all open (active) tasks for a specific vehicle within a date period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/opentasks?datetime[]=2025-01-01+00%3A00%3A00&datetime[]=2025-01-07+23%3A59%3A59&obj=ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"datetime\": \"architecto\",
\"obj\": \"ngzmiy\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/opentasks"
);
const params = {
"datetime[0]": "2025-01-01 00:00:00",
"datetime[1]": "2025-01-07 23:59:59",
"obj": "ABC123",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"datetime": "architecto",
"obj": "ngzmiy"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/opentasks';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => '2025-01-01 00:00:00',
'datetime[1]' => '2025-01-07 23:59:59',
'obj' => 'ABC123',
],
'json' => [
'datetime' => 'architecto',
'obj' => 'ngzmiy',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/opentasks'
payload = {
"datetime": "architecto",
"obj": "ngzmiy"
}
params = {
'datetime[0]': '2025-01-01 00:00:00',
'datetime[1]': '2025-01-07 23:59:59',
'obj': 'ABC123',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (200):
[
{
"id": 1,
"object_id": "ABC123",
"status": 1,
"preparation_time": "2025-01-01 10:00:00"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get tasks by group
requires authentication
Returns all tasks belonging to a specific group.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/routetasksbygroups/123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/routetasksbygroups/123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasksbygroups/123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasksbygroups/123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
[
{
"id": 1,
"group_id": 123,
"status": 1
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Bulk update tasks in a group
requires authentication
Updates all tasks in a group with the provided data. If activating tasks, also activates the group and sends a push notification.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/routetasksbygroups/123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"status\": 1,
\"active\": true,
\"object_id\": \"ABC123\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/routetasksbygroups/123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"status": 1,
"active": true,
"object_id": "ABC123"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasksbygroups/123';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'status' => 1,
'active' => true,
'object_id' => 'ABC123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasksbygroups/123'
payload = {
"status": 1,
"active": true,
"object_id": "ABC123"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"updated": 5
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get tasks PDF by work order
requires authentication
Generates a PDF report for all tasks associated with a specific work order number.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/tasksbywopdf/12345" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/tasksbywopdf/12345"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/tasksbywopdf/12345';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/tasksbywopdf/12345'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, PDF file):
PDF binary content
Example response (404):
{
"message": "Not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Orders
APIs for managing orders.
Get all orders
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/orders?per_page=30&page=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/orders"
);
const params = {
"per_page": "30",
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/orders';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '30',
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/orders'
params = {
'per_page': '30',
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
[
{
"id": 1,
"oid": "metrotec",
"start_address": "Warehouse, Tallinn",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2026-01-15 08:00:00",
"stop_time": "2026-01-15 17:00:00",
"order_ref": "ORD-2026-001",
"order_details": "Fragile goods",
"customer_id": 1,
"task_address": "Customer Site, Tartu",
"task_notes": "Call before arrival",
"task_description": "Deliver package to reception",
"driver_notes": null,
"cancel_reason": null,
"status": 1,
"sender": "admin",
"sender_id": null,
"customer": null,
"sender_party": null,
"created_at": "2026-01-15 08:00:00",
"updated_at": "2026-01-15 08:00:00"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new order
requires authentication
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/orders" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"start_address\": \"Warehouse, Tallinn\",
\"lat\": 59.437,
\"lon\": 24.7536,
\"start_time\": \"2026-01-15 08:00:00\",
\"stop_time\": \"2026-01-15 17:00:00\",
\"order_ref\": \"ORD-2026-001\",
\"order_details\": \"Fragile goods - handle with care\",
\"customer_id\": 1,
\"task_address\": \"Customer Site, Tartu\",
\"task_notes\": \"Call customer before arrival\",
\"task_description\": \"Deliver package to reception\",
\"driver_notes\": \"Delivered successfully\",
\"cancel_reason\": \"Customer not available\",
\"status\": 1,
\"sender_id\": 3
}"
const url = new URL(
"https://testapi.metrotec.ee/api/orders"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"start_address": "Warehouse, Tallinn",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2026-01-15 08:00:00",
"stop_time": "2026-01-15 17:00:00",
"order_ref": "ORD-2026-001",
"order_details": "Fragile goods - handle with care",
"customer_id": 1,
"task_address": "Customer Site, Tartu",
"task_notes": "Call customer before arrival",
"task_description": "Deliver package to reception",
"driver_notes": "Delivered successfully",
"cancel_reason": "Customer not available",
"status": 1,
"sender_id": 3
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/orders';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'start_address' => 'Warehouse, Tallinn',
'lat' => 59.437,
'lon' => 24.7536,
'start_time' => '2026-01-15 08:00:00',
'stop_time' => '2026-01-15 17:00:00',
'order_ref' => 'ORD-2026-001',
'order_details' => 'Fragile goods - handle with care',
'customer_id' => 1,
'task_address' => 'Customer Site, Tartu',
'task_notes' => 'Call customer before arrival',
'task_description' => 'Deliver package to reception',
'driver_notes' => 'Delivered successfully',
'cancel_reason' => 'Customer not available',
'status' => 1,
'sender_id' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/orders'
payload = {
"start_address": "Warehouse, Tallinn",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2026-01-15 08:00:00",
"stop_time": "2026-01-15 17:00:00",
"order_ref": "ORD-2026-001",
"order_details": "Fragile goods - handle with care",
"customer_id": 1,
"task_address": "Customer Site, Tartu",
"task_notes": "Call customer before arrival",
"task_description": "Deliver package to reception",
"driver_notes": "Delivered successfully",
"cancel_reason": "Customer not available",
"status": 1,
"sender_id": 3
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201):
{
"id": 1,
"oid": "metrotec",
"start_address": "Warehouse, Tallinn",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2026-01-15 08:00:00",
"stop_time": "2026-01-15 17:00:00",
"order_ref": "ORD-2026-001",
"order_details": "Fragile goods",
"customer_id": 1,
"task_address": "Customer Site, Tartu",
"task_notes": "Call before arrival",
"task_description": "Deliver package to reception",
"driver_notes": null,
"cancel_reason": null,
"status": 1,
"sender": "admin",
"sender_id": null,
"customer": null,
"sender_party": null,
"created_at": "2026-01-15 08:00:00",
"updated_at": "2026-01-15 08:00:00"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a specific order
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/orders/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/orders/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/orders/16';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/orders/16'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"id": 1,
"oid": "metrotec",
"start_address": "Warehouse, Tallinn",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2026-01-15 08:00:00",
"stop_time": "2026-01-15 17:00:00",
"order_ref": "ORD-2026-001",
"order_details": "Fragile goods",
"customer_id": 1,
"task_address": "Customer Site, Tartu",
"task_notes": "Call before arrival",
"task_description": "Deliver package to reception",
"driver_notes": null,
"cancel_reason": null,
"status": 1,
"sender": "admin",
"sender_id": null,
"customer": null,
"sender_party": null,
"created_at": "2026-01-15 08:00:00",
"updated_at": "2026-01-15 08:00:00"
}
Example response (404, Not found):
{
"message": "Not Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an order
requires authentication
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/orders/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"start_address\": \"Warehouse, Tallinn\",
\"lat\": 59.437,
\"lon\": 24.7536,
\"start_time\": \"2026-01-15 08:00:00\",
\"stop_time\": \"2026-01-15 17:00:00\",
\"order_ref\": \"ORD-2026-001\",
\"order_details\": \"Fragile goods - handle with care\",
\"customer_id\": 1,
\"task_address\": \"Customer Site, Tartu\",
\"task_notes\": \"Call customer before arrival\",
\"task_description\": \"Deliver package to reception\",
\"driver_notes\": \"Delivered successfully\",
\"cancel_reason\": \"Customer not available\",
\"status\": 1,
\"sender_id\": 3
}"
const url = new URL(
"https://testapi.metrotec.ee/api/orders/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"start_address": "Warehouse, Tallinn",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2026-01-15 08:00:00",
"stop_time": "2026-01-15 17:00:00",
"order_ref": "ORD-2026-001",
"order_details": "Fragile goods - handle with care",
"customer_id": 1,
"task_address": "Customer Site, Tartu",
"task_notes": "Call customer before arrival",
"task_description": "Deliver package to reception",
"driver_notes": "Delivered successfully",
"cancel_reason": "Customer not available",
"status": 1,
"sender_id": 3
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/orders/16';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'start_address' => 'Warehouse, Tallinn',
'lat' => 59.437,
'lon' => 24.7536,
'start_time' => '2026-01-15 08:00:00',
'stop_time' => '2026-01-15 17:00:00',
'order_ref' => 'ORD-2026-001',
'order_details' => 'Fragile goods - handle with care',
'customer_id' => 1,
'task_address' => 'Customer Site, Tartu',
'task_notes' => 'Call customer before arrival',
'task_description' => 'Deliver package to reception',
'driver_notes' => 'Delivered successfully',
'cancel_reason' => 'Customer not available',
'status' => 1,
'sender_id' => 3,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/orders/16'
payload = {
"start_address": "Warehouse, Tallinn",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2026-01-15 08:00:00",
"stop_time": "2026-01-15 17:00:00",
"order_ref": "ORD-2026-001",
"order_details": "Fragile goods - handle with care",
"customer_id": 1,
"task_address": "Customer Site, Tartu",
"task_notes": "Call customer before arrival",
"task_description": "Deliver package to reception",
"driver_notes": "Delivered successfully",
"cancel_reason": "Customer not available",
"status": 1,
"sender_id": 3
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"id": 1,
"oid": "metrotec",
"start_address": "Warehouse, Tallinn",
"lat": 59.437,
"lon": 24.7536,
"start_time": "2026-01-15 08:00:00",
"stop_time": "2026-01-15 17:00:00",
"order_ref": "ORD-2026-001",
"order_details": "Updated details",
"customer_id": 1,
"task_address": "Customer Site, Tartu",
"task_notes": "Call before arrival",
"task_description": "Deliver package to reception",
"driver_notes": "Delivered successfully",
"cancel_reason": null,
"status": 2,
"sender": "admin",
"sender_id": null,
"customer": null,
"sender_party": null,
"created_at": "2026-01-15 08:00:00",
"updated_at": "2026-01-15 10:00:00"
}
Example response (403, Forbidden):
{
"message": "Forbidden"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete an order
requires authentication
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/orders/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/orders/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/orders/16';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/orders/16'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, Success):
Empty response
Example response (403, Forbidden):
{
"message": "Forbidden"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Parties
APIs for managing parties.
Get all parties
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/parties?filter%5Barchived%5D=1&filter%5Brole%5D=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/parties"
);
const params = {
"filter[archived]": "1",
"filter[role]": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/parties';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'filter[archived]' => '1',
'filter[role]' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/parties'
params = {
'filter[archived]': '1',
'filter[role]': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
[
{
"id": 1,
"oid": "metrotec",
"role": [
1,
2
],
"lang": "est",
"company_name": "Example Company",
"company_no": "12345678",
"company_vat_no": "EE123456789",
"company_country_code": "+372",
"company_phone_nr": "5555 5555",
"company_email": "info@example.com",
"company_address": "Example Street 1, Tallinn",
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5555 5556",
"contact_email": "john@example.com",
"active": true,
"default": false,
"created_at": "2025-01-01T00:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new party
requires authentication
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/parties" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"company_name\": \"Example Company\",
\"role\": [
1
],
\"lang\": \"est\",
\"company_no\": \"12345678\",
\"company_vat_no\": \"EE123456789\",
\"company_country_code\": \"+372\",
\"company_phone_nr\": \"5555 5555\",
\"company_email\": \"info@example.com\",
\"company_address\": \"Example Street 1, Tallinn\",
\"contact_name\": \"John Doe\",
\"contact_country_code\": \"+372\",
\"contact_phone_nr\": \"5555 5556\",
\"contact_email\": \"john@example.com\",
\"active\": true,
\"default\": false,
\"payment_term\": \"b\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/parties"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"company_name": "Example Company",
"role": [
1
],
"lang": "est",
"company_no": "12345678",
"company_vat_no": "EE123456789",
"company_country_code": "+372",
"company_phone_nr": "5555 5555",
"company_email": "info@example.com",
"company_address": "Example Street 1, Tallinn",
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5555 5556",
"contact_email": "john@example.com",
"active": true,
"default": false,
"payment_term": "b"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/parties';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'company_name' => 'Example Company',
'role' => [
1,
],
'lang' => 'est',
'company_no' => '12345678',
'company_vat_no' => 'EE123456789',
'company_country_code' => '+372',
'company_phone_nr' => '5555 5555',
'company_email' => 'info@example.com',
'company_address' => 'Example Street 1, Tallinn',
'contact_name' => 'John Doe',
'contact_country_code' => '+372',
'contact_phone_nr' => '5555 5556',
'contact_email' => 'john@example.com',
'active' => true,
'default' => false,
'payment_term' => 'b',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/parties'
payload = {
"company_name": "Example Company",
"role": [
1
],
"lang": "est",
"company_no": "12345678",
"company_vat_no": "EE123456789",
"company_country_code": "+372",
"company_phone_nr": "5555 5555",
"company_email": "info@example.com",
"company_address": "Example Street 1, Tallinn",
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5555 5556",
"contact_email": "john@example.com",
"active": true,
"default": false,
"payment_term": "b"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201):
{
"id": 1,
"oid": "metrotec",
"role": [
1,
2
],
"def_lang": "est",
"company_name": "Example Company",
"company_no": "12345678",
"company_vat_no": "EE123456789",
"company_country_code": "+372",
"company_phone_nr": "5555 5555",
"company_email": "info@example.com",
"company_address": "Example Street 1, Tallinn",
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5555 5556",
"contact_email": "john@example.com",
"active": true,
"default": false,
"created_at": "2025-11-28T10:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a specific party
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/parties/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/parties/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/parties/16';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/parties/16'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"id": 1,
"oid": "metrotec",
"role": [
1,
2
],
"def_lang": "est",
"company_name": "Example Company",
"company_no": "12345678",
"company_vat_no": "EE123456789",
"company_country_code": "+372",
"company_phone_nr": "5555 5555",
"company_email": "info@example.com",
"company_address": "Example Street 1, Tallinn",
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5555 5556",
"contact_email": "john@example.com",
"active": true,
"default": false,
"created_at": "2025-01-01T00:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a party
requires authentication
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/parties/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"company_name\": \"Example Company\",
\"role\": [
1
],
\"lang\": \"est\",
\"company_no\": \"12345678\",
\"company_vat_no\": \"EE123456789\",
\"company_country_code\": \"+372\",
\"company_phone_nr\": \"5555 5555\",
\"company_email\": \"info@example.com\",
\"company_address\": \"Example Street 1, Tallinn\",
\"contact_name\": \"John Doe\",
\"contact_country_code\": \"+372\",
\"contact_phone_nr\": \"5555 5556\",
\"contact_email\": \"john@example.com\",
\"active\": true,
\"default\": false,
\"payment_term\": \"b\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/parties/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"company_name": "Example Company",
"role": [
1
],
"lang": "est",
"company_no": "12345678",
"company_vat_no": "EE123456789",
"company_country_code": "+372",
"company_phone_nr": "5555 5555",
"company_email": "info@example.com",
"company_address": "Example Street 1, Tallinn",
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5555 5556",
"contact_email": "john@example.com",
"active": true,
"default": false,
"payment_term": "b"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/parties/16';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'company_name' => 'Example Company',
'role' => [
1,
],
'lang' => 'est',
'company_no' => '12345678',
'company_vat_no' => 'EE123456789',
'company_country_code' => '+372',
'company_phone_nr' => '5555 5555',
'company_email' => 'info@example.com',
'company_address' => 'Example Street 1, Tallinn',
'contact_name' => 'John Doe',
'contact_country_code' => '+372',
'contact_phone_nr' => '5555 5556',
'contact_email' => 'john@example.com',
'active' => true,
'default' => false,
'payment_term' => 'b',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/parties/16'
payload = {
"company_name": "Example Company",
"role": [
1
],
"lang": "est",
"company_no": "12345678",
"company_vat_no": "EE123456789",
"company_country_code": "+372",
"company_phone_nr": "5555 5555",
"company_email": "info@example.com",
"company_address": "Example Street 1, Tallinn",
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5555 5556",
"contact_email": "john@example.com",
"active": true,
"default": false,
"payment_term": "b"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"id": 1,
"oid": "metrotec",
"role": [
1,
2
],
"def_lang": "est",
"company_name": "Updated Company",
"company_no": "12345678",
"company_vat_no": "EE123456789",
"company_country_code": "+372",
"company_phone_nr": "5555 5555",
"company_email": "info@example.com",
"company_address": "Example Street 1, Tallinn",
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5555 5556",
"contact_email": "john@example.com",
"active": true,
"default": false,
"created_at": "2025-01-01T00:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a party
requires authentication
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/parties/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/parties/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/parties/16';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/parties/16'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, success):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Products
APIs for managing route task products.
Get all products
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/products?archived=1&show_type=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/products"
);
const params = {
"archived": "1",
"show_type": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/products';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'archived' => '1',
'show_type' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/products'
params = {
'archived': '1',
'show_type': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
[
{
"id": 1,
"oid": "metrotec",
"value": "PROD001",
"text": "Product Name",
"external_id": "EXT123",
"active": true,
"default": false,
"show_type": 1,
"created_at": "2025-01-01T00:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new product
requires authentication
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/products" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"value\": \"PROD001\",
\"text\": \"Product Name\",
\"external_id\": \"EXT123\",
\"comment\": \"Additional product information\",
\"active\": true,
\"default\": false,
\"show_type\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/products"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"value": "PROD001",
"text": "Product Name",
"external_id": "EXT123",
"comment": "Additional product information",
"active": true,
"default": false,
"show_type": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/products';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'value' => 'PROD001',
'text' => 'Product Name',
'external_id' => 'EXT123',
'comment' => 'Additional product information',
'active' => true,
'default' => false,
'show_type' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/products'
payload = {
"value": "PROD001",
"text": "Product Name",
"external_id": "EXT123",
"comment": "Additional product information",
"active": true,
"default": false,
"show_type": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201):
{
"id": 1,
"oid": "metrotec",
"value": "PROD001",
"text": "Product Name",
"external_id": "EXT123",
"active": true,
"default": false,
"created_at": "2025-11-28T10:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a specific product
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/products/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/products/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/products/16';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/products/16'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"id": 1,
"oid": "metrotec",
"value": "PROD001",
"text": "Product Name",
"external_id": "EXT123",
"active": true,
"default": false,
"created_at": "2025-01-01T00:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a product
requires authentication
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/products/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"value\": \"PROD001\",
\"text\": \"Product Name\",
\"external_id\": \"EXT123\",
\"comment\": \"Additional product information\",
\"active\": true,
\"default\": false,
\"show_type\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/products/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"value": "PROD001",
"text": "Product Name",
"external_id": "EXT123",
"comment": "Additional product information",
"active": true,
"default": false,
"show_type": 1
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/products/16';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'value' => 'PROD001',
'text' => 'Product Name',
'external_id' => 'EXT123',
'comment' => 'Additional product information',
'active' => true,
'default' => false,
'show_type' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/products/16'
payload = {
"value": "PROD001",
"text": "Product Name",
"external_id": "EXT123",
"comment": "Additional product information",
"active": true,
"default": false,
"show_type": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"id": 1,
"oid": "metrotec",
"value": "PROD001",
"text": "Updated Product Name",
"external_id": "EXT123",
"active": true,
"default": false,
"created_at": "2025-01-01T00:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a product
requires authentication
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/products/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/products/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/products/16';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/products/16'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, success):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Ships
APIs for managing ships.
Get all ships
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/ships?filter%5Barchived%5D=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/ships"
);
const params = {
"filter[archived]": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ships';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'filter[archived]' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ships'
params = {
'filter[archived]': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
[
{
"id": 1,
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"captain_name": "Captain Jack",
"license_number": "LIC-2025-001",
"receiver": "Fish Processing Ltd",
"receiver_address": "Harbor Street 1, Tallinn",
"fish_destination": "Processing Plant A",
"active": true,
"created_at": "2025-01-01T00:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new ship
requires authentication
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/ships" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ship_name\": \"Aurora\",
\"owner_name\": \"John Smith\",
\"board_number\": \"EST-1234\",
\"captain_name\": \"Captain Jack\",
\"email\": \"captain@ship.com, owner@ship.com\",
\"license_number\": \"LIC-2025-001\",
\"receiver_id\": 1,
\"fish_destination\": {
\"address\": \"Processing Plant A, Harbor 5\",
\"lat\": 59.437,
\"lon\": 24.753
},
\"active\": true
}"
const url = new URL(
"https://testapi.metrotec.ee/api/ships"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"captain_name": "Captain Jack",
"email": "captain@ship.com, owner@ship.com",
"license_number": "LIC-2025-001",
"receiver_id": 1,
"fish_destination": {
"address": "Processing Plant A, Harbor 5",
"lat": 59.437,
"lon": 24.753
},
"active": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ships';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'ship_name' => 'Aurora',
'owner_name' => 'John Smith',
'board_number' => 'EST-1234',
'captain_name' => 'Captain Jack',
'email' => 'captain@ship.com, owner@ship.com',
'license_number' => 'LIC-2025-001',
'receiver_id' => 1,
'fish_destination' => [
'address' => 'Processing Plant A, Harbor 5',
'lat' => 59.437,
'lon' => 24.753,
],
'active' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ships'
payload = {
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"captain_name": "Captain Jack",
"email": "captain@ship.com, owner@ship.com",
"license_number": "LIC-2025-001",
"receiver_id": 1,
"fish_destination": {
"address": "Processing Plant A, Harbor 5",
"lat": 59.437,
"lon": 24.753
},
"active": true
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201):
{
"id": 1,
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"captain_name": "Captain Jack",
"license_number": "LIC-2025-001",
"receiver": "Fish Processing Ltd",
"receiver_address": "Harbor Street 1, Tallinn",
"fish_destination": "Processing Plant A",
"active": true,
"created_at": "2025-11-28T10:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a specific ship
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/ships/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/ships/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ships/16';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ships/16'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"id": 1,
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"captain_name": "Captain Jack",
"license_number": "LIC-2025-001",
"receiver": "Fish Processing Ltd",
"receiver_address": "Harbor Street 1, Tallinn",
"fish_destination": "Processing Plant A",
"active": true,
"created_at": "2025-01-01T00:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a ship
requires authentication
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/ships/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ship_name\": \"Aurora\",
\"owner_name\": \"John Smith\",
\"board_number\": \"EST-1234\",
\"captain_name\": \"Captain Jack\",
\"email\": \"captain@ship.com, owner@ship.com\",
\"license_number\": \"LIC-2025-001\",
\"receiver_id\": 1,
\"fish_destination\": {
\"address\": \"Processing Plant A, Harbor 5\",
\"lat\": 59.437,
\"lon\": 24.753
},
\"active\": true
}"
const url = new URL(
"https://testapi.metrotec.ee/api/ships/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"captain_name": "Captain Jack",
"email": "captain@ship.com, owner@ship.com",
"license_number": "LIC-2025-001",
"receiver_id": 1,
"fish_destination": {
"address": "Processing Plant A, Harbor 5",
"lat": 59.437,
"lon": 24.753
},
"active": true
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ships/16';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'ship_name' => 'Aurora',
'owner_name' => 'John Smith',
'board_number' => 'EST-1234',
'captain_name' => 'Captain Jack',
'email' => 'captain@ship.com, owner@ship.com',
'license_number' => 'LIC-2025-001',
'receiver_id' => 1,
'fish_destination' => [
'address' => 'Processing Plant A, Harbor 5',
'lat' => 59.437,
'lon' => 24.753,
],
'active' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ships/16'
payload = {
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"captain_name": "Captain Jack",
"email": "captain@ship.com, owner@ship.com",
"license_number": "LIC-2025-001",
"receiver_id": 1,
"fish_destination": {
"address": "Processing Plant A, Harbor 5",
"lat": 59.437,
"lon": 24.753
},
"active": true
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"id": 1,
"ship_name": "Aurora Updated",
"owner_name": "John Smith",
"board_number": "EST-1234",
"captain_name": "Captain Jack",
"license_number": "LIC-2025-001",
"receiver": "Fish Processing Ltd",
"receiver_address": "Harbor Street 1, Tallinn",
"fish_destination": "Processing Plant A",
"active": true,
"created_at": "2025-01-01T00:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a ship
requires authentication
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/ships/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/ships/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/ships/16';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/ships/16'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, success):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Fish Documents
Fish documents report and export.
Get fish documents report
requires authentication
Returns fish documents filtered by date range and other criteria.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/fishdocuments/report?filter[start_time][]=2026-01-01&filter[start_time][]=2026-01-31&filter[status]=1&filter[ship_id]=1&filter[object_id]=ABC123&filter[carrier_id]=1&filter%5Bstart_time%5D[]=2026-01-01&filter%5Bstart_time%5D[]=2026-01-31&filter%5Bstatus%5D=1&filter%5Bship_id%5D=1&filter%5Bobject_id%5D=ABC123&filter%5Bcarrier_id%5D=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/fishdocuments/report"
);
const params = {
"filter[start_time][0]": "2026-01-01",
"filter[start_time][1]": "2026-01-31",
"filter[status]": "1",
"filter[ship_id]": "1",
"filter[object_id]": "ABC123",
"filter[carrier_id]": "1",
"filter[start_time][0]": "2026-01-01",
"filter[start_time][1]": "2026-01-31",
"filter[status]": "1",
"filter[ship_id]": "1",
"filter[object_id]": "ABC123",
"filter[carrier_id]": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fishdocuments/report';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'filter[start_time][0]' => '2026-01-01',
'filter[start_time][1]' => '2026-01-31',
'filter[status]' => '1',
'filter[ship_id]' => '1',
'filter[object_id]' => 'ABC123',
'filter[carrier_id]' => '1',
'filter[start_time][0]' => '2026-01-01',
'filter[start_time][1]' => '2026-01-31',
'filter[status]' => '1',
'filter[ship_id]' => '1',
'filter[object_id]' => 'ABC123',
'filter[carrier_id]' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fishdocuments/report'
params = {
'filter[start_time][0]': '2026-01-01',
'filter[start_time][1]': '2026-01-31',
'filter[status]': '1',
'filter[ship_id]': '1',
'filter[object_id]': 'ABC123',
'filter[carrier_id]': '1',
'filter[start_time][0]': '2026-01-01',
'filter[start_time][1]': '2026-01-31',
'filter[status]': '1',
'filter[ship_id]': '1',
'filter[object_id]': 'ABC123',
'filter[carrier_id]': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get all fish documents
requires authentication
Returns documents that are not sent/finished, or sent/finished today.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/fishdocuments" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/fishdocuments"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fishdocuments';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fishdocuments'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
[
{
"id": 1,
"document_number": "FD-2026-001",
"object_id": "ABC123",
"ship_name": "Aurora",
"receiver_id": 1,
"receiver": {
"id": 1,
"company_name": "Fish Processing Ltd"
},
"destination_address": "Harbor Street 1, Tallinn",
"quantity": 500.5,
"status": 0,
"created_at": "2026-01-14T10:00:00.000000Z",
"updated_at": "2026-01-14T10:00:00.000000Z"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new fish document
requires authentication
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/fishdocuments" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"trailer_nr\": \"TRL-456\",
\"ship_id\": 1,
\"ship_name\": \"Aurora\",
\"owner_name\": \"John Smith\",
\"board_number\": \"EST-1234\",
\"license_number\": \"LIC-2026-001\",
\"voyage_number\": \"VOY-2026-005\",
\"receiver_id\": 1,
\"receiver_name\": \"Jane Doe\",
\"destination_address\": \"Harbor Street 1, Tallinn\",
\"destination_lat\": 59.437,
\"destination_lon\": 24.753,
\"products\": [
{
\"product_id\": 1,
\"quantity\": 500,
\"fishing_area\": \"IIId\"
}
],
\"category\": \"A\",
\"captain_name\": \"Captain Jack\",
\"carrier_id\": 1,
\"unloading_at\": \"2026-01-15 10:00:00\",
\"unloading_location\": \"Dock B\",
\"status\": 0
}"
const url = new URL(
"https://testapi.metrotec.ee/api/fishdocuments"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"trailer_nr": "TRL-456",
"ship_id": 1,
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"license_number": "LIC-2026-001",
"voyage_number": "VOY-2026-005",
"receiver_id": 1,
"receiver_name": "Jane Doe",
"destination_address": "Harbor Street 1, Tallinn",
"destination_lat": 59.437,
"destination_lon": 24.753,
"products": [
{
"product_id": 1,
"quantity": 500,
"fishing_area": "IIId"
}
],
"category": "A",
"captain_name": "Captain Jack",
"carrier_id": 1,
"unloading_at": "2026-01-15 10:00:00",
"unloading_location": "Dock B",
"status": 0
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fishdocuments';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'trailer_nr' => 'TRL-456',
'ship_id' => 1,
'ship_name' => 'Aurora',
'owner_name' => 'John Smith',
'board_number' => 'EST-1234',
'license_number' => 'LIC-2026-001',
'voyage_number' => 'VOY-2026-005',
'receiver_id' => 1,
'receiver_name' => 'Jane Doe',
'destination_address' => 'Harbor Street 1, Tallinn',
'destination_lat' => 59.437,
'destination_lon' => 24.753,
'products' => [
[
'product_id' => 1,
'quantity' => 500,
'fishing_area' => 'IIId',
],
],
'category' => 'A',
'captain_name' => 'Captain Jack',
'carrier_id' => 1,
'unloading_at' => '2026-01-15 10:00:00',
'unloading_location' => 'Dock B',
'status' => 0,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fishdocuments'
payload = {
"object_id": "ABC123",
"trailer_nr": "TRL-456",
"ship_id": 1,
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"license_number": "LIC-2026-001",
"voyage_number": "VOY-2026-005",
"receiver_id": 1,
"receiver_name": "Jane Doe",
"destination_address": "Harbor Street 1, Tallinn",
"destination_lat": 59.437,
"destination_lon": 24.753,
"products": [
{
"product_id": 1,
"quantity": 500,
"fishing_area": "IIId"
}
],
"category": "A",
"captain_name": "Captain Jack",
"carrier_id": 1,
"unloading_at": "2026-01-15 10:00:00",
"unloading_location": "Dock B",
"status": 0
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201):
{
"id": 1,
"document_number": "FD-2026-001",
"object_id": "ABC123",
"ship_name": "Aurora",
"status": 0,
"created_at": "2026-01-14T10:00:00.000000Z",
"updated_at": "2026-01-14T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a specific fish document
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/fishdocuments/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/fishdocuments/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fishdocuments/16';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fishdocuments/16'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"id": 1,
"document_number": "FD-2026-001",
"object_id": "ABC123",
"trailer_nr": "TRL-456",
"ship_id": 1,
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"license_number": "LIC-2026-001",
"voyage_number": "VOY-2026-005",
"receiver_id": 1,
"receiver": {
"id": 1,
"company_name": "Fish Processing Ltd"
},
"receiver_name": "Jane Doe",
"destination_address": "Harbor Street 1, Tallinn",
"destination_lat": 59.437,
"destination_lon": 24.753,
"product_id": 1,
"quantity": 500.5,
"fishing_area": "IIId",
"containers": 10,
"category": "A",
"captain_name": "Captain Jack",
"carrier_name": "Transport Co",
"unloading_at": "2026-01-15T10:00:00.000000Z",
"unloading_location": "Dock B",
"status": 0,
"captain_signed": false,
"carrier_signed": false,
"receiver_signed": false,
"created_at": "2026-01-14T10:00:00.000000Z",
"updated_at": "2026-01-14T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a fish document
requires authentication
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/fishdocuments/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"trailer_nr\": \"TRL-456\",
\"ship_id\": 1,
\"ship_name\": \"Aurora\",
\"owner_name\": \"John Smith\",
\"board_number\": \"EST-1234\",
\"license_number\": \"LIC-2026-001\",
\"voyage_number\": \"VOY-2026-005\",
\"receiver_id\": 1,
\"receiver_name\": \"Jane Doe\",
\"destination_address\": \"Harbor Street 1, Tallinn\",
\"destination_lat\": 59.437,
\"destination_lon\": 24.753,
\"products\": [
{
\"product_id\": 1,
\"quantity\": 500,
\"fishing_area\": \"IIId\"
}
],
\"category\": \"A\",
\"captain_name\": \"Captain Jack\",
\"carrier_id\": 1,
\"unloading_at\": \"2026-01-15 10:00:00\",
\"unloading_location\": \"Dock B\",
\"status\": 0
}"
const url = new URL(
"https://testapi.metrotec.ee/api/fishdocuments/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"trailer_nr": "TRL-456",
"ship_id": 1,
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"license_number": "LIC-2026-001",
"voyage_number": "VOY-2026-005",
"receiver_id": 1,
"receiver_name": "Jane Doe",
"destination_address": "Harbor Street 1, Tallinn",
"destination_lat": 59.437,
"destination_lon": 24.753,
"products": [
{
"product_id": 1,
"quantity": 500,
"fishing_area": "IIId"
}
],
"category": "A",
"captain_name": "Captain Jack",
"carrier_id": 1,
"unloading_at": "2026-01-15 10:00:00",
"unloading_location": "Dock B",
"status": 0
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fishdocuments/16';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'trailer_nr' => 'TRL-456',
'ship_id' => 1,
'ship_name' => 'Aurora',
'owner_name' => 'John Smith',
'board_number' => 'EST-1234',
'license_number' => 'LIC-2026-001',
'voyage_number' => 'VOY-2026-005',
'receiver_id' => 1,
'receiver_name' => 'Jane Doe',
'destination_address' => 'Harbor Street 1, Tallinn',
'destination_lat' => 59.437,
'destination_lon' => 24.753,
'products' => [
[
'product_id' => 1,
'quantity' => 500,
'fishing_area' => 'IIId',
],
],
'category' => 'A',
'captain_name' => 'Captain Jack',
'carrier_id' => 1,
'unloading_at' => '2026-01-15 10:00:00',
'unloading_location' => 'Dock B',
'status' => 0,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fishdocuments/16'
payload = {
"object_id": "ABC123",
"trailer_nr": "TRL-456",
"ship_id": 1,
"ship_name": "Aurora",
"owner_name": "John Smith",
"board_number": "EST-1234",
"license_number": "LIC-2026-001",
"voyage_number": "VOY-2026-005",
"receiver_id": 1,
"receiver_name": "Jane Doe",
"destination_address": "Harbor Street 1, Tallinn",
"destination_lat": 59.437,
"destination_lon": 24.753,
"products": [
{
"product_id": 1,
"quantity": 500,
"fishing_area": "IIId"
}
],
"category": "A",
"captain_name": "Captain Jack",
"carrier_id": 1,
"unloading_at": "2026-01-15 10:00:00",
"unloading_location": "Dock B",
"status": 0
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"id": 1,
"document_number": "FD-2026-001",
"object_id": "ABC123",
"ship_name": "Aurora Updated",
"status": 1,
"created_at": "2026-01-14T10:00:00.000000Z",
"updated_at": "2026-01-14T11:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Task Groups
APIs for managing route task groups. Task groups organize multiple route tasks into a single delivery run or work session.
Get all task groups
requires authentication
Returns a list of active task groups for the authenticated user. Groups are filtered based on:
- Groups with group_date >= today
- Or groups with group_date < today that have at least one task with an active status
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/routetasksgroups" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/routetasksgroups"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasksgroups';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasksgroups'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
[
{
"id": 1,
"oid": "metrotec",
"name": "Morning Route",
"group_date": "2025-01-20T08:00:00.000000Z",
"object_id": "ABC123",
"other_object_id": null,
"work_started_at": null,
"should_return": true,
"active": true,
"driver_name": "John Doe",
"languages": "Estonian, English",
"driver_phone": "+372 5555 5555",
"trailer_number": "TRL-123",
"carrier_id": 1,
"status": null,
"created_at": "2025-01-19T10:00:00.000000Z",
"updated_at": "2025-01-19T10:00:00.000000Z",
"carrier": {
"id": 1,
"company_name": "ABC Logistics",
"company_no": "12345678",
"company_vat_no": "EE123456789",
"company_phone_nr": "+372 5555 5555",
"company_country_code": "+372",
"company_email": "info@abc.com",
"company_address": "Warehouse St 1"
}
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new task group
requires authentication
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/routetasksgroups" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Morning Delivery Route\",
\"group_date\": \"2025-01-20 08:00:00\",
\"object_id\": \"ABC123\",
\"other_object_id\": \"XYZ789\",
\"work_started_at\": \"2025-01-20 08:15:00\",
\"should_return\": true,
\"active\": true,
\"driver_name\": \"John Doe\",
\"languages\": \"Estonian, English, Russian\",
\"driver_phone\": \"+372 5555 5555\",
\"trailer_number\": \"TRL-123\",
\"carrier_id\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/routetasksgroups"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Morning Delivery Route",
"group_date": "2025-01-20 08:00:00",
"object_id": "ABC123",
"other_object_id": "XYZ789",
"work_started_at": "2025-01-20 08:15:00",
"should_return": true,
"active": true,
"driver_name": "John Doe",
"languages": "Estonian, English, Russian",
"driver_phone": "+372 5555 5555",
"trailer_number": "TRL-123",
"carrier_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasksgroups';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Morning Delivery Route',
'group_date' => '2025-01-20 08:00:00',
'object_id' => 'ABC123',
'other_object_id' => 'XYZ789',
'work_started_at' => '2025-01-20 08:15:00',
'should_return' => true,
'active' => true,
'driver_name' => 'John Doe',
'languages' => 'Estonian, English, Russian',
'driver_phone' => '+372 5555 5555',
'trailer_number' => 'TRL-123',
'carrier_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasksgroups'
payload = {
"name": "Morning Delivery Route",
"group_date": "2025-01-20 08:00:00",
"object_id": "ABC123",
"other_object_id": "XYZ789",
"work_started_at": "2025-01-20 08:15:00",
"should_return": true,
"active": true,
"driver_name": "John Doe",
"languages": "Estonian, English, Russian",
"driver_phone": "+372 5555 5555",
"trailer_number": "TRL-123",
"carrier_id": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201):
{
"id": 1,
"oid": "metrotec",
"name": "Morning Route",
"group_date": "2025-01-20T08:00:00.000000Z",
"object_id": "ABC123",
"other_object_id": null,
"work_started_at": null,
"should_return": true,
"active": true,
"driver_name": "John Doe",
"languages": "Estonian, English",
"driver_phone": "+372 5555 5555",
"trailer_number": "TRL-123",
"carrier_id": 1,
"status": null,
"created_at": "2025-01-19T10:00:00.000000Z",
"updated_at": "2025-01-19T10:00:00.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a specific task group
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/routetasksgroups/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/routetasksgroups/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasksgroups/16';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasksgroups/16'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"id": 1,
"oid": "metrotec",
"name": "Morning Route",
"group_date": "2025-01-20T08:00:00.000000Z",
"object_id": "ABC123",
"other_object_id": null,
"work_started_at": null,
"should_return": true,
"active": true,
"driver_name": "John Doe",
"languages": "Estonian, English",
"driver_phone": "+372 5555 5555",
"trailer_number": "TRL-123",
"carrier_id": 1,
"status": null,
"created_at": "2025-01-19T10:00:00.000000Z",
"updated_at": "2025-01-19T10:00:00.000000Z",
"carrier": {
"id": 1,
"company_name": "ABC Logistics",
"company_no": "12345678",
"company_vat_no": "EE123456789",
"company_phone_nr": "+372 5555 5555",
"company_country_code": "+372",
"company_email": "info@abc.com",
"company_address": "Warehouse St 1"
}
}
Example response (404, Not Found):
{
"message": "Not Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a task group
requires authentication
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/routetasksgroups/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Morning Delivery Route\",
\"group_date\": \"2025-01-20 08:00:00\",
\"object_id\": \"ABC123\",
\"other_object_id\": \"XYZ789\",
\"work_started_at\": \"2025-01-20 08:15:00\",
\"should_return\": true,
\"active\": true,
\"driver_name\": \"John Doe\",
\"languages\": \"Estonian, English, Russian\",
\"driver_phone\": \"+372 5555 5555\",
\"trailer_number\": \"TRL-123\",
\"carrier_id\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/routetasksgroups/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Morning Delivery Route",
"group_date": "2025-01-20 08:00:00",
"object_id": "ABC123",
"other_object_id": "XYZ789",
"work_started_at": "2025-01-20 08:15:00",
"should_return": true,
"active": true,
"driver_name": "John Doe",
"languages": "Estonian, English, Russian",
"driver_phone": "+372 5555 5555",
"trailer_number": "TRL-123",
"carrier_id": 1
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasksgroups/16';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Morning Delivery Route',
'group_date' => '2025-01-20 08:00:00',
'object_id' => 'ABC123',
'other_object_id' => 'XYZ789',
'work_started_at' => '2025-01-20 08:15:00',
'should_return' => true,
'active' => true,
'driver_name' => 'John Doe',
'languages' => 'Estonian, English, Russian',
'driver_phone' => '+372 5555 5555',
'trailer_number' => 'TRL-123',
'carrier_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasksgroups/16'
payload = {
"name": "Morning Delivery Route",
"group_date": "2025-01-20 08:00:00",
"object_id": "ABC123",
"other_object_id": "XYZ789",
"work_started_at": "2025-01-20 08:15:00",
"should_return": true,
"active": true,
"driver_name": "John Doe",
"languages": "Estonian, English, Russian",
"driver_phone": "+372 5555 5555",
"trailer_number": "TRL-123",
"carrier_id": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"id": 1,
"oid": "metrotec",
"name": "Updated Morning Route",
"group_date": "2025-01-20T08:00:00.000000Z",
"object_id": "ABC123",
"other_object_id": null,
"work_started_at": "2025-01-20T08:15:00.000000Z",
"should_return": true,
"active": true,
"driver_name": "John Doe",
"languages": "Estonian, English",
"driver_phone": "+372 5555 5555",
"trailer_number": "TRL-123",
"carrier_id": 1,
"status": null,
"created_at": "2025-01-19T10:00:00.000000Z",
"updated_at": "2025-01-20T08:15:00.000000Z"
}
Example response (403, Forbidden):
{
"message": "Forbidden"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a task group
requires authentication
Soft deletes a task group. The group will be marked as deleted but not permanently removed from the database.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/routetasksgroups/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/routetasksgroups/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasksgroups/16';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasksgroups/16'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, Success):
Empty response
Example response (403, Forbidden):
{
"message": "Forbidden"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create multiple tasks for a group
Creates multiple route tasks and assigns them to the specified group. Returns all tasks belonging to the group after creation.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/routetasksbygroups/16" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"data\": [
{
\"object_id\": \"ABC123\",
\"lat\": 59.437,
\"lon\": 24.754,
\"start_time\": \"2025-01-20 08:00:00\",
\"stop_time\": \"2025-01-20 17:00:00\",
\"order_ref\": \"ORD-001\",
\"order_details\": \"Delivery of goods\",
\"task_address\": \"Tartu, Estonia\",
\"start_lat\": 59.395,
\"start_lon\": 24.662,
\"start_address\": \"Tallinn, Estonia\",
\"cancel_reason\": \"Customer not available\",
\"status\": 1,
\"contact_name\": \"John Doe\",
\"contact_country_code\": \"+372\",
\"contact_phone_nr\": \"5551234\",
\"amount\": 24,
\"weight\": 15000,
\"vehicle_type\": \"Curtainsider\",
\"active\": true,
\"unloading_time\": 45
}
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/routetasksbygroups/16"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"data": [
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.754,
"start_time": "2025-01-20 08:00:00",
"stop_time": "2025-01-20 17:00:00",
"order_ref": "ORD-001",
"order_details": "Delivery of goods",
"task_address": "Tartu, Estonia",
"start_lat": 59.395,
"start_lon": 24.662,
"start_address": "Tallinn, Estonia",
"cancel_reason": "Customer not available",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"amount": 24,
"weight": 15000,
"vehicle_type": "Curtainsider",
"active": true,
"unloading_time": 45
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/routetasksbygroups/16';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'data' => [
[
'object_id' => 'ABC123',
'lat' => 59.437,
'lon' => 24.754,
'start_time' => '2025-01-20 08:00:00',
'stop_time' => '2025-01-20 17:00:00',
'order_ref' => 'ORD-001',
'order_details' => 'Delivery of goods',
'task_address' => 'Tartu, Estonia',
'start_lat' => 59.395,
'start_lon' => 24.662,
'start_address' => 'Tallinn, Estonia',
'cancel_reason' => 'Customer not available',
'status' => 1,
'contact_name' => 'John Doe',
'contact_country_code' => '+372',
'contact_phone_nr' => '5551234',
'amount' => 24.0,
'weight' => 15000,
'vehicle_type' => 'Curtainsider',
'active' => true,
'unloading_time' => 45,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/routetasksbygroups/16'
payload = {
"data": [
{
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.754,
"start_time": "2025-01-20 08:00:00",
"stop_time": "2025-01-20 17:00:00",
"order_ref": "ORD-001",
"order_details": "Delivery of goods",
"task_address": "Tartu, Estonia",
"start_lat": 59.395,
"start_lon": 24.662,
"start_address": "Tallinn, Estonia",
"cancel_reason": "Customer not available",
"status": 1,
"contact_name": "John Doe",
"contact_country_code": "+372",
"contact_phone_nr": "5551234",
"amount": 24,
"weight": 15000,
"vehicle_type": "Curtainsider",
"active": true,
"unloading_time": 45
}
]
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
[
{
"id": 1,
"group_id": 5,
"object_id": "ABC123",
"lat": 59.437,
"lon": 24.754,
"status": 1
}
]
Example response (403, Forbidden):
{
"message": "Forbidden"
}
Example response (404, Group Not Found):
{
"message": "Not Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Settings
Vehicle settings including outputs, events, and geo zones.
Show vehicle settings
requires authentication
Returns device capabilities, outputs, events, and geo zone configuration for a vehicle.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vsettings/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vsettings/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vsettings/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vsettings/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"hasTow": false,
"hasGeo": true,
"hasRepInt": false,
"hasTamperLight": false,
"hasLightSensor": false,
"outputs": [
{
"id": 1,
"name": "Lock",
"pinReq": 0,
"on": "ON",
"off": "OFF",
"disable_ids": [
2
],
"last_command": "ON",
"handled": 1,
"last_command_time": 1705312200,
"stop_registration": 0
}
],
"repInts": [],
"events": [],
"alarm": null,
"zones": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create geo alarm
requires authentication
Assigns a geo zone as an alarm zone for a vehicle.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/geoalarm" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"geozoneID\": 5
}"
const url = new URL(
"https://testapi.metrotec.ee/api/geoalarm"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"geozoneID": 5
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/geoalarm';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'geozoneID' => 5,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/geoalarm'
payload = {
"object_id": "ABC123",
"geozoneID": 5
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"geozoneID": 5,
"object_id": "ABC123",
"geo_id": 1
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete geo alarm
requires authentication
Removes a geo alarm zone assignment.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/geoalarm/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/geoalarm/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/geoalarm/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/geoalarm/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"error": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send output command
requires authentication
Sends an ON or OFF command to a vehicle output. Splits multi-part commands and queues each as a navi request.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/outputs" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 1,
\"action\": \"ON\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/outputs"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 1,
"action": "ON"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/outputs';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'id' => 1,
'action' => 'ON',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/outputs'
payload = {
"id": 1,
"action": "ON"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"object_id": "ABC123",
"handled": 0,
"disable_ids": [
2
],
"last_command": "ON",
"last_command_time": "2025-01-15 08:00:00",
"stop_registration": 0,
"pinReq": 0
}
Example response (400, Output not found):
{
"error": "No_Output"
}
Example response (400, Dynamic output unavailable):
{
"error": "Output_Not_Available"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create event setting
requires authentication
Creates a new vehicle event setting and dispatches the corresponding navi request to the device.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/event" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"eventType\": 2,
\"description\": \"ON\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/event"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"eventType": 2,
"description": "ON"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/event';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'eventType' => 2,
'description' => 'ON',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/event'
payload = {
"object_id": "ABC123",
"eventType": 2,
"description": "ON"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"handled": 0,
"description": "ON",
"eventDate": "2025-01-15 08:00:00",
"date": null
}
Example response (400, Invalid event type):
{
"error": "No_Navi_Request"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete event setting
requires authentication
Deletes a vehicle event setting and cleans up unhandled navi requests.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/event/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/event/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/event/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/event/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"error": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Tech Card
Tech Card
Manage vehicle technical card records with maintenance settings.
List tech cards
requires authentication
Returns all vehicles with tech card data, maintenance dates and odometer readings.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/techcard?object_id=ABC123&mark=Volvo&model=FH16&department=Transport&year=2023&fuelType=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/techcard"
);
const params = {
"object_id": "ABC123",
"mark": "Volvo",
"model": "FH16",
"department": "Transport",
"year": "2023",
"fuelType": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/techcard';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'object_id' => 'ABC123',
'mark' => 'Volvo',
'model' => 'FH16',
'department' => 'Transport',
'year' => '2023',
'fuelType' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/techcard'
params = {
'object_id': 'ABC123',
'mark': 'Volvo',
'model': 'FH16',
'department': 'Transport',
'year': '2023',
'fuelType': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": "ABC123",
"mark": "Volvo",
"model": "FH16",
"department": "Transport",
"fuelType": 1,
"vin": "YV2A4C2A1PB123456",
"year": "2023",
"techCardId": 1,
"calcByM": 0,
"Odo": 150000,
"MotoHrs": 2500,
"next_inspection_by_date": 1,
"next_inspection_date": "2025-06-15",
"alias": "Truck 1",
"work_dates": {},
"next_planned_dates": {},
"next_planned_km": {},
"next_planned_mh": {}
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get tech card
requires authentication
Returns tech card settings and work records for a single vehicle.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/techcard/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/techcard/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/techcard/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/techcard/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"settings": {
"next_inspection_period": 12,
"next_maintenance_period": 12,
"next_maintenance_km": 15000
},
"works": []
}
Example response (403, Object not allowed):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update tech card
requires authentication
Updates or creates a tech card for a vehicle. Also updates tank volume in objects table.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/techcard/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mark\": \"Volvo\",
\"model\": \"FH16\",
\"department\": \"Transport\",
\"fuelType\": 1,
\"year\": \"2023\",
\"vin\": \"YV2A4C2A1PB123456\",
\"next_inspection_date\": \"2026-02-26\",
\"next_inspection_period\": 16,
\"next_maintenance_period\": 22,
\"next_maintenance_km\": 16,
\"next_alcolock_period\": 22,
\"next_tacho_period\": 67,
\"next_inspection_by_date\": true,
\"pto_purpose\": \"1m0\",
\"curb_weight\": \"1m0\",
\"norm_spend\": 4326.41688,
\"tank_vol\": 400
}"
const url = new URL(
"https://testapi.metrotec.ee/api/techcard/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mark": "Volvo",
"model": "FH16",
"department": "Transport",
"fuelType": 1,
"year": "2023",
"vin": "YV2A4C2A1PB123456",
"next_inspection_date": "2026-02-26",
"next_inspection_period": 16,
"next_maintenance_period": 22,
"next_maintenance_km": 16,
"next_alcolock_period": 22,
"next_tacho_period": 67,
"next_inspection_by_date": true,
"pto_purpose": "1m0",
"curb_weight": "1m0",
"norm_spend": 4326.41688,
"tank_vol": 400
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/techcard/ABC123';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mark' => 'Volvo',
'model' => 'FH16',
'department' => 'Transport',
'fuelType' => 1,
'year' => '2023',
'vin' => 'YV2A4C2A1PB123456',
'next_inspection_date' => '2026-02-26',
'next_inspection_period' => 16,
'next_maintenance_period' => 22,
'next_maintenance_km' => 16,
'next_alcolock_period' => 22,
'next_tacho_period' => 67,
'next_inspection_by_date' => true,
'pto_purpose' => '1m0',
'curb_weight' => '1m0',
'norm_spend' => 4326.41688,
'tank_vol' => 400,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/techcard/ABC123'
payload = {
"mark": "Volvo",
"model": "FH16",
"department": "Transport",
"fuelType": 1,
"year": "2023",
"vin": "YV2A4C2A1PB123456",
"next_inspection_date": "2026-02-26",
"next_inspection_period": 16,
"next_maintenance_period": 22,
"next_maintenance_km": 16,
"next_alcolock_period": 22,
"next_tacho_period": 67,
"next_inspection_by_date": true,
"pto_purpose": "1m0",
"curb_weight": "1m0",
"norm_spend": 4326.41688,
"tank_vol": 400
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"settings": {
"next_inspection_period": 12,
"next_maintenance_period": 12,
"next_maintenance_km": 15000
},
"works": []
}
Example response (403, Object not allowed):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Works
Manage tech card work records with row tracking and odometer/motor hours logging.
List tech card works
requires authentication
Returns all tech card work records with optional filtering.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/techcardwork?object_id=ABC123&work_date[]=architecto&done_comment=Oil+change&work_type_id=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/techcardwork"
);
const params = {
"object_id": "ABC123",
"work_date[0]": "architecto",
"done_comment": "Oil change",
"work_type_id": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/techcardwork';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'object_id' => 'ABC123',
'work_date[0]' => 'architecto',
'done_comment' => 'Oil change',
'work_type_id' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/techcardwork'
params = {
'object_id': 'ABC123',
'work_date[0]': 'architecto',
'done_comment': 'Oil change',
'work_type_id': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": 1,
"object_id": "ABC123",
"work_date": "2025-01-15 08:00:00",
"book_comment": "Scheduled",
"done_comment": null,
"completed": 0,
"Odo": 150000,
"MotoHrs": null,
"works": [
1,
2
],
"files": null
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get tech card work
requires authentication
Returns a single tech card work record with rows, files, and decoded log.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/techcardwork/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/techcardwork/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/techcardwork/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/techcardwork/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"work_date": "2025-01-15 08:00:00",
"book_comment": "Scheduled",
"done_comment": null,
"completed": 0,
"Odo": 150000,
"MotoHrs": null,
"rows": [],
"files": [],
"log": []
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create tech card work
requires authentication
Creates a new tech card work record with work type rows.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/techcardwork" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"work_date\": \"2025-01-15 08:00:00\",
\"book_comment\": \"Scheduled maintenance\",
\"work_types\": [
16
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/techcardwork"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"work_date": "2025-01-15 08:00:00",
"book_comment": "Scheduled maintenance",
"work_types": [
16
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/techcardwork';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'work_date' => '2025-01-15 08:00:00',
'book_comment' => 'Scheduled maintenance',
'work_types' => [
16,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/techcardwork'
payload = {
"object_id": "ABC123",
"work_date": "2025-01-15 08:00:00",
"book_comment": "Scheduled maintenance",
"work_types": [
16
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"object_id": "ABC123",
"work_date": "2025-01-15 08:00:00",
"book_comment": "Scheduled",
"done_comment": null,
"completed": 0,
"Odo": null,
"MotoHrs": null,
"rows": [],
"files": [],
"log": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update tech card work
requires authentication
Completes or updates a tech card work record with logging, odometer/motor hours, and row corrections.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/techcardwork/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"work_date\": \"2025-01-15 08:00:00\",
\"book_comment\": \"Updated schedule\",
\"done_comment\": \"Oil changed successfully\",
\"MotoHrs\": 2500,
\"Odo\": 150000
}"
const url = new URL(
"https://testapi.metrotec.ee/api/techcardwork/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"work_date": "2025-01-15 08:00:00",
"book_comment": "Updated schedule",
"done_comment": "Oil changed successfully",
"MotoHrs": 2500,
"Odo": 150000
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/techcardwork/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'work_date' => '2025-01-15 08:00:00',
'book_comment' => 'Updated schedule',
'done_comment' => 'Oil changed successfully',
'MotoHrs' => 2500,
'Odo' => 150000,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/techcardwork/1'
payload = {
"work_date": "2025-01-15 08:00:00",
"book_comment": "Updated schedule",
"done_comment": "Oil changed successfully",
"MotoHrs": 2500,
"Odo": 150000
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"work_date": "2025-01-15 08:00:00",
"book_comment": "Scheduled",
"done_comment": "Done",
"completed": 1,
"Odo": 151000,
"MotoHrs": null,
"rows": [],
"files": [],
"log": []
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Booking
Manage tech card work booking updates and cancellations.
Update tech card booking
requires authentication
Updates booking fields (work_date, book_comment) with change logging and row diff tracking.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/techcardbooking/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"work_date\": \"2025-01-15 08:00:00\",
\"book_comment\": \"Rescheduled maintenance\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/techcardbooking/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"work_date": "2025-01-15 08:00:00",
"book_comment": "Rescheduled maintenance"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/techcardbooking/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'work_date' => '2025-01-15 08:00:00',
'book_comment' => 'Rescheduled maintenance',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/techcardbooking/1'
payload = {
"work_date": "2025-01-15 08:00:00",
"book_comment": "Rescheduled maintenance"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"work_date": "2025-01-15 08:00:00",
"book_comment": "Rescheduled",
"done_comment": null,
"completed": 0,
"Odo": null,
"MotoHrs": null,
"rows": [],
"files": [],
"log": []
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Cancel tech card booking
requires authentication
Cancels a booking by setting completed to 2. If the work was already completed, also cancels rows and clears odometer/motor hours.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/techcardbooking/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/techcardbooking/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/techcardbooking/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/techcardbooking/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"work_date": "2025-01-15 08:00:00",
"book_comment": "Scheduled",
"done_comment": null,
"completed": 2,
"Odo": null,
"MotoHrs": null,
"rows": [],
"files": [],
"log": []
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Maintenance Init
Initialize maintenance records for vehicles.
Initialize maintenance
requires authentication
Creates an initial maintenance work record for a vehicle with calculated next planned dates, kilometers, and motor hours.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/maintenanceinit" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"work_date\": \"2025-01-15 08:00:00\",
\"OdoMoto\": 150000,
\"next_mh_diff\": 500
}"
const url = new URL(
"https://testapi.metrotec.ee/api/maintenanceinit"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"work_date": "2025-01-15 08:00:00",
"OdoMoto": 150000,
"next_mh_diff": 500
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/maintenanceinit';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'work_date' => '2025-01-15 08:00:00',
'OdoMoto' => 150000,
'next_mh_diff' => 500,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/maintenanceinit'
payload = {
"object_id": "ABC123",
"work_date": "2025-01-15 08:00:00",
"OdoMoto": 150000,
"next_mh_diff": 500
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"object_id": "ABC123",
"work_date": "2025-01-15 08:00:00",
"book_comment": "Initial",
"done_comment": "Initial",
"completed": 1,
"Odo": 150000,
"MotoHrs": null,
"rows": [],
"files": null,
"log": []
}
Example response (400, Already initialized):
{
"message": "Already_initialized"
}
Example response (403, No access):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Odo/Moto By Date
Get odometer or motor hours value for a vehicle at a specific date.
Get odo/moto by date
requires authentication
Returns the odometer or motor hours value for a vehicle at the given work date, based on vehicle settings.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/odomotobydate/ABC123?work_date=2025-01-15+08%3A00%3A00" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/odomotobydate/ABC123"
);
const params = {
"work_date": "2025-01-15 08:00:00",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/odomotobydate/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'work_date' => '2025-01-15 08:00:00',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/odomotobydate/ABC123'
params = {
'work_date': '2025-01-15 08:00:00',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Odometer):
{
"key": "Odo",
"value": 150000
}
Example response (200, Motor hours):
{
"key": "MotoHrs",
"value": 2500
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Fuel Types
List available CO2/fuel types.
List fuel types
requires authentication
Returns all available CO2/fuel types.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/fueltypes" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/fueltypes"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/fueltypes';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/fueltypes'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"name": "Diesel",
"unit": "l",
"co2_quantity_per_unit_in_grams": 2640,
"refId": 1
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Work Types
List available tech card work types.
List work types
requires authentication
Returns all available tech card work types.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/worktypes" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/worktypes"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/worktypes';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/worktypes'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"name": "Maintenance",
"hasNext": 1
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Departments
List distinct tech card departments.
List departments
requires authentication
Returns all distinct department names from tech card records.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/departments" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/departments"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/departments';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/departments'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"department": "Fleet A"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Users
*
- APIs for managing users
Get an authenticated user
Returns the authenticated user's identifier and access level.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/username" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/username"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/username';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/username'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"oid": "john_doe",
"access": 2
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Owner Accounts
Manage owner account records with files and logos.
List owner accounts
requires authentication
Returns paginated list of owner accounts.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/user?offset=0&limit=30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/user"
);
const params = {
"offset": "0",
"limit": "30",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/user';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'offset' => '0',
'limit' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/user'
params = {
'offset': '0',
'limit': '30',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": "owner1",
"name": "Company A",
"access": 1,
"tehnEmail": "tech@example.com",
"modul": "110",
"defLang": "en",
"email": "info@example.com",
"phone_nr": "+37255512345",
"contact_name": "John"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get owner account
requires authentication
Returns a single owner account with modules, files, logos, and decoded route task address.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/user/owner1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/user/owner1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/user/owner1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/user/owner1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": "owner1",
"oid": "owner1",
"name": "Company A",
"access": 1,
"modul": [
1,
2,
3
],
"files": [],
"logos": [],
"route_task_address": null
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update owner account
requires authentication
Updates owner account settings and preferences.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/user/owner1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"defLang\": \"en\",
\"geoQtyAlert\": true,
\"poiColorNr\": 1,
\"showPoi\": true,
\"logistic_emails\": \"logistics@example.com\",
\"is_objects_clustered\": false,
\"address\": \"123 Main St\",
\"address1\": \"architecto\",
\"address2\": \"architecto\",
\"address3\": \"architecto\",
\"county\": \"architecto\",
\"postal_code\": \"architecto\",
\"kmkr\": \"architecto\",
\"regNr\": \"architecto\",
\"tehnEmail\": \"tech@example.com\",
\"phone_nr\": \"+37255512345\",
\"website\": \"architecto\",
\"company_bank_account\": \"architecto\",
\"route_task_address\": {
\"city\": \"Tallinn\",
\"street\": \"Main St 1\"
},
\"route_task_comment\": \"Default pickup point\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/user/owner1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"defLang": "en",
"geoQtyAlert": true,
"poiColorNr": 1,
"showPoi": true,
"logistic_emails": "logistics@example.com",
"is_objects_clustered": false,
"address": "123 Main St",
"address1": "architecto",
"address2": "architecto",
"address3": "architecto",
"county": "architecto",
"postal_code": "architecto",
"kmkr": "architecto",
"regNr": "architecto",
"tehnEmail": "tech@example.com",
"phone_nr": "+37255512345",
"website": "architecto",
"company_bank_account": "architecto",
"route_task_address": {
"city": "Tallinn",
"street": "Main St 1"
},
"route_task_comment": "Default pickup point"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/user/owner1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'defLang' => 'en',
'geoQtyAlert' => true,
'poiColorNr' => 1,
'showPoi' => true,
'logistic_emails' => 'logistics@example.com',
'is_objects_clustered' => false,
'address' => '123 Main St',
'address1' => 'architecto',
'address2' => 'architecto',
'address3' => 'architecto',
'county' => 'architecto',
'postal_code' => 'architecto',
'kmkr' => 'architecto',
'regNr' => 'architecto',
'tehnEmail' => 'tech@example.com',
'phone_nr' => '+37255512345',
'website' => 'architecto',
'company_bank_account' => 'architecto',
'route_task_address' => [
'city' => 'Tallinn',
'street' => 'Main St 1',
],
'route_task_comment' => 'Default pickup point',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/user/owner1'
payload = {
"defLang": "en",
"geoQtyAlert": true,
"poiColorNr": 1,
"showPoi": true,
"logistic_emails": "logistics@example.com",
"is_objects_clustered": false,
"address": "123 Main St",
"address1": "architecto",
"address2": "architecto",
"address3": "architecto",
"county": "architecto",
"postal_code": "architecto",
"kmkr": "architecto",
"regNr": "architecto",
"tehnEmail": "tech@example.com",
"phone_nr": "+37255512345",
"website": "architecto",
"company_bank_account": "architecto",
"route_task_address": {
"city": "Tallinn",
"street": "Main St 1"
},
"route_task_comment": "Default pickup point"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": "owner1",
"oid": "owner1",
"name": "Company A",
"defLang": "en"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Profile
View and update the current user's profile.
Get a user profile
requires authentication
Returns the authenticated user's profile with modules and files.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/userprofile" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/userprofile"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/userprofile';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/userprofile'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": "user1",
"tehnEmail": "tech@example.com",
"access": 1,
"modul": [
1,
2,
3
],
"files": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update user profile
requires authentication
Updates the authenticated user's technical email address.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/userprofile/user1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tehnEmail\": \"tech@example.com\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/userprofile/user1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"tehnEmail": "tech@example.com"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/userprofile/user1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'tehnEmail' => 'tech@example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/userprofile/user1'
payload = {
"tehnEmail": "tech@example.com"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": "user1",
"tehnEmail": "newemail@example.com",
"access": 1,
"modul": [
1,
2,
3
],
"files": []
}
Example response (404, Not own profile):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Sub-users
Manage sub-user accounts for the current owner.
List sub-users
requires authentication
Returns all sub-user accounts for the current owner.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/subuser" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/subuser"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/subuser';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/subuser'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": "subuser1",
"name": "John Doe",
"access": 3,
"tehnEmail": "john@example.com",
"modul": "1010",
"defLang": "en",
"email": "john@example.com",
"tehnKontakt": "John +37255512345",
"memo": null,
"allobj": "1",
"object_id": null,
"refId": null
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get sub-user
requires authentication
Returns a single sub-user record by ID with decoded modules, object IDs, and attached files.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/subuser/subuser1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/subuser/subuser1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/subuser/subuser1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/subuser/subuser1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": "subuser1",
"oid": "subuser1",
"name": "John Doe",
"access": 3,
"tehnEmail": "john@example.com",
"modul": [
1,
2
],
"defLang": "en",
"email": "john@example.com",
"tehnKontakt": "John +37255512345",
"memo": null,
"allobj": "1",
"object_id": [
"ABC123"
],
"refId": null,
"showPoi": "1",
"geoQtyAlert": "0",
"password": "",
"poiColorNr": 1,
"fish_document_number": null,
"poiAccess": "1",
"sendHashByMail": null,
"is_objects_clustered": null,
"key_id": null,
"company_name": null,
"company_nr": null,
"legal_address": null,
"company_vat_no": null,
"one_device_login": "0",
"files": []
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create sub-user
requires authentication
Creates a new sub-user account with optional driver linking and password generation.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/subuser" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"access\": 3,
\"allobj\": false,
\"defLang\": \"architecto\",
\"geoQtyAlert\": true,
\"memo\": \"architecto\",
\"oid\": \"subuser1\",
\"modul\": [
16
],
\"name\": \"John Doe\",
\"object_id\": [
\"architecto\"
],
\"password\": \"secret123\",
\"poiAccess\": true,
\"one_device_login\": false,
\"poiColorNr\": 16,
\"showPoi\": false,
\"tehnEmail\": \"john@example.com\",
\"key_id\": 16,
\"is_objects_clustered\": true,
\"company_name\": \"architecto\",
\"company_nr\": \"architecto\",
\"legal_address\": \"architecto\",
\"company_vat_no\": \"architecto\",
\"fish_document_number\": 16
}"
const url = new URL(
"https://testapi.metrotec.ee/api/subuser"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"access": 3,
"allobj": false,
"defLang": "architecto",
"geoQtyAlert": true,
"memo": "architecto",
"oid": "subuser1",
"modul": [
16
],
"name": "John Doe",
"object_id": [
"architecto"
],
"password": "secret123",
"poiAccess": true,
"one_device_login": false,
"poiColorNr": 16,
"showPoi": false,
"tehnEmail": "john@example.com",
"key_id": 16,
"is_objects_clustered": true,
"company_name": "architecto",
"company_nr": "architecto",
"legal_address": "architecto",
"company_vat_no": "architecto",
"fish_document_number": 16
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/subuser';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'access' => 3,
'allobj' => false,
'defLang' => 'architecto',
'geoQtyAlert' => true,
'memo' => 'architecto',
'oid' => 'subuser1',
'modul' => [
16,
],
'name' => 'John Doe',
'object_id' => [
'architecto',
],
'password' => 'secret123',
'poiAccess' => true,
'one_device_login' => false,
'poiColorNr' => 16,
'showPoi' => false,
'tehnEmail' => 'john@example.com',
'key_id' => 16,
'is_objects_clustered' => true,
'company_name' => 'architecto',
'company_nr' => 'architecto',
'legal_address' => 'architecto',
'company_vat_no' => 'architecto',
'fish_document_number' => 16,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/subuser'
payload = {
"access": 3,
"allobj": false,
"defLang": "architecto",
"geoQtyAlert": true,
"memo": "architecto",
"oid": "subuser1",
"modul": [
16
],
"name": "John Doe",
"object_id": [
"architecto"
],
"password": "secret123",
"poiAccess": true,
"one_device_login": false,
"poiColorNr": 16,
"showPoi": false,
"tehnEmail": "john@example.com",
"key_id": 16,
"is_objects_clustered": true,
"company_name": "architecto",
"company_nr": "architecto",
"legal_address": "architecto",
"company_vat_no": "architecto",
"fish_document_number": 16
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": "subuser1"
}
Example response (400, Duplicate ID):
{
"message": "Not_Unique_User_Id"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update sub-user
requires authentication
Updates a sub-user account. Handles driver-to-non-driver transitions, key synchronization, and password changes.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/subuser/subuser1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"access\": 3,
\"allobj\": false,
\"defLang\": \"architecto\",
\"geoQtyAlert\": true,
\"memo\": \"architecto\",
\"modul\": [
16
],
\"name\": \"John Doe\",
\"object_id\": [
\"architecto\"
],
\"password\": \"newpass123\",
\"poiAccess\": true,
\"one_device_login\": true,
\"poiColorNr\": 16,
\"showPoi\": false,
\"tehnEmail\": \"john@example.com\",
\"key_id\": 16,
\"is_objects_clustered\": false,
\"company_name\": \"architecto\",
\"company_nr\": \"architecto\",
\"legal_address\": \"architecto\",
\"company_vat_no\": \"architecto\",
\"fish_document_number\": 16
}"
const url = new URL(
"https://testapi.metrotec.ee/api/subuser/subuser1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"access": 3,
"allobj": false,
"defLang": "architecto",
"geoQtyAlert": true,
"memo": "architecto",
"modul": [
16
],
"name": "John Doe",
"object_id": [
"architecto"
],
"password": "newpass123",
"poiAccess": true,
"one_device_login": true,
"poiColorNr": 16,
"showPoi": false,
"tehnEmail": "john@example.com",
"key_id": 16,
"is_objects_clustered": false,
"company_name": "architecto",
"company_nr": "architecto",
"legal_address": "architecto",
"company_vat_no": "architecto",
"fish_document_number": 16
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/subuser/subuser1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'access' => 3,
'allobj' => false,
'defLang' => 'architecto',
'geoQtyAlert' => true,
'memo' => 'architecto',
'modul' => [
16,
],
'name' => 'John Doe',
'object_id' => [
'architecto',
],
'password' => 'newpass123',
'poiAccess' => true,
'one_device_login' => true,
'poiColorNr' => 16,
'showPoi' => false,
'tehnEmail' => 'john@example.com',
'key_id' => 16,
'is_objects_clustered' => false,
'company_name' => 'architecto',
'company_nr' => 'architecto',
'legal_address' => 'architecto',
'company_vat_no' => 'architecto',
'fish_document_number' => 16,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/subuser/subuser1'
payload = {
"access": 3,
"allobj": false,
"defLang": "architecto",
"geoQtyAlert": true,
"memo": "architecto",
"modul": [
16
],
"name": "John Doe",
"object_id": [
"architecto"
],
"password": "newpass123",
"poiAccess": true,
"one_device_login": true,
"poiColorNr": 16,
"showPoi": false,
"tehnEmail": "john@example.com",
"key_id": 16,
"is_objects_clustered": false,
"company_name": "architecto",
"company_nr": "architecto",
"legal_address": "architecto",
"company_vat_no": "architecto",
"fish_document_number": 16
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"message": "Updated"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete sub-user
requires authentication
Deletes a sub-user account. If the user is a driver, archives the associated driver record.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/subuser/subuser1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/subuser/subuser1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/subuser/subuser1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/subuser/subuser1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Admin Owner Accounts
Admin-only management of owner accounts with DDD integration and Merit sync.
List owner accounts (admin)
requires authentication
Returns a paginated list of owner accounts with optional filtering. Admin access is required.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/auser?offset=0&seclev=500&oid=company1&name=John&access=2" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"offset\": 0,
\"seclev\": 500,
\"oid\": \"company1\",
\"name\": \"architecto\",
\"access\": 16
}"
const url = new URL(
"https://testapi.metrotec.ee/api/auser"
);
const params = {
"offset": "0",
"seclev": "500",
"oid": "company1",
"name": "John",
"access": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"offset": 0,
"seclev": 500,
"oid": "company1",
"name": "architecto",
"access": 16
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/auser';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'offset' => '0',
'seclev' => '500',
'oid' => 'company1',
'name' => 'John',
'access' => '2',
],
'json' => [
'offset' => 0,
'seclev' => 500,
'oid' => 'company1',
'name' => 'architecto',
'access' => 16,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/auser'
payload = {
"offset": 0,
"seclev": 500,
"oid": "company1",
"name": "architecto",
"access": 16
}
params = {
'offset': '0',
'seclev': '500',
'oid': 'company1',
'name': 'John',
'access': '2',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (200, Success):
[
{
"id": "owner1",
"name": "Company A",
"access": 2,
"tehnEmail": "tech@example.com",
"modul": [
1,
2
],
"defLang": "en"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get owner account (admin)
requires authentication
Returns a single owner account with modules, files, logos, and decoded route task address. Admin access is required.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/auser/owner1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/auser/owner1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/auser/owner1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/auser/owner1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": "owner1",
"oid": "owner1",
"name": "Company A",
"access": 2,
"modul": [
1,
2,
3
],
"files": [],
"logos": [],
"route_task_address": null
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create an owner account (admin)
requires authentication
Creates a new owner account with DDD integration, sends a welcome email, and syncs with Merit. Admin access is required.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/auser" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"Price1\": 4326.41688,
\"Price2\": 4326.41688,
\"Price3\": 4326.41688,
\"Price4\": 4326.41688,
\"Price5\": 4326.41688,
\"Price6\": 4326.41688,
\"Support_id\": \"architecto\",
\"access\": 2,
\"address\": \"architecto\",
\"address1\": \"architecto\",
\"address2\": \"architecto\",
\"address3\": \"architecto\",
\"county\": \"architecto\",
\"postal_code\": \"architecto\",
\"credit\": 16,
\"defLang\": \"architecto\",
\"email\": \"zbailey@example.net\",
\"geoQtyAlert\": true,
\"kmkr\": \"architecto\",
\"lang\": \"architecto\",
\"manager\": \"architecto\",
\"memo\": \"architecto\",
\"oid\": \"company1\",
\"modul\": [
16
],
\"name\": \"architecto\",
\"password\": \"]|{+-0pBNvYg\",
\"refreshInterval\": 16,
\"poiAccess\": false,
\"poiColorNr\": 16,
\"regNr\": \"architecto\",
\"seclev\": 500,
\"showPoi\": false,
\"tehnEmail\": \"zbailey@example.net\",
\"contact_name\": \"architecto\",
\"phone_nr\": \"architecto\",
\"timeZone\": \"Asia\\/Yekaterinburg\",
\"ddd_id\": 16,
\"ATR\": \"architecto\",
\"CardCode\": \"architecto\",
\"ExpiryDate\": \"2026-02-26\",
\"routeTaskProfileId\": 16,
\"dateFormat\": \"DD.YYYY\\/DD\",
\"gdpr\": true,
\"payment_deadline\": 16,
\"per_len\": 16,
\"e_invoice\": true,
\"is_objects_clustered\": true,
\"inv_ref_nr\": 16,
\"country_code\": \"architecto\",
\"default_tilelayer\": 16,
\"logistic_emails\": \"architecto\",
\"website\": \"architecto\",
\"company_bank_account\": \"architecto\",
\"route_task_comment\": \"architecto\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/auser"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"Price1": 4326.41688,
"Price2": 4326.41688,
"Price3": 4326.41688,
"Price4": 4326.41688,
"Price5": 4326.41688,
"Price6": 4326.41688,
"Support_id": "architecto",
"access": 2,
"address": "architecto",
"address1": "architecto",
"address2": "architecto",
"address3": "architecto",
"county": "architecto",
"postal_code": "architecto",
"credit": 16,
"defLang": "architecto",
"email": "zbailey@example.net",
"geoQtyAlert": true,
"kmkr": "architecto",
"lang": "architecto",
"manager": "architecto",
"memo": "architecto",
"oid": "company1",
"modul": [
16
],
"name": "architecto",
"password": "]|{+-0pBNvYg",
"refreshInterval": 16,
"poiAccess": false,
"poiColorNr": 16,
"regNr": "architecto",
"seclev": 500,
"showPoi": false,
"tehnEmail": "zbailey@example.net",
"contact_name": "architecto",
"phone_nr": "architecto",
"timeZone": "Asia\/Yekaterinburg",
"ddd_id": 16,
"ATR": "architecto",
"CardCode": "architecto",
"ExpiryDate": "2026-02-26",
"routeTaskProfileId": 16,
"dateFormat": "DD.YYYY\/DD",
"gdpr": true,
"payment_deadline": 16,
"per_len": 16,
"e_invoice": true,
"is_objects_clustered": true,
"inv_ref_nr": 16,
"country_code": "architecto",
"default_tilelayer": 16,
"logistic_emails": "architecto",
"website": "architecto",
"company_bank_account": "architecto",
"route_task_comment": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/auser';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'Price1' => 4326.41688,
'Price2' => 4326.41688,
'Price3' => 4326.41688,
'Price4' => 4326.41688,
'Price5' => 4326.41688,
'Price6' => 4326.41688,
'Support_id' => 'architecto',
'access' => 2,
'address' => 'architecto',
'address1' => 'architecto',
'address2' => 'architecto',
'address3' => 'architecto',
'county' => 'architecto',
'postal_code' => 'architecto',
'credit' => 16,
'defLang' => 'architecto',
'email' => 'zbailey@example.net',
'geoQtyAlert' => true,
'kmkr' => 'architecto',
'lang' => 'architecto',
'manager' => 'architecto',
'memo' => 'architecto',
'oid' => 'company1',
'modul' => [
16,
],
'name' => 'architecto',
'password' => ']|{+-0pBNvYg',
'refreshInterval' => 16,
'poiAccess' => false,
'poiColorNr' => 16,
'regNr' => 'architecto',
'seclev' => 500,
'showPoi' => false,
'tehnEmail' => 'zbailey@example.net',
'contact_name' => 'architecto',
'phone_nr' => 'architecto',
'timeZone' => 'Asia/Yekaterinburg',
'ddd_id' => 16,
'ATR' => 'architecto',
'CardCode' => 'architecto',
'ExpiryDate' => '2026-02-26',
'routeTaskProfileId' => 16,
'dateFormat' => 'DD.YYYY/DD',
'gdpr' => true,
'payment_deadline' => 16,
'per_len' => 16,
'e_invoice' => true,
'is_objects_clustered' => true,
'inv_ref_nr' => 16,
'country_code' => 'architecto',
'default_tilelayer' => 16,
'logistic_emails' => 'architecto',
'website' => 'architecto',
'company_bank_account' => 'architecto',
'route_task_comment' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/auser'
payload = {
"Price1": 4326.41688,
"Price2": 4326.41688,
"Price3": 4326.41688,
"Price4": 4326.41688,
"Price5": 4326.41688,
"Price6": 4326.41688,
"Support_id": "architecto",
"access": 2,
"address": "architecto",
"address1": "architecto",
"address2": "architecto",
"address3": "architecto",
"county": "architecto",
"postal_code": "architecto",
"credit": 16,
"defLang": "architecto",
"email": "zbailey@example.net",
"geoQtyAlert": true,
"kmkr": "architecto",
"lang": "architecto",
"manager": "architecto",
"memo": "architecto",
"oid": "company1",
"modul": [
16
],
"name": "architecto",
"password": "]|{+-0pBNvYg",
"refreshInterval": 16,
"poiAccess": false,
"poiColorNr": 16,
"regNr": "architecto",
"seclev": 500,
"showPoi": false,
"tehnEmail": "zbailey@example.net",
"contact_name": "architecto",
"phone_nr": "architecto",
"timeZone": "Asia\/Yekaterinburg",
"ddd_id": 16,
"ATR": "architecto",
"CardCode": "architecto",
"ExpiryDate": "2026-02-26",
"routeTaskProfileId": 16,
"dateFormat": "DD.YYYY\/DD",
"gdpr": true,
"payment_deadline": 16,
"per_len": 16,
"e_invoice": true,
"is_objects_clustered": true,
"inv_ref_nr": 16,
"country_code": "architecto",
"default_tilelayer": 16,
"logistic_emails": "architecto",
"website": "architecto",
"company_bank_account": "architecto",
"route_task_comment": "architecto"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": "newowner1",
"oid": "newowner1",
"name": "New Company"
}
Example response (400, Duplicate ID):
{
"message": "Not_Unique_User_Id"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update owner account (admin)
requires authentication
Updates an owner account. Cascades shared settings to sub-accounts. Admin access is required.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/auser/owner1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"Price1\": 4326.41688,
\"Price2\": 4326.41688,
\"Price3\": 4326.41688,
\"Price4\": 4326.41688,
\"Price5\": 4326.41688,
\"Price6\": 4326.41688,
\"Support_id\": \"architecto\",
\"access\": 2,
\"address\": \"architecto\",
\"address1\": \"architecto\",
\"address2\": \"architecto\",
\"address3\": \"architecto\",
\"county\": \"architecto\",
\"postal_code\": \"architecto\",
\"credit\": 16,
\"defLang\": \"architecto\",
\"email\": \"zbailey@example.net\",
\"geoQtyAlert\": false,
\"kmkr\": \"architecto\",
\"lang\": \"architecto\",
\"manager\": \"architecto\",
\"memo\": \"architecto\",
\"modul\": [
16
],
\"name\": \"architecto\",
\"password\": \"]|{+-0pBNvYg\",
\"refreshInterval\": 16,
\"poiAccess\": false,
\"poiColorNr\": 16,
\"regNr\": \"architecto\",
\"seclev\": 500,
\"showPoi\": true,
\"tehnEmail\": \"zbailey@example.net\",
\"contact_name\": \"architecto\",
\"phone_nr\": \"architecto\",
\"timeZone\": \"Asia\\/Yekaterinburg\",
\"ddd_id\": 16,
\"ATR\": \"architecto\",
\"CardCode\": \"architecto\",
\"ExpiryDate\": \"2026-02-26\",
\"routeTaskProfileId\": 16,
\"dateFormat\": \"DD.YYYY\\/DD\",
\"gdpr\": true,
\"payment_deadline\": 16,
\"per_len\": 16,
\"e_invoice\": true,
\"is_objects_clustered\": true,
\"inv_ref_nr\": 16,
\"country_code\": \"architecto\",
\"default_tilelayer\": 16,
\"logistic_emails\": \"architecto\",
\"website\": \"architecto\",
\"company_bank_account\": \"architecto\",
\"poi_profile_id\": 0,
\"route_task_comment\": \"architecto\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/auser/owner1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"Price1": 4326.41688,
"Price2": 4326.41688,
"Price3": 4326.41688,
"Price4": 4326.41688,
"Price5": 4326.41688,
"Price6": 4326.41688,
"Support_id": "architecto",
"access": 2,
"address": "architecto",
"address1": "architecto",
"address2": "architecto",
"address3": "architecto",
"county": "architecto",
"postal_code": "architecto",
"credit": 16,
"defLang": "architecto",
"email": "zbailey@example.net",
"geoQtyAlert": false,
"kmkr": "architecto",
"lang": "architecto",
"manager": "architecto",
"memo": "architecto",
"modul": [
16
],
"name": "architecto",
"password": "]|{+-0pBNvYg",
"refreshInterval": 16,
"poiAccess": false,
"poiColorNr": 16,
"regNr": "architecto",
"seclev": 500,
"showPoi": true,
"tehnEmail": "zbailey@example.net",
"contact_name": "architecto",
"phone_nr": "architecto",
"timeZone": "Asia\/Yekaterinburg",
"ddd_id": 16,
"ATR": "architecto",
"CardCode": "architecto",
"ExpiryDate": "2026-02-26",
"routeTaskProfileId": 16,
"dateFormat": "DD.YYYY\/DD",
"gdpr": true,
"payment_deadline": 16,
"per_len": 16,
"e_invoice": true,
"is_objects_clustered": true,
"inv_ref_nr": 16,
"country_code": "architecto",
"default_tilelayer": 16,
"logistic_emails": "architecto",
"website": "architecto",
"company_bank_account": "architecto",
"poi_profile_id": 0,
"route_task_comment": "architecto"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/auser/owner1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'Price1' => 4326.41688,
'Price2' => 4326.41688,
'Price3' => 4326.41688,
'Price4' => 4326.41688,
'Price5' => 4326.41688,
'Price6' => 4326.41688,
'Support_id' => 'architecto',
'access' => 2,
'address' => 'architecto',
'address1' => 'architecto',
'address2' => 'architecto',
'address3' => 'architecto',
'county' => 'architecto',
'postal_code' => 'architecto',
'credit' => 16,
'defLang' => 'architecto',
'email' => 'zbailey@example.net',
'geoQtyAlert' => false,
'kmkr' => 'architecto',
'lang' => 'architecto',
'manager' => 'architecto',
'memo' => 'architecto',
'modul' => [
16,
],
'name' => 'architecto',
'password' => ']|{+-0pBNvYg',
'refreshInterval' => 16,
'poiAccess' => false,
'poiColorNr' => 16,
'regNr' => 'architecto',
'seclev' => 500,
'showPoi' => true,
'tehnEmail' => 'zbailey@example.net',
'contact_name' => 'architecto',
'phone_nr' => 'architecto',
'timeZone' => 'Asia/Yekaterinburg',
'ddd_id' => 16,
'ATR' => 'architecto',
'CardCode' => 'architecto',
'ExpiryDate' => '2026-02-26',
'routeTaskProfileId' => 16,
'dateFormat' => 'DD.YYYY/DD',
'gdpr' => true,
'payment_deadline' => 16,
'per_len' => 16,
'e_invoice' => true,
'is_objects_clustered' => true,
'inv_ref_nr' => 16,
'country_code' => 'architecto',
'default_tilelayer' => 16,
'logistic_emails' => 'architecto',
'website' => 'architecto',
'company_bank_account' => 'architecto',
'poi_profile_id' => 0,
'route_task_comment' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/auser/owner1'
payload = {
"Price1": 4326.41688,
"Price2": 4326.41688,
"Price3": 4326.41688,
"Price4": 4326.41688,
"Price5": 4326.41688,
"Price6": 4326.41688,
"Support_id": "architecto",
"access": 2,
"address": "architecto",
"address1": "architecto",
"address2": "architecto",
"address3": "architecto",
"county": "architecto",
"postal_code": "architecto",
"credit": 16,
"defLang": "architecto",
"email": "zbailey@example.net",
"geoQtyAlert": false,
"kmkr": "architecto",
"lang": "architecto",
"manager": "architecto",
"memo": "architecto",
"modul": [
16
],
"name": "architecto",
"password": "]|{+-0pBNvYg",
"refreshInterval": 16,
"poiAccess": false,
"poiColorNr": 16,
"regNr": "architecto",
"seclev": 500,
"showPoi": true,
"tehnEmail": "zbailey@example.net",
"contact_name": "architecto",
"phone_nr": "architecto",
"timeZone": "Asia\/Yekaterinburg",
"ddd_id": 16,
"ATR": "architecto",
"CardCode": "architecto",
"ExpiryDate": "2026-02-26",
"routeTaskProfileId": 16,
"dateFormat": "DD.YYYY\/DD",
"gdpr": true,
"payment_deadline": 16,
"per_len": 16,
"e_invoice": true,
"is_objects_clustered": true,
"inv_ref_nr": 16,
"country_code": "architecto",
"default_tilelayer": 16,
"logistic_emails": "architecto",
"website": "architecto",
"company_bank_account": "architecto",
"poi_profile_id": 0,
"route_task_comment": "architecto"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": "owner1",
"oid": "owner1",
"name": "Company A"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Auth logs
User authentication logs
Get authentication logs report
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/auth-logs?datetime[]=2025-01-01&datetime[]=2025-12-31&filter[oid]=metrotec&filter[user_agent]=Mozilla%2F5.0&filter[ip_address]=192.168.1.1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/auth-logs"
);
const params = {
"datetime[0]": "2025-01-01",
"datetime[1]": "2025-12-31",
"filter[oid]": "metrotec",
"filter[user_agent]": "Mozilla/5.0",
"filter[ip_address]": "192.168.1.1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/auth-logs';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => '2025-01-01',
'datetime[1]' => '2025-12-31',
'filter[oid]' => 'metrotec',
'filter[user_agent]' => 'Mozilla/5.0',
'filter[ip_address]' => '192.168.1.1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/auth-logs'
params = {
'datetime[0]': '2025-01-01',
'datetime[1]': '2025-12-31',
'filter[oid]': 'metrotec',
'filter[user_agent]': 'Mozilla/5.0',
'filter[ip_address]': '192.168.1.1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"id": 1,
"authenticatable_type": "App\\Models\\User",
"authenticatable_id": 123,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0",
"login_at": "2025-11-28T10:00:00.000000Z",
"login_successful": true,
"logout_at": null,
"cleared_by_user": false,
"location": {
"city": "Tallinn",
"country": "Estonia"
}
}
],
"per_page": 15,
"current_page": 1,
"next_page_url": null,
"prev_page_url": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get User authentication logs
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/metrotec/auth-logs" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/metrotec/auth-logs"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/metrotec/auth-logs';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/metrotec/auth-logs'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"data": [
{
"id": 1,
"authenticatable_type": "App\\Models\\User",
"authenticatable_id": 123,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0",
"login_at": "2025-11-28T10:00:00.000000Z",
"login_successful": true,
"logout_at": null,
"cleared_by_user": false,
"location": {
"city": "Tallinn",
"country": "Estonia"
}
}
],
"per_page": 30,
"current_page": 1,
"next_page_url": null,
"prev_page_url": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User sessions
User session management
Get User's current active sessions
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/tokens" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/tokens"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/tokens';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/tokens'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
[
{
"id": 1,
"oid": "metrotec",
"name": "web",
"platform": "iOS",
"ip": "192.168.1.1",
"location": {
"country": "EE",
"city": "Tallinn"
},
"last_used_at": "2025-11-28T10:00:00.000000Z",
"created_at": "2025-11-28T08:00:00.000000Z",
"expires_at": "2025-12-28T10:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get sessions for all users owned by current user
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/architecto/tokens" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/architecto/tokens"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/architecto/tokens';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/architecto/tokens'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
[
{
"id": 1,
"oid": "metrotec",
"name": "API token",
"created_at": "2025-01-01T00:00:00.000000Z",
"expires_at": null,
"updated_at": "2025-11-28T10:00:00.000000Z"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete the specific token
requires authentication
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/metrotec/tokens/88" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/metrotec/tokens/88"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/metrotec/tokens/88';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/metrotec/tokens/88'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, success):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
API tokens
API tokens management
Get API tokens for all users owned by current user
requires authentication
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/api-tokens" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/api-tokens"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/api-tokens';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/api-tokens'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
[
{
"id": 1,
"oid": "metrotec",
"name": "API token",
"created_at": "2025-01-01T00:00:00.000000Z",
"expires_at": null,
"updated_at": "2025-11-28T10:00:00.000000Z"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create an API token for given user
requires authentication
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/api-tokens" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"oid\": \"metrotec\",
\"token_name\": \"API token\",
\"expires_at\": \"2026-12-31\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/api-tokens"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"oid": "metrotec",
"token_name": "API token",
"expires_at": "2026-12-31"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/api-tokens';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'oid' => 'metrotec',
'token_name' => 'API token',
'expires_at' => '2026-12-31',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/api-tokens'
payload = {
"oid": "metrotec",
"token_name": "API token",
"expires_at": "2026-12-31"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201):
{
"id": 1,
"tokenable_type": "App\\Models\\User",
"tokenable_id": 123,
"name": "API token",
"abilities": [
"api"
],
"last_used_at": null,
"expires_at": "2026-12-31T00:00:00.000000Z",
"created_at": "2025-11-28T10:00:00.000000Z",
"updated_at": "2025-11-28T10:00:00.000000Z",
"plainTextToken": "1|abc123def456..."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete the specific API token
requires authentication
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/api-tokens/88" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/api-tokens/88"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/api-tokens/88';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/api-tokens/88'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, success):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Clients
List client subuser accounts.
List clients
requires authentication
Returns all client subuser accounts for the current owner.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/clients" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/clients"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/clients';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/clients'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": "client1",
"name": "Client A",
"access": 5,
"tehnEmail": "client@example.com",
"phone": "+37255512345",
"defLang": "en",
"email": "client@example.com",
"tehnKontakt": "John +37255512345",
"fish_document_number": null,
"company_name": "Company",
"company_nr": "12345",
"legal_address": "Main St 1",
"company_vat_no": "EE123456"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Vehicle Faults
Fault Types
Manage vehicle fault type definitions.
List all fault types
requires authentication
Returns all vehicle fault types ordered by their ordering value.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehfaultstypes" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehfaultstypes"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaultstypes';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaultstypes'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"name": "Engine",
"descriptions": [
"Oil leak",
"Overheating"
],
"description": "Engine related faults",
"ordering": 10
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show fault type
requires authentication
Returns a single vehicle fault type by its ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehfaultstypes/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehfaultstypes/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaultstypes/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaultstypes/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"name": "Engine",
"descriptions": [
"Oil leak",
"Overheating"
],
"description": "Engine related faults",
"ordering": 10
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create fault type
requires authentication
Creates a new vehicle fault type definition.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/vehfaultstypes" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Engine\",
\"descriptions\": [
\"architecto\"
],
\"description\": \"Engine related faults\",
\"ordering\": 10
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehfaultstypes"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Engine",
"descriptions": [
"architecto"
],
"description": "Engine related faults",
"ordering": 10
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaultstypes';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Engine',
'descriptions' => [
'architecto',
],
'description' => 'Engine related faults',
'ordering' => 10,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaultstypes'
payload = {
"name": "Engine",
"descriptions": [
"architecto"
],
"description": "Engine related faults",
"ordering": 10
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"name": "Engine",
"descriptions": [
"Oil leak",
"Overheating"
],
"description": "Engine related faults",
"ordering": 10
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update fault type
requires authentication
Updates an existing vehicle fault type definition.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/vehfaultstypes/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Engine\",
\"descriptions\": [
\"architecto\"
],
\"description\": \"Engine related faults\",
\"ordering\": 10
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehfaultstypes/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Engine",
"descriptions": [
"architecto"
],
"description": "Engine related faults",
"ordering": 10
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaultstypes/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Engine',
'descriptions' => [
'architecto',
],
'description' => 'Engine related faults',
'ordering' => 10,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaultstypes/1'
payload = {
"name": "Engine",
"descriptions": [
"architecto"
],
"description": "Engine related faults",
"ordering": 10
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 1,
"name": "Engine",
"descriptions": [
"Oil leak",
"Overheating"
],
"description": "Engine related faults",
"ordering": 10
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete fault type
requires authentication
Deletes a vehicle fault type. Fails if the type is still in use by any faults.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/vehfaultstypes/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehfaultstypes/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaultstypes/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaultstypes/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (400, In use):
{
"message": "Vehicle_Faults_Type_Used"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Transfer Acceptance Act
Manage transfer acceptance acts for drivers. A driver must be registered to a vehicle.
Show transfer acceptance act
requires authentication
Returns the active transfer acceptance act for the current driver. If no act exists, one is automatically created.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/transferacceptance" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/transferacceptance"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/transferacceptance';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/transferacceptance'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"owner": "OWN1",
"accepted_by": "USR1",
"accepted_at": null,
"vehicle_drivers_id": 5
}
Example response (400, Not registered):
{
"message": "Driver_Not_Registered_To_A_Vehicle"
}
Example response (403, Not a driver):
{
"message": "Not_A_Driver"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Accept transfer
requires authentication
Marks the transfer acceptance act as accepted by setting the accepted_at timestamp to the current UTC time.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/transferacceptance/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/transferacceptance/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/transferacceptance/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/transferacceptance/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"owner": "OWN1",
"accepted_by": "USR1",
"accepted_at": "2024-01-15 12:00:00",
"vehicle_drivers_id": 5
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Faults
CRUD operations for vehicle fault records. Creating a fault requires an active transfer acceptance act.
List all faults
requires authentication
Returns all open (unsolved) vehicle fault records for the current user.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehfaults" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehfaults"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaults';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaults'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"object_id": "ABC123",
"vehicle_faults_type_id": 1,
"descriptions": [
"Oil leak"
],
"registered_at": "2026-01-15 10:00:00",
"registered_by": "USR1",
"solved_at": null,
"solved_by": null,
"transfer_acceptance_act_id": 1,
"previous_driver_id": 5,
"owner": "OWN1"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show fault
requires authentication
Returns a single vehicle fault record with attached files.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehfaults/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehfaults/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaults/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaults/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"vehicle_faults_type_id": 1,
"descriptions": [
"Oil leak"
],
"registered_at": "2026-01-15 10:00:00",
"registered_by": "USR1",
"solved_at": null,
"solved_by": null,
"transfer_acceptance_act_id": 1,
"previous_driver_id": 5,
"owner": "OWN1",
"files": []
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create fault
requires authentication
Creates a new vehicle fault record. Requires an active transfer acceptance act for the current driver. Supports file uploads.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/vehfaults" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "vehicle_faults_type_id=1"\
--form "descriptions=["Oil leak", "Overheating"]"\
--form "file[]=@/tmp/phpo62tnrhhdipraPbvPmk" const url = new URL(
"https://testapi.metrotec.ee/api/vehfaults"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('vehicle_faults_type_id', '1');
body.append('descriptions', '["Oil leak", "Overheating"]');
body.append('file[]', document.querySelector('input[name="file[]"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaults';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'vehicle_faults_type_id',
'contents' => '1'
],
[
'name' => 'descriptions',
'contents' => '["Oil leak", "Overheating"]'
],
[
'name' => 'file[]',
'contents' => fopen('/tmp/phpo62tnrhhdipraPbvPmk', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaults'
files = {
'vehicle_faults_type_id': (None, '1'),
'descriptions': (None, '["Oil leak", "Overheating"]'),
'file[]': open('/tmp/phpo62tnrhhdipraPbvPmk', 'rb')}
payload = {
"vehicle_faults_type_id": 1,
"descriptions": "[\"Oil leak\", \"Overheating\"]"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'multipart/form-data',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, files=files)
response.json()Example response (201, Success):
{
"id": 1,
"object_id": "ABC123",
"vehicle_faults_type_id": 1,
"descriptions": [
"Oil leak"
],
"registered_at": "2026-01-15 10:00:00",
"registered_by": "USR1",
"solved_at": null,
"solved_by": null,
"transfer_acceptance_act_id": 1,
"previous_driver_id": 5,
"owner": "OWN1",
"files": []
}
Example response (404, No act):
{
"message": "No_Transfer_Acceptance_Act"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update fault
requires authentication
Marks a vehicle fault as solved. Supports additional file uploads.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/vehfaults/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "is_solved=1"\
--form "file[]=@/tmp/phpjunihrek8rfp6ULHOuU" const url = new URL(
"https://testapi.metrotec.ee/api/vehfaults/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('is_solved', '1');
body.append('file[]', document.querySelector('input[name="file[]"]').files[0]);
fetch(url, {
method: "PUT",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaults/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'is_solved',
'contents' => '1'
],
[
'name' => 'file[]',
'contents' => fopen('/tmp/phpjunihrek8rfp6ULHOuU', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaults/1'
files = {
'is_solved': (None, '1'),
'file[]': open('/tmp/phpjunihrek8rfp6ULHOuU', 'rb')}
payload = {
"is_solved": true
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'multipart/form-data',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, files=files)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"vehicle_faults_type_id": 1,
"descriptions": [
"Oil leak"
],
"registered_at": "2026-01-15 10:00:00",
"registered_by": "USR1",
"solved_at": "2026-01-16 08:00:00",
"solved_by": "USR1",
"transfer_acceptance_act_id": 1,
"previous_driver_id": 5,
"owner": "OWN1",
"files": []
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete fault
requires authentication
Deletes a vehicle fault record.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/vehfaults/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehfaults/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaults/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaults/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Faults Report
Aggregated vehicle faults report and per-vehicle fault details.
List faults report
requires authentication
Returns an aggregated vehicle faults report grouped by vehicle, with unsolved and solved faults.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehfaultsrep?registered_at[]=2026-01-01®istered_at[]=2026-01-31&object_id=ABC123¬_solved=true" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehfaultsrep"
);
const params = {
"registered_at[0]": "2026-01-01",
"registered_at[1]": "2026-01-31",
"object_id": "ABC123",
"not_solved": "true",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaultsrep';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'registered_at[0]' => '2026-01-01',
'registered_at[1]' => '2026-01-31',
'object_id' => 'ABC123',
'not_solved' => 'true',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaultsrep'
params = {
'registered_at[0]': '2026-01-01',
'registered_at[1]': '2026-01-31',
'object_id': 'ABC123',
'not_solved': 'true',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"object_id": "ABC123",
"faults": [
{
"id": 1,
"name": "Engine",
"descriptions": "Oil leak",
"date": "2026-01-15"
}
],
"solved": []
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show vehicle faults
requires authentication
Returns all fault records for a specific vehicle, including attached files.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehfaultsrep/ABC123?registered_at[]=2026-01-01®istered_at[]=2026-01-31&object_id=ABC123¬_solved=true" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehfaultsrep/ABC123"
);
const params = {
"registered_at[0]": "2026-01-01",
"registered_at[1]": "2026-01-31",
"object_id": "ABC123",
"not_solved": "true",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaultsrep/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'registered_at[0]' => '2026-01-01',
'registered_at[1]' => '2026-01-31',
'object_id' => 'ABC123',
'not_solved' => 'true',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaultsrep/ABC123'
params = {
'registered_at[0]': '2026-01-01',
'registered_at[1]': '2026-01-31',
'object_id': 'ABC123',
'not_solved': 'true',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": 1,
"object_id": "ABC123",
"name": "Engine",
"descriptions": [
"Oil leak"
],
"registered_at": "2026-01-15",
"registered_by": "USR1",
"solved_at": null,
"solved_by": null,
"transfer_acceptance_act_id": 1,
"driver_name": "John Doe",
"files": []
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Fault Checks
Vehicle status checks that may create fault records for failed items. Supports file uploads per fault.
List all checks
requires authentication
Returns all vehicle status check records.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehfaultchecks" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehfaultchecks"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaultchecks';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaultchecks'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"object_id": "ABC123",
"created_at": "2026-01-15 10:00:00",
"status": 0,
"data": [
{
"fault_id": 1,
"checked": true,
"comment": ""
}
],
"sender": "USR1"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show check
requires authentication
Returns a single vehicle status check with its associated faults and files.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehfaultchecks/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehfaultchecks/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaultchecks/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaultchecks/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"created_at": "2026-01-15 10:00:00",
"status": 1,
"data": [
{
"fault_id": 1,
"checked": false,
"comment": "Oil leak"
}
],
"sender": "USR1",
"faults": []
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create check
requires authentication
Creates a vehicle status check. Fault records are automatically created for unchecked items. Supports file uploads grouped by fault_id.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/vehfaultchecks" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"data\": \"[{\\\"fault_id\\\":1,\\\"checked\\\":true,\\\"comment\\\":\\\"\\\"},{\\\"fault_id\\\":2,\\\"checked\\\":false,\\\"comment\\\":\\\"Oil leak\\\"}]\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehfaultchecks"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"data": "[{\"fault_id\":1,\"checked\":true,\"comment\":\"\"},{\"fault_id\":2,\"checked\":false,\"comment\":\"Oil leak\"}]"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehfaultchecks';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'data' => '[{"fault_id":1,"checked":true,"comment":""},{"fault_id":2,"checked":false,"comment":"Oil leak"}]',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehfaultchecks'
payload = {
"object_id": "ABC123",
"data": "[{\"fault_id\":1,\"checked\":true,\"comment\":\"\"},{\"fault_id\":2,\"checked\":false,\"comment\":\"Oil leak\"}]"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"object_id": "ABC123",
"created_at": "2026-01-15 10:00:00",
"status": 1,
"data": [
{
"fault_id": 1,
"checked": false,
"comment": "Oil leak"
}
],
"sender": "USR1",
"faults": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Vehicle Status
Status
Get current vehicle status (work, repair, own_repair, reserve).
Get vehicle status
requires authentication
Returns the current status of a vehicle with related record data.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehstatus/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehstatus/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatus/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatus/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Work):
{
"driver_id": 1,
"type_id": null,
"log": null,
"status": "work",
"id": 1,
"object_id": "ABC123",
"startUse": "2025-01-15 08:00:00",
"stopUse": null,
"name": "John Doe"
}
Example response (200, Repair):
{
"driver_id": null,
"type_id": 1,
"log": [],
"status": "repair",
"id": 1,
"object_id": "ABC123",
"start": "2025-01-15 08:00:00",
"stop": null,
"name": "Engine repair"
}
Example response (200, Reserve):
{
"driver_id": null,
"type_id": null,
"log": null,
"status": "reserve",
"id": 1,
"start": "2025-01-15 12:00:00",
"prev_status": "work"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Repair Close
Close active vehicle repair status records.
Close repair status
requires authentication
Closes the active repair record for a vehicle by setting its stop time to now.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/vehstatus/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehstatus/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatus/ABC123';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatus/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers)
response.json()Example response (204, Success):
Empty response
Example response (403, Object not allowed):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Report
Vehicle status report with work, repair and own repair periods.
List vehicle status report
requires authentication
Returns all vehicles with calculated work, repair and own repair time periods.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehstatusreport?datetime[]=architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehstatusreport"
);
const params = {
"datetime[0]": "architecto",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatusreport';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatusreport'
params = {
'datetime[0]': 'architecto',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": "ABC123",
"alias": "Truck 1",
"work": 3600,
"repair": 1800,
"own_repair": 900
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get vehicle status report
requires authentication
Returns repair and work records for a single vehicle within the given period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehstatusreport/ABC123?datetime[]=architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehstatusreport/ABC123"
);
const params = {
"datetime[0]": "architecto",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatusreport/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatusreport/ABC123'
params = {
'datetime[0]': 'architecto',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"id": 1,
"object_id": "ABC123",
"start": "2025-01-15 08:00:00",
"stop": "2025-01-15 12:00:00",
"type_id": null,
"name": "John Doe",
"status": "work",
"driver_id": 1,
"startTimestamp": 1736928000,
"stopTimestamp": 1736942400
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Repair
Manage vehicle repair status records.
Get repair record
requires authentication
Returns a single vehicle repair record by ID with decoded log.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehstatusrepair/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehstatusrepair/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatusrepair/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatusrepair/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"type_id": 1,
"isOwn": 0,
"start": "2025-01-15 08:00:00",
"stop": null,
"log": [],
"oid": "owner1"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create repair record
requires authentication
Creates a new vehicle repair record. Closes any active driver vehicle registration for the vehicle first.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/vehstatusrepair" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"type_id\": 1,
\"isOwn\": false
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehstatusrepair"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"type_id": 1,
"isOwn": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatusrepair';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'type_id' => 1,
'isOwn' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatusrepair'
payload = {
"object_id": "ABC123",
"type_id": 1,
"isOwn": false
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"object_id": "ABC123",
"type_id": 1,
"isOwn": 0,
"start": "2025-01-15 08:00:00",
"stop": null,
"log": [],
"oid": "owner1"
}
Example response (400, Already in repair):
{
"message": "Vehicle_Already_In_Repair"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update (close) repair record
requires authentication
Closes an active repair record by setting its stop time to now.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/vehstatusrepair/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehstatusrepair/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatusrepair/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatusrepair/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"object_id": "ABC123",
"type_id": 1,
"isOwn": 0,
"start": "2025-01-15 08:00:00",
"stop": "2025-01-15 17:00:00",
"log": [],
"oid": "owner1"
}
Example response (400, Already closed):
{
"message": "Closed_Record"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete repair record
requires authentication
Deletes an active (unclosed) repair record.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/vehstatusrepair/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehstatusrepair/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatusrepair/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatusrepair/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (400, Already closed):
{
"message": "Closed_Record"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Status Types
Manage vehicle status type records.
List status types
requires authentication
Returns all vehicle status types for the current owner.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehstatustype" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehstatustype"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatustype';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatustype'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"name": "Engine repair"
},
{
"id": 2,
"name": "Body repair"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get status type
requires authentication
Returns a single vehicle status type by ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehstatustype/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehstatustype/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatustype/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatustype/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"name": "Engine repair"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create status type
requires authentication
Creates a new vehicle status type.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/vehstatustype" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Engine repair\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehstatustype"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Engine repair"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatustype';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Engine repair',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatustype'
payload = {
"name": "Engine repair"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 1,
"name": "Engine repair"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update status type
requires authentication
Updates an existing vehicle status type.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/vehstatustype/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Engine repair\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehstatustype/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Engine repair"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatustype/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Engine repair',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatustype/1'
payload = {
"name": "Engine repair"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 1,
"name": "Body repair"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete status type
requires authentication
Deletes a vehicle status type.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/vehstatustype/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehstatustype/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehstatustype/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehstatustype/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Vehicles
*
- APIs for managing vehicles
Objects
Object management
List all objects
requires authentication
Returns all vehicle objects for the current user. Admin users receive a limited set (max 5).
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/objects" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/objects"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/objects';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/objects'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"object_id": "ABC123",
"oid": "metrotec",
"Serial_Nr": "123456789",
"GSM_NR": "+37255555555",
"Manufacture": 1,
"odometer": 150000,
"T1max": 30,
"T2max": 30,
"T1min": 0,
"T2min": 0,
"odometer_day": "2025-01-01 00:00:00",
"description": "Delivery truck",
"tank_vol": 200.5,
"x_coord": 24.7536,
"y_coord": 59.437,
"is_fixed_gps": 0,
"account_type": 1,
"categoryID": 1,
"extraDevices": 0,
"naviseade": "ABC123",
"deviceName": "FMB120",
"isPercent": 0
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Search objects
requires authentication
Searches vehicle objects by object ID or serial number. Requires installer-level access.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/objects-query?q=ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"q\": \"b\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/objects-query"
);
const params = {
"q": "ABC123",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"q": "b"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/objects-query';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'q' => 'ABC123',
],
'json' => [
'q' => 'b',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/objects-query'
payload = {
"q": "b"
}
params = {
'q': 'ABC123',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (200, Success):
[
{
"object_id": "ABC123",
"oid": "metrotec",
"Serial_Nr": "123456789",
"GSM_NR": "+37255555555",
"Manufacture": 1
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show object
requires authentication
Returns a single vehicle object by ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/objects/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/objects/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/objects/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/objects/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"object_id": "ABC123",
"oid": "metrotec",
"Serial_Nr": "123456789",
"GSM_NR": "+37255555555",
"Manufacture": 1,
"odometer": 150000,
"T1max": 30,
"T2max": 30,
"T1min": 0,
"T2min": 0,
"odometer_day": "2025-01-01 00:00:00",
"description": "Delivery truck",
"tank_vol": 200.5,
"x_coord": 24.7536,
"y_coord": 59.437,
"is_fixed_gps": 0,
"account_type": 1,
"categoryID": 1,
"extraDevices": 0,
"naviseade": "ABC123",
"deviceName": "FMB120",
"isPercent": 0
}
Example response (404, Not found):
{
"error": "Vehicle_Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create object
requires authentication
Creates a new vehicle object. Requires installer-level access.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/objects" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"oid\": \"metrotec\",
\"Serial_Nr\": \"123456789\",
\"GSM_NR\": \"+37255555555\",
\"Manufacture\": 1,
\"odometer\": 150000,
\"T1max\": 30,
\"T2max\": 30,
\"odometer_day\": \"2025-01-01 00:00:00\",
\"description\": \"Delivery truck\",
\"tank_vol\": 200.5,
\"x_coord\": 24.7536,
\"y_coord\": 59.437,
\"is_fixed_gps\": false
}"
const url = new URL(
"https://testapi.metrotec.ee/api/objects"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"oid": "metrotec",
"Serial_Nr": "123456789",
"GSM_NR": "+37255555555",
"Manufacture": 1,
"odometer": 150000,
"T1max": 30,
"T2max": 30,
"odometer_day": "2025-01-01 00:00:00",
"description": "Delivery truck",
"tank_vol": 200.5,
"x_coord": 24.7536,
"y_coord": 59.437,
"is_fixed_gps": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/objects';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'oid' => 'metrotec',
'Serial_Nr' => '123456789',
'GSM_NR' => '+37255555555',
'Manufacture' => 1,
'odometer' => 150000,
'T1max' => 30,
'T2max' => 30,
'odometer_day' => '2025-01-01 00:00:00',
'description' => 'Delivery truck',
'tank_vol' => 200.5,
'x_coord' => 24.7536,
'y_coord' => 59.437,
'is_fixed_gps' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/objects'
payload = {
"object_id": "ABC123",
"oid": "metrotec",
"Serial_Nr": "123456789",
"GSM_NR": "+37255555555",
"Manufacture": 1,
"odometer": 150000,
"T1max": 30,
"T2max": 30,
"odometer_day": "2025-01-01 00:00:00",
"description": "Delivery truck",
"tank_vol": 200.5,
"x_coord": 24.7536,
"y_coord": 59.437,
"is_fixed_gps": false
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"object_id": "ABC123",
"oid": "metrotec",
"Serial_Nr": "123456789"
}
Example response (400, Duplicate serial):
{
"error": "Not_Unique_Serial_Nr"
}
Example response (400, Duplicate object ID):
{
"error": "Not_Unique_Object_Id"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update object
requires authentication
Updates an existing vehicle object. Requires installer-level access.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/objects/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"oid\": \"metrotec\",
\"Serial_Nr\": \"123456789\",
\"GSM_NR\": \"+37255555555\",
\"Manufacture\": 1,
\"odometer\": 150000,
\"T1max\": 30,
\"T2max\": 30,
\"odometer_day\": \"2025-01-01 00:00:00\",
\"description\": \"Delivery truck\",
\"tank_vol\": 200.5,
\"x_coord\": 24.7536,
\"y_coord\": 59.437,
\"is_fixed_gps\": false
}"
const url = new URL(
"https://testapi.metrotec.ee/api/objects/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"oid": "metrotec",
"Serial_Nr": "123456789",
"GSM_NR": "+37255555555",
"Manufacture": 1,
"odometer": 150000,
"T1max": 30,
"T2max": 30,
"odometer_day": "2025-01-01 00:00:00",
"description": "Delivery truck",
"tank_vol": 200.5,
"x_coord": 24.7536,
"y_coord": 59.437,
"is_fixed_gps": false
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/objects/ABC123';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'oid' => 'metrotec',
'Serial_Nr' => '123456789',
'GSM_NR' => '+37255555555',
'Manufacture' => 1,
'odometer' => 150000,
'T1max' => 30,
'T2max' => 30,
'odometer_day' => '2025-01-01 00:00:00',
'description' => 'Delivery truck',
'tank_vol' => 200.5,
'x_coord' => 24.7536,
'y_coord' => 59.437,
'is_fixed_gps' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/objects/ABC123'
payload = {
"object_id": "ABC123",
"oid": "metrotec",
"Serial_Nr": "123456789",
"GSM_NR": "+37255555555",
"Manufacture": 1,
"odometer": 150000,
"T1max": 30,
"T2max": 30,
"odometer_day": "2025-01-01 00:00:00",
"description": "Delivery truck",
"tank_vol": 200.5,
"x_coord": 24.7536,
"y_coord": 59.437,
"is_fixed_gps": false
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"object_id": "ABC123",
"oid": "metrotec",
"Serial_Nr": "123456789"
}
Example response (400, Duplicate serial):
{
"error": "Not_Unique_Serial_Nr"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete object
requires authentication
Deletes a vehicle object. Only objects with account_type=-1 can be deleted. Requires installer-level access.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/objects/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/objects/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/objects/ABC123';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/objects/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"error": "Vehicle_Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get odometer by date
requires authentication
Returns the calculated odometer value for a vehicle at a specific date.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/odometer/ABC123?d=2025-01-15+08%3A00%3A00" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"d\": \"2026-02-26 15:34:38\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/odometer/ABC123"
);
const params = {
"d": "2025-01-15 08:00:00",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"d": "2026-02-26 15:34:38"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/odometer/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'd' => '2025-01-15 08:00:00',
],
'json' => [
'd' => '2026-02-26 15:34:38',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/odometer/ABC123'
payload = {
"d": "2026-02-26 15:34:38"
}
params = {
'd': '2025-01-15 08:00:00',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (200, Success):
{
"odometer": 150234.5
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get odometer / motohours
requires authentication
Returns the current odometer value or motohours for a vehicle, depending on whether it is configured to calculate by hours.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/odomoto/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/odomoto/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/odomoto/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/odomoto/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Odometer):
{
"object_id": "ABC123",
"odometer": 150234,
"motoHours": null,
"dateTimeUTC": "2025-01-15 08:00:00"
}
Example response (200, MotoHours):
{
"object_id": "ABC123",
"odometer": null,
"motoHours": 1234.5,
"dateTimeUTC": "2025-01-15 08:00:00"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get objects in geo area
requires authentication
Returns a list of vehicle object IDs located within the given polygon coordinates.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/objectsingeo?coordinates=%5B%5B24.7%2C59.4%5D%2C%5B24.8%2C59.4%5D%2C%5B24.8%2C59.5%5D%2C%5B24.7%2C59.5%5D%2C%5B24.7%2C59.4%5D%5D" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/objectsingeo"
);
const params = {
"coordinates": "[[24.7,59.4],[24.8,59.4],[24.8,59.5],[24.7,59.5],[24.7,59.4]]",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/objectsingeo';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'coordinates' => '[[24.7,59.4],[24.8,59.4],[24.8,59.5],[24.7,59.5],[24.7,59.4]]',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/objectsingeo'
params = {
'coordinates': '[[24.7,59.4],[24.8,59.4],[24.8,59.5],[24.7,59.5],[24.7,59.4]]',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
"ABC123",
"DEF456",
"GHI789"
]
Example response (403, Forbidden):
{
"message": "Forbidden"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/rfid/{id}
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/rfid/architecto" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/rfid/architecto"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/rfid/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/rfid/architecto'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Fleet Vehicles
Vehicle fleet management with leasing, aliases, and booking
List all vehicles
requires authentication
Returns all vehicles for the current user with device info, booking status, and categories.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehicles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehicles"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicles';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicles'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": "ABC123",
"alias": "Truck 1",
"isOwn": 1,
"extraDevices": 0,
"categoryID": 1,
"categoryName": "Trucks",
"naviseade": "ABC123",
"isDDD": 0,
"account_type": 1,
"Manufacture": 1,
"calcByM": "0",
"has_route_tasks": "1",
"T1min": 0,
"T1max": 30,
"T2min": 0,
"T2max": 30,
"tank_vol": 200,
"barrel_type": 0,
"isPercent": 0,
"isBookable": 1,
"next_maintenance_km": 200000,
"odometer_day": "2025-01-01 00:00:00",
"odometer": 150000,
"fuel_card_nr": "FC-12345",
"gps_refresh_interval": 30,
"is_fuel_as_pressure": 0
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show vehicle
requires authentication
Returns detailed vehicle data. Own vehicles include leasing data; shared vehicles return minimal info.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehicles/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehicles/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicles/ABC123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicles/ABC123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Own vehicle):
{
"id": "ABC123",
"alias": "Truck 1",
"isOwn": 1,
"fuel_card_nr": "FC-12345",
"categoryID": 1,
"categoryName": "Trucks",
"btime": 300,
"next_maintenance_km": 200000,
"next_inspection_day": "2025-06-15",
"next_insurance_day": "2025-12-31",
"odometer": 150000,
"odometer_day": "2025-01-15 08:00:00",
"idle_rpm": 800,
"min_rpm": 500,
"isBookable": 1,
"calcByM": "0",
"has_route_tasks": "1",
"leasing_id": 1,
"kontraktNr": 12345,
"model": "Volvo-FH16",
"period": 36,
"leasing_startDate": "2024-01-01",
"leasing_endDate": "2027-01-01",
"res_value": 15000.5
}
Example response (200, Shared vehicle):
{
"id": "ABC123",
"alias": "Truck 1",
"isOwn": 0
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update vehicle
requires authentication
Updates a vehicle's settings, alias, leasing data, and booking status. Only own vehicles can have their full data updated.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/vehicles/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"fuel_card_nr\": \"FC-12345\",
\"categoryID\": 1,
\"btime\": 300,
\"next_maintenance_km\": 200000,
\"next_inspection_day\": \"2025-06-15\",
\"next_insurance_day\": \"2025-12-31\",
\"odometer\": 150000,
\"idle_rpm\": 800,
\"min_rpm\": 500,
\"odometer_day\": \"2025-01-15 08:00:00\",
\"isBookable\": true,
\"has_route_tasks\": true,
\"calcByM\": false,
\"alias\": \"Truck 1\",
\"kontraktNr\": 12345,
\"model\": \"Volvo-FH16\",
\"period\": 36,
\"leasing_startDate\": \"2024-01-01\",
\"leasing_endDate\": \"2027-01-01\",
\"res_value\": 15000.5,
\"p1\": \"Value 1\",
\"p2\": \"Value 2\",
\"p3\": \"Value 3\",
\"p4\": \"Value 4\",
\"p5\": \"Value 5\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/vehicles/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"fuel_card_nr": "FC-12345",
"categoryID": 1,
"btime": 300,
"next_maintenance_km": 200000,
"next_inspection_day": "2025-06-15",
"next_insurance_day": "2025-12-31",
"odometer": 150000,
"idle_rpm": 800,
"min_rpm": 500,
"odometer_day": "2025-01-15 08:00:00",
"isBookable": true,
"has_route_tasks": true,
"calcByM": false,
"alias": "Truck 1",
"kontraktNr": 12345,
"model": "Volvo-FH16",
"period": 36,
"leasing_startDate": "2024-01-01",
"leasing_endDate": "2027-01-01",
"res_value": 15000.5,
"p1": "Value 1",
"p2": "Value 2",
"p3": "Value 3",
"p4": "Value 4",
"p5": "Value 5"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicles/ABC123';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'fuel_card_nr' => 'FC-12345',
'categoryID' => 1,
'btime' => 300,
'next_maintenance_km' => 200000,
'next_inspection_day' => '2025-06-15',
'next_insurance_day' => '2025-12-31',
'odometer' => 150000,
'idle_rpm' => 800,
'min_rpm' => 500,
'odometer_day' => '2025-01-15 08:00:00',
'isBookable' => true,
'has_route_tasks' => true,
'calcByM' => false,
'alias' => 'Truck 1',
'kontraktNr' => 12345,
'model' => 'Volvo-FH16',
'period' => 36,
'leasing_startDate' => '2024-01-01',
'leasing_endDate' => '2027-01-01',
'res_value' => 15000.5,
'p1' => 'Value 1',
'p2' => 'Value 2',
'p3' => 'Value 3',
'p4' => 'Value 4',
'p5' => 'Value 5',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicles/ABC123'
payload = {
"fuel_card_nr": "FC-12345",
"categoryID": 1,
"btime": 300,
"next_maintenance_km": 200000,
"next_inspection_day": "2025-06-15",
"next_insurance_day": "2025-12-31",
"odometer": 150000,
"idle_rpm": 800,
"min_rpm": 500,
"odometer_day": "2025-01-15 08:00:00",
"isBookable": true,
"has_route_tasks": true,
"calcByM": false,
"alias": "Truck 1",
"kontraktNr": 12345,
"model": "Volvo-FH16",
"period": 36,
"leasing_startDate": "2024-01-01",
"leasing_endDate": "2027-01-01",
"res_value": 15000.5,
"p1": "Value 1",
"p2": "Value 2",
"p3": "Value 3",
"p4": "Value 4",
"p5": "Value 5"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"message": "OK"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Aliases
Vehicle alias management
Update alias
requires authentication
Creates, updates, or removes a vehicle alias. Pass null to remove the alias.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/alias/ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"alias\": \"Truck 1\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/alias/ABC123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"alias": "Truck 1"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/alias/ABC123';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'alias' => 'Truck 1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/alias/ABC123'
payload = {
"alias": "Truck 1"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"ID": 1,
"object_id": "ABC123",
"alias": "Truck 1"
}
Example response (200, Removed):
null
Example response (403, Forbidden):
{
"message": "ObjectNotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Categories
Vehicle category management
List all categories
requires authentication
Returns all vehicle categories for the current user.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/categories" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/categories"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/categories';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/categories'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"name": "Trucks",
"calcByKm": "1",
"calcByM": "0",
"shift": "0"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show category
requires authentication
Returns a single category with its assigned vehicles.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/categories/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/categories/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/categories/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/categories/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"id": 1,
"name": "Trucks",
"calcByKm": "1",
"calcByM": "0",
"shift": "0",
"vehicles": [
{
"object_id": "ABC123",
"alias": "Truck 1"
}
]
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create category
requires authentication
Creates a new vehicle category.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/categories" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Trucks\",
\"calcByKm\": true,
\"calcByM\": false,
\"shift\": false
}"
const url = new URL(
"https://testapi.metrotec.ee/api/categories"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Trucks",
"calcByKm": true,
"calcByM": false,
"shift": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/categories';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Trucks',
'calcByKm' => true,
'calcByM' => false,
'shift' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/categories'
payload = {
"name": "Trucks",
"calcByKm": true,
"calcByM": false,
"shift": false
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"id": 2,
"name": "Vans",
"calcByKm": "1",
"calcByM": "0",
"shift": "0"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update category
requires authentication
Updates an existing vehicle category.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/categories/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Trucks\",
\"calcByKm\": true,
\"calcByM\": false,
\"shift\": false
}"
const url = new URL(
"https://testapi.metrotec.ee/api/categories/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Trucks",
"calcByKm": true,
"calcByM": false,
"shift": false
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/categories/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Trucks',
'calcByKm' => true,
'calcByM' => false,
'shift' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/categories/1'
payload = {
"name": "Trucks",
"calcByKm": true,
"calcByM": false,
"shift": false
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200, Success):
{
"id": 1,
"name": "Heavy Trucks",
"calcByKm": "1",
"calcByM": "0",
"shift": "0"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete category
requires authentication
Deletes a vehicle category. Fails if vehicles are still assigned to it.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/categories/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/categories/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/categories/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/categories/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Success):
{
"message": "Deleted"
}
Example response (400, In use):
{
"message": "No_Delete"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Trailers
Manage vehicle trailers
List all trailers
requires authentication
Returns all trailers for the current user's organization. By default, only active trailers are returned.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/trailers?archived=1&filter%5Bobject_id%5D=ABC123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/trailers"
);
const params = {
"archived": "1",
"filter[object_id]": "ABC123",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/trailers';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'archived' => '1',
'filter[object_id]' => 'ABC123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/trailers'
params = {
'archived': '1',
'filter[object_id]': 'ABC123',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"id": 1,
"object_id": "ABC123",
"trailer_object_id": "TRL001",
"trailer_nr": "123ABC",
"mark": "Schmitz",
"trailer_model": "Cargobull",
"active": true,
"vehicle": {
"object_id": "ABC123",
"mark": "Volvo",
"model": "FH16"
},
"trailer": {
"object_id": "TRL001",
"mark": "Schmitz",
"model": "Cargobull"
}
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a trailer
requires authentication
Creates a new trailer for the current user's organization.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/trailers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"trailer_object_id\": \"TRL001\",
\"trailer_nr\": \"123ABC\",
\"mark\": \"Schmitz\",
\"trailer_model\": \"Cargobull\",
\"active\": true
}"
const url = new URL(
"https://testapi.metrotec.ee/api/trailers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"trailer_object_id": "TRL001",
"trailer_nr": "123ABC",
"mark": "Schmitz",
"trailer_model": "Cargobull",
"active": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/trailers';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'trailer_object_id' => 'TRL001',
'trailer_nr' => '123ABC',
'mark' => 'Schmitz',
'trailer_model' => 'Cargobull',
'active' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/trailers'
payload = {
"object_id": "ABC123",
"trailer_object_id": "TRL001",
"trailer_nr": "123ABC",
"mark": "Schmitz",
"trailer_model": "Cargobull",
"active": true
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Success):
{
"data": {
"id": 1,
"object_id": "ABC123",
"trailer_object_id": "TRL001",
"trailer_nr": "123ABC",
"mark": "Schmitz",
"trailer_model": "Cargobull",
"active": true,
"vehicle": null,
"trailer": null
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a trailer
requires authentication
Returns a single trailer by ID.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/trailers/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/trailers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/trailers/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/trailers/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"data": {
"id": 1,
"object_id": "ABC123",
"trailer_object_id": "TRL001",
"trailer_nr": "123ABC",
"mark": "Schmitz",
"trailer_model": "Cargobull",
"active": true,
"vehicle": {
"object_id": "ABC123",
"mark": "Volvo",
"model": "FH16"
},
"trailer": {
"object_id": "TRL001",
"mark": "Schmitz",
"model": "Cargobull"
}
}
}
Example response (403):
{
"message": "Forbidden"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a trailer
requires authentication
Updates an existing trailer.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/trailers/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"trailer_object_id\": \"TRL001\",
\"trailer_nr\": \"123ABC\",
\"mark\": \"Schmitz\",
\"trailer_model\": \"Cargobull\",
\"active\": true
}"
const url = new URL(
"https://testapi.metrotec.ee/api/trailers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"trailer_object_id": "TRL001",
"trailer_nr": "123ABC",
"mark": "Schmitz",
"trailer_model": "Cargobull",
"active": true
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/trailers/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'trailer_object_id' => 'TRL001',
'trailer_nr' => '123ABC',
'mark' => 'Schmitz',
'trailer_model' => 'Cargobull',
'active' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/trailers/1'
payload = {
"object_id": "ABC123",
"trailer_object_id": "TRL001",
"trailer_nr": "123ABC",
"mark": "Schmitz",
"trailer_model": "Cargobull",
"active": true
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": {
"id": 1,
"object_id": "ABC123",
"trailer_object_id": "TRL001",
"trailer_nr": "123ABC",
"mark": "Schmitz",
"trailer_model": "Cargobull",
"active": true,
"vehicle": {
"object_id": "ABC123",
"mark": "Volvo",
"model": "FH16"
},
"trailer": {
"object_id": "TRL001",
"mark": "Schmitz",
"model": "Cargobull"
}
}
}
Example response (403):
{
"message": "Forbidden"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a trailer
requires authentication
Permanently deletes a trailer.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/trailers/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/trailers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/trailers/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/trailers/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (204, Success):
Empty response
Example response (403):
{
"message": "Forbidden"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Devices
Device management
GET api/navilist/{id}
POST api/navireq
GET api/smslist/{id}
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/smslist/architecto" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/smslist/architecto"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/smslist/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/smslist/architecto'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/smsreq
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/smsreq" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"content\": \"Please return to base\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/smsreq"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"content": "Please return to base"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/smsreq';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'content' => 'Please return to base',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/smsreq'
payload = {
"object_id": "ABC123",
"content": "Please return to base"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Rudus Vehicles
Rudus-specific vehicle endpoints for drivers
Get Rudus vehicles for a task
requires authentication
Returns vehicles related to a Rudus task. Only available for drivers with Rudus profile. For mixer type, returns the other vehicle from the task. For other types, returns all unique vehicles from related tasks with the same work order.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/vehicles-rudus/1/123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/vehicles-rudus/1/123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/vehicles-rudus/1/123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/vehicles-rudus/1/123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"object_id": "ABC123",
"mark": "Volvo",
"model": "FH16"
}
]
Example response (200, Task not found):
null
Example response (403):
{
"error": "Rudus_Drivers_Only"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Waybills
Waybill types management
List waybill types
requires authentication
Returns all waybill types for the current organization.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/wbtypes" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbtypes"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbtypes';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbtypes'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get waybill type
requires authentication
Returns a single waybill type.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/wbtypes/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbtypes/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbtypes/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbtypes/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a waybill type
requires authentication
Creates a new waybill type.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/wbtypes" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Standard\",
\"hasRides\": true
}"
const url = new URL(
"https://testapi.metrotec.ee/api/wbtypes"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Standard",
"hasRides": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbtypes';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Standard',
'hasRides' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbtypes'
payload = {
"name": "Standard",
"hasRides": true
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update waybill type
requires authentication
Updates an existing waybill type.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/wbtypes/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Standard\",
\"hasRides\": true
}"
const url = new URL(
"https://testapi.metrotec.ee/api/wbtypes/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Standard",
"hasRides": true
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbtypes/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Standard',
'hasRides' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbtypes/architecto'
payload = {
"name": "Standard",
"hasRides": true
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a waybill type
requires authentication
Deletes a waybill type.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/wbtypes/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbtypes/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbtypes/architecto';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbtypes/architecto'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List waybill type objects
requires authentication
Returns all waybill type-object assignments for the current organization.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/wbtypeobj" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbtypeobj"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbtypeobj';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbtypeobj'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get waybill type object
requires authentication
Returns a single waybill type-object assignment.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/wbtypeobj/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbtypeobj/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbtypeobj/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbtypeobj/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a waybill type object
requires authentication
Assigns a waybill type to an object. Validates that both the object and type exist.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/wbtypeobj" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"typeId\": 1,
\"project_id\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/wbtypeobj"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"typeId": 1,
"project_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbtypeobj';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'typeId' => 1,
'project_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbtypeobj'
payload = {
"object_id": "ABC123",
"typeId": 1,
"project_id": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (404, Invalid type):
{
"message": "Invalid_WB_Type"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update waybill type object
requires authentication
Updates a waybill type-object assignment.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/wbtypeobj/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"typeId\": 1,
\"project_id\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/wbtypeobj/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"typeId": 1,
"project_id": 1
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbtypeobj/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'typeId' => 1,
'project_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbtypeobj/1'
payload = {
"object_id": "ABC123",
"typeId": 1,
"project_id": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (404, Not found):
{
"message": "Not_Found"
}
Example response (404, Invalid type):
{
"message": "Invalid_WB_Type"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a waybill type object
requires authentication
Deletes a waybill type-object assignment.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/wbtypeobj/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbtypeobj/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbtypeobj/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbtypeobj/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Deleted):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List waybill jobs
requires authentication
Returns all waybill jobs for the current organization.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/wbjobs" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbjobs"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbjobs';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbjobs'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"name": "Delivery",
"trackAddress": 1,
"type_data": [
{
"typeId": 1
}
]
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get waybill job
requires authentication
Returns a single waybill job.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/wbjobs/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbjobs/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbjobs/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbjobs/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create waybill job
requires authentication
Creates a new waybill job with associated type data.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/wbjobs" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Delivery\",
\"external_id\": \"EXT-001\",
\"trackAddress\": 1,
\"type_data\": [
{
\"typeId\": 1,
\"external_id\": null
}
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/wbjobs"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Delivery",
"external_id": "EXT-001",
"trackAddress": 1,
"type_data": [
{
"typeId": 1,
"external_id": null
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbjobs';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Delivery',
'external_id' => 'EXT-001',
'trackAddress' => 1,
'type_data' => [
[
'typeId' => 1,
'external_id' => null,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbjobs'
payload = {
"name": "Delivery",
"external_id": "EXT-001",
"trackAddress": 1,
"type_data": [
{
"typeId": 1,
"external_id": null
}
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Created):
{
"id": 1,
"name": "Delivery",
"trackAddress": 1,
"type_data": [
{
"typeId": 1
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update waybill job
requires authentication
Updates a waybill job and replaces its type data.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/wbjobs/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Delivery\",
\"external_id\": \"EXT-001\",
\"trackAddress\": 1,
\"type_data\": [
{
\"typeId\": 1,
\"external_id\": null
}
]
}"
const url = new URL(
"https://testapi.metrotec.ee/api/wbjobs/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Delivery",
"external_id": "EXT-001",
"trackAddress": 1,
"type_data": [
{
"typeId": 1,
"external_id": null
}
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbjobs/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Delivery',
'external_id' => 'EXT-001',
'trackAddress' => 1,
'type_data' => [
[
'typeId' => 1,
'external_id' => null,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbjobs/1'
payload = {
"name": "Delivery",
"external_id": "EXT-001",
"trackAddress": 1,
"type_data": [
{
"typeId": 1,
"external_id": null
}
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete waybill job
requires authentication
Deletes a waybill job.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/wbjobs/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbjobs/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbjobs/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbjobs/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Deleted):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List waybill projects
requires authentication
Returns all waybill projects for the current organization.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/wbprojects" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbprojects"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbprojects';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbprojects'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get waybill project
requires authentication
Returns a single waybill project.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/wbprojects/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbprojects/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbprojects/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbprojects/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create waybill project
requires authentication
Creates a new waybill project.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/wbprojects" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Construction Site A\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/wbprojects"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Construction Site A"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbprojects';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Construction Site A',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbprojects'
payload = {
"name": "Construction Site A"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update waybill project
requires authentication
Updates a waybill project.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/wbprojects/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Construction Site A\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/wbprojects/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Construction Site A"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbprojects/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Construction Site A',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbprojects/1'
payload = {
"name": "Construction Site A"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete waybill project
requires authentication
Deletes a waybill project.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/wbprojects/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbprojects/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbprojects/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbprojects/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Deleted):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List opened waybills
requires authentication
Returns all waybills that have not been closed (no stop time).
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/openedwaybills" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/openedwaybills"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/openedwaybills';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/openedwaybills'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"object_id": "ABC123",
"jobName": "Delivery",
"start": "2025-01-15 08:00:00",
"stop": null,
"driverName": "John Doe",
"alias": "Truck 1"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get rides count
requires authentication
Returns the number of rides grouped by object ID for the given period.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/rides?datetime[]=architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/rides"
);
const params = {
"datetime[0]": "architecto",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/rides';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/rides'
params = {
'datetime[0]': 'architecto',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Success):
[
{
"key": "ABC123",
"rides": 5
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get waybill report
requires authentication
Returns aggregated driver-vehicle records by default, or detailed waybill records when all=true.
Supports filtering by object, type, department, and driver.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/wbreport?datetime[]=architecto&object_id=ABC123&driver_id=5&typeId=1&department=Logistics&all=1&jobs=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbreport"
);
const params = {
"datetime[0]": "architecto",
"object_id": "ABC123",
"driver_id": "5",
"typeId": "1",
"department": "Logistics",
"all": "1",
"jobs": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbreport';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'datetime[0]' => 'architecto',
'object_id' => 'ABC123',
'driver_id' => '5',
'typeId' => '1',
'department' => 'Logistics',
'all' => '1',
'jobs' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbreport'
params = {
'datetime[0]': 'architecto',
'object_id': 'ABC123',
'driver_id': '5',
'typeId': '1',
'department': 'Logistics',
'all': '1',
'jobs': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Aggregated):
[
{
"id": 1,
"object_id": "ABC123",
"full_name": "John Doe",
"start_use": "2025-01-15 08:00:00",
"stop_use": "2025-01-15 17:00:00",
"rides": 5,
"job_count": 3
}
]
Example response (200, Detailed):
[
{
"id": 1,
"object_id": "ABC123",
"start": "2025-01-15 08:00:00",
"stop": "2025-01-15 09:00:00",
"name": "Delivery",
"km": 25.3,
"tdiff": "01:00:00"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get waybill report details
requires authentication
Returns detailed waybill data for a driver-vehicle record, including fuel calculations, odometer/motohour data, individual waybill items, and the latest audit log entry.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/wbreportdetails/123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/wbreportdetails/123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/wbreportdetails/123';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/wbreportdetails/123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
{
"item": {
"id": 123,
"object_id": "ABC123"
},
"fuel_spend": 15.2,
"norm_spend": 8.5,
"odo_moto": 180.5,
"average_spend": 8.4,
"calc_end": 35,
"calc_spend": 15.3,
"items": [],
"latest_audit": null
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create waybill (edit mode)
requires authentication
Creates a waybill manually with specified times. Requires extended user access. Validates that times fall within the driver-vehicle session and do not overlap existing waybills.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/waybills/edit" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"drv_id\": 10,
\"jobId\": 1,
\"driverId\": 5,
\"object_id\": \"ABC123\",
\"route\": \"Vilnius - Kaunas\",
\"km\": 102.5,
\"project_id\": 1,
\"start\": \"2025-01-15 08:00:00\",
\"stop\": \"2025-01-15 17:00:00\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/waybills/edit"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"drv_id": 10,
"jobId": 1,
"driverId": 5,
"object_id": "ABC123",
"route": "Vilnius - Kaunas",
"km": 102.5,
"project_id": 1,
"start": "2025-01-15 08:00:00",
"stop": "2025-01-15 17:00:00"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/waybills/edit';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'drv_id' => 10,
'jobId' => 1,
'driverId' => 5,
'object_id' => 'ABC123',
'route' => 'Vilnius - Kaunas',
'km' => 102.5,
'project_id' => 1,
'start' => '2025-01-15 08:00:00',
'stop' => '2025-01-15 17:00:00',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/waybills/edit'
payload = {
"drv_id": 10,
"jobId": 1,
"driverId": 5,
"object_id": "ABC123",
"route": "Vilnius - Kaunas",
"km": 102.5,
"project_id": 1,
"start": "2025-01-15 08:00:00",
"stop": "2025-01-15 17:00:00"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Created):
{
"id": 1,
"object_id": "ABC123",
"start": "2025-01-15 08:00:00",
"stop": "2025-01-15 09:00:00"
}
Example response (400, Invalid times):
{
"message": "Waybill times overlap"
}
Example response (403, Not allowed):
{
"message": "NotAllowed"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update waybill (edit mode)
requires authentication
Updates a waybill with new times and details. Requires extended user access. Changes are audit-logged.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/waybills/edit/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"jobId\": 1,
\"start\": \"2025-01-15 08:00:00\",
\"stop\": \"2025-01-15 17:00:00\",
\"km\": 102.5,
\"project_id\": 1
}"
const url = new URL(
"https://testapi.metrotec.ee/api/waybills/edit/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"jobId": 1,
"start": "2025-01-15 08:00:00",
"stop": "2025-01-15 17:00:00",
"km": 102.5,
"project_id": 1
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/waybills/edit/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'jobId' => 1,
'start' => '2025-01-15 08:00:00',
'stop' => '2025-01-15 17:00:00',
'km' => 102.5,
'project_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/waybills/edit/1'
payload = {
"jobId": 1,
"start": "2025-01-15 08:00:00",
"stop": "2025-01-15 17:00:00",
"km": 102.5,
"project_id": 1
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (403, Not allowed):
{
"message": "NotAllowed"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List waybills
requires authentication
Returns waybills for the given object. If the driver has an active session, returns records from the session start.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/waybills" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/waybills"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/waybills';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/waybills'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200, Success):
[
{
"id": 1,
"object_id": "ABC123",
"name": "Delivery",
"start": "2025-01-15 08:00:00",
"stop": "2025-01-15 09:00:00"
}
]
Example response (200, No object):
[]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get waybill
requires authentication
Returns a single waybill record.
Example request:
curl --request GET \
--get "https://testapi.metrotec.ee/api/waybills/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/waybills/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/waybills/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/waybills/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Unauthenticated."
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create waybill
requires authentication
Creates a new waybill for the authenticated driver. The driver must have an active vehicle session.
Example request:
curl --request POST \
"https://testapi.metrotec.ee/api/waybills" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"object_id\": \"ABC123\",
\"jobId\": 1,
\"taskId\": 10,
\"comment\": \"Urgent delivery\",
\"startAddress\": \"Vilnius, Main St. 1\",
\"route\": \"Vilnius - Kaunas\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/waybills"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"object_id": "ABC123",
"jobId": 1,
"taskId": 10,
"comment": "Urgent delivery",
"startAddress": "Vilnius, Main St. 1",
"route": "Vilnius - Kaunas"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/waybills';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'object_id' => 'ABC123',
'jobId' => 1,
'taskId' => 10,
'comment' => 'Urgent delivery',
'startAddress' => 'Vilnius, Main St. 1',
'route' => 'Vilnius - Kaunas',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/waybills'
payload = {
"object_id": "ABC123",
"jobId": 1,
"taskId": 10,
"comment": "Urgent delivery",
"startAddress": "Vilnius, Main St. 1",
"route": "Vilnius - Kaunas"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (201, Created):
{
"id": 1,
"object_id": "ABC123",
"start": "2025-01-15 08:00:00"
}
Example response (403, Not a driver):
{
"message": "Drivers_Only"
}
Example response (403, Already opened):
{
"message": "Driver_Has_Job_Opened"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update waybill
requires authentication
Updates a waybill. If the waybill is still open and edit is not set, it will be closed with the current time.
Example request:
curl --request PUT \
"https://testapi.metrotec.ee/api/waybills/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"comment\": \"Updated delivery note\",
\"startAddress\": \"Vilnius, Main St. 1\",
\"stopAddress\": \"Kaunas, Oak St. 5\"
}"
const url = new URL(
"https://testapi.metrotec.ee/api/waybills/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"comment": "Updated delivery note",
"startAddress": "Vilnius, Main St. 1",
"stopAddress": "Kaunas, Oak St. 5"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/waybills/1';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'comment' => 'Updated delivery note',
'startAddress' => 'Vilnius, Main St. 1',
'stopAddress' => 'Kaunas, Oak St. 5',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/waybills/1'
payload = {
"comment": "Updated delivery note",
"startAddress": "Vilnius, Main St. 1",
"stopAddress": "Kaunas, Oak St. 5"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete waybill
requires authentication
Deletes a waybill.
Example request:
curl --request DELETE \
"https://testapi.metrotec.ee/api/waybills/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://testapi.metrotec.ee/api/waybills/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/waybills/1';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://testapi.metrotec.ee/api/waybills/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200, Deleted):
{
"message": "Deleted"
}
Example response (404, Not found):
{
"message": "Not_Found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.