MENU navbar-image

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."
}
 

Request      

GET api/alarmlog

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     

Date range [from, to] in YYYY-MM-DD format

datetime.0   string     

Start date (must be before or equal to end date). VΓ€li value peab olema kehtiv kuupΓ€ev. VΓ€li value peab olema kuupΓ€ev enne vΓ΅i vΓ΅rdne kuupΓ€evaga datetime.1. Example: 2026-01-01

datetime.1   string     

End date (must be after or equal to start date). VΓ€li value peab olema kehtiv kuupΓ€ev. VΓ€li value peab olema kuupΓ€ev pΓ€rast vΓ΅i vΓ΅rdne kuupΓ€evaga datetime.0. Example: 2026-01-31

object_id   string  optional    

Filter by vehicle/object ID Example: ABC123

AlertGroup   integer[]  optional    

Filter by alert group IDs

offset   integer  optional    

Pagination offset Example: 0

limit   integer  optional    

Number of records to return (default: 30) Example: 30

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."
}
 

Request      

GET api/alarmhistory

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     

Date range [from, to] in YYYY-MM-DD format

datetime.0   string     

Start date (must be before or equal to end date). VΓ€li value peab olema kehtiv kuupΓ€ev. VΓ€li value peab olema kuupΓ€ev enne vΓ΅i vΓ΅rdne kuupΓ€evaga datetime.1. Example: 2026-01-01

datetime.1   string     

End date (must be after or equal to start date). VΓ€li value peab olema kehtiv kuupΓ€ev. VΓ€li value peab olema kuupΓ€ev pΓ€rast vΓ΅i vΓ΅rdne kuupΓ€evaga datetime.0. Example: 2026-01-31

object_id   string  optional    

Filter by vehicle/object ID Example: ABC123

offset   integer  optional    

Pagination offset Example: 0

limit   integer  optional    

Number of records to return (default: 30) Example: 30

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."
}
 

Request      

GET api/alarmgroups

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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()

Request      

POST api/testalarm

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

id   integer     

The contact ID to send test alarm to Example: 1

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."
}
 

Request      

GET api/alarmconfig

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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()

Request      

POST api/alarmconfig

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

Name   string     

Alarm configuration name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Speed Alert

email   string  optional    

Email address for notifications. VΓ€li value peab olema kehtiv e-posti aadress. Example: alerts@example.com

Active   boolean  optional    

Whether the alarm is active. Example: true

sms   string  optional    

Phone number for SMS notifications (digits only). Must match the regex /^\d+$/. Example: 5555555

country_code   string  optional    

Phone country code. Must match the regex /^+?\d+$/. Example: +372

alarms   object     

Array of alarm type IDs. VΓ€ljal value peab olema vΓ€hemalt 1 elementi.

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."
}
 

Request      

GET api/alarmconfig/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the alarmconfig. Example: architecto

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()

Request      

PUT api/alarmconfig/{id}

PATCH api/alarmconfig/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the alarmconfig. Example: architecto

Body Parameters

Name   string  optional    

Alarm configuration name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Speed Alert

email   string  optional    

Email address for notifications. VΓ€li value peab olema kehtiv e-posti aadress. Example: alerts@example.com

Active   boolean  optional    

Whether the alarm is active. Example: true

sms   string  optional    

Phone number for SMS notifications (digits only). Must match the regex /^\d+$/. Example: 5555555

country_code   string  optional    

Phone country code. Must match the regex /^+?\d+$/. Example: +372

alarms   object  optional    

Array of alarm type IDs. VΓ€ljal value peab olema vΓ€hemalt 1 elementi.

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()

Request      

DELETE api/alarmconfig/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the alarmconfig. Example: architecto

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"
        }
    ]
}
 

Request      

GET api/booking

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

mq   string  optional    

Mode: desktop or mobile (mobile returns grouped percentage data). Example: desktop

Must be one of:
  • desktop
  • mobile
day   string  optional    

Filter by specific day. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 00:00:00

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"
}
 

Request      

GET api/booking/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the booking. Example: architecto

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
        }
    }
}
 

Request      

GET api/bookinggrouped

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
        }
    ]
}
 

Request      

GET api/bookingobjects

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

driver_id   integer  optional    

Filter available vehicles by driver. Example: 1

datetime   string[]  optional    
id   integer  optional    

Booking ID to exclude from availability check (used when editing). Example: 1

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
        }
    ]
}
 

Request      

GET api/bookinglog

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
offset   integer  optional    

Number of records to skip. VΓ€li value peab olema vΓ€hemalt -1. Example: 0

limit   integer  optional    

Maximum number of records to return. VΓ€li value peab olema vΓ€hemalt 1. Example: 30

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
        }
    ]
}
 

Request      

GET api/bookingreport

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
object_id   string  optional    

Filter report by vehicle object ID. Must contain only letters and numbers. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

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"
}
 

Request      

POST api/booking

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Vehicle object ID. Must contain only letters and numbers. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

driver_id   integer     

Driver ID. Example: 1

purpose   string     

Purpose of the booking. Example: Delivery

start_time   string     

Booking start time in UTC. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

stop_time   string     

Booking end time in UTC. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 17:00:00

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"
}
 

Request      

PUT api/booking/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the booking. Example: architecto

Body Parameters

object_id   string     

Vehicle object ID. Must contain only letters and numbers. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

driver_id   integer     

Driver ID. Example: 1

purpose   string     

Purpose of the booking. Example: Delivery

start_time   string     

Booking start time in UTC. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

stop_time   string     

Booking end time in UTC. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 17:00:00

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"
}
 

Request      

DELETE api/booking/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the booking. Example: architecto

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"
        }
    ]
}
 

Request      

GET api/brigades

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/brigades/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the brigade. Example: architecto

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"
    }
}
 

Request      

POST api/brigades

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

brigName   string     

Brigade name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Morning Shift

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"
}
 

Request      

PUT api/brigades/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the brigade. Example: architecto

Body Parameters

brigName   string     

Brigade name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Morning Shift

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"
}
 

Request      

DELETE api/brigades/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the brigade. Example: architecto

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"
}
 

Request      

GET api/dddaccount

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/ddddownload

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   integer[]  optional    
DriverID   string[]  optional    
file_type   integer  optional    

File type: 6 for driver, 7 for vehicle. Example: 7

Must be one of:
  • 6
  • 7
datetime   string[]  optional    

VΓ€li value peab olema kehtiv kuupΓ€ev.

limit   integer  optional    

Maximum number of files to include. VΓ€li value peab olema vΓ€hemalt 1. Example: 30

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"
}
 

Request      

GET api/ddddownload/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The DDD file ID. Example: 123

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
        }
    ]
}
 

Request      

GET api/ddddrivers

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

archive   boolean  optional    

Include archived drivers. Example: false

limit   integer  optional    

Maximum number of records to return. Use -1 for all. VΓ€li value peab olema vΓ€hemalt -1. Example: 30

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"
}
 

Request      

GET api/ddddrivers/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The driver ID. Example: 1

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
}
 

Request      

POST api/ddddrivers

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

refreshRate   integer     

The refresh rate for DDD downloads. Example: 30

archive   string  optional    

Archive status (0 or 1). Example: 0

Must be one of:
  • 0
  • 1

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
        }
    ]
}
 

Request      

GET api/dddvehicles

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

limit   integer  optional    

Maximum number of records to return. Use -1 for all. VΓ€li value peab olema vΓ€hemalt -1. Example: 30

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"
}
 

Request      

GET api/dddvehicles/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The vehicle/object ID. Example: 1

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
}
 

Request      

POST api/dddvehicles

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

refreshRate   integer     

The refresh rate for DDD downloads. Example: 30

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"
        }
    ]
}
 

Request      

GET api/dddfiles

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   integer[]  optional    
DriverID   string[]  optional    
file_type   integer  optional    

File type: 6 for driver, 7 for vehicle. Example: 7

Must be one of:
  • 6
  • 7
datetime   string[]  optional    

VΓ€li value peab olema kehtiv kuupΓ€ev.

offset   integer  optional    

Pagination offset. VΓ€li value peab olema vΓ€hemalt -1. Example: 0

archive   boolean  optional    

Include archived records. Example: false

limit   integer  optional    

Maximum number of records to return. VΓ€li value peab olema vΓ€hemalt 1. Example: 30

latest   boolean  optional    

Return only latest records per object/driver. Example: false

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"
        }
    ]
}
 

Request      

GET api/dddlog

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string  optional    

Filter by object ID. Must contain only letters and numbers. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: 123

datetime   string[]  optional    

VΓ€li value peab olema kehtiv kuupΓ€ev.

offset   integer  optional    

Pagination offset. VΓ€li value peab olema vΓ€hemalt 0. Example: 0

limit   integer  optional    

Maximum number of records to return. VΓ€li value peab olema vΓ€hemalt 1. Example: 30

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"
        }
    ]
}
 

Request      

GET api/ddddriversstatus

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string  optional    

Filter by object ID. Must contain only letters and numbers. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: 123

driver_id   integer  optional    

Filter by driver ID. Example: 1

datetime   string[]  optional    

VΓ€li value peab olema kehtiv kuupΓ€ev.

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
}
 

Request      

GET api/ddddriversstatus/summary

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string  optional    

Filter by object ID. Must contain only letters and numbers. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: 123

driver_id   integer  optional    

Filter by driver ID. Example: 1

datetime   string[]  optional    

VΓ€li value peab olema kehtiv kuupΓ€ev.

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"
}
 

Request      

POST api/dddrequests

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The object/vehicle ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: 123

file_type   integer     

File type: 6 for driver, 7 for vehicle. Example: 7

Must be one of:
  • 6
  • 7
start   string  optional    

Start date for the request period. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-01 00:00:00

end   string  optional    

End date for the request period. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-31 23:59:59

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"
    }
}
 

Request      

POST api/dddrequest

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The object/vehicle ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: 123

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"
}
 

Request      

PUT api/dddrequest/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The log request ID. Example: 1

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"
    }
]
 

Request      

GET api/closedreg

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
driver_id   integer  optional    

Filter by driver ID. Example: 42

object_id   string  optional    

Filter by vehicle object ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

offset   integer  optional    

Pagination offset. Use -1 to return all records. Example: 0

limit   integer  optional    

Number of records to return. Example: 30

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"
}
 

Request      

GET api/qrcode/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

GET api/vehicledriversqr

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

POST api/vehicledriversqr

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Vehicle object ID to register. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

check_id   integer  optional    

Vehicle status check ID (required when VehStatusCheck module is active). Example: 1

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"
}
 

Request      

PUT api/vehicledriversqr

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

POST api/vehicledriversbooking

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

booking_id   integer     

Booking record ID to register the driver-vehicle assignment from. Example: 1

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"
}
 

Request      

PUT api/vehicle/drivers/edit/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The registration record ID. Example: 1

Body Parameters

fuelStart   number  optional    

Fuel level at start of trip. Example: 45.5

fuelEnd   number  optional    

Fuel level at end of trip. Example: 30.2

billFuel   number  optional    

Billed fuel amount. Example: 15.3

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
    }
]
 

Request      

GET api/vehicle/drivers

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/vehicle/drivers/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The registration record ID. Example: 1

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"
}
 

Request      

POST api/vehicle/drivers

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Vehicle object ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

startUse   string     

Registration start datetime (UTC). Must be a valid date in the format Y-m-d H:i:s. Example: 2026-01-15 08:00:00

stopUse   string  optional    

Registration end datetime (UTC). Must be a valid date in the format Y-m-d H:i:s. Example: 2026-01-15 17:00:00

driver_id   integer  optional    

Driver ID. Example: 42

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"
}
 

Request      

PUT api/vehicle/drivers/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The registration record ID. Example: 1

Body Parameters

object_id   string  optional    

Vehicle object ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

startUse   string     

Registration start datetime (UTC). Must be a valid date in the format Y-m-d H:i:s. Example: 2026-01-15 08:00:00

stopUse   string  optional    

Registration end datetime (UTC). Must be a valid date in the format Y-m-d H:i:s. Example: 2026-01-15 17:00:00

driver_id   integer  optional    

Driver ID. Example: 42

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"
}
 

Request      

DELETE api/vehicle/drivers/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The registration record ID. Example: 1

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"
    }
]
 

Request      

GET api/driverkeys

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/driverkeys/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The key record ID. Example: 1

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
}
 

Request      

POST api/driverkeys

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Key name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Main Key

code   string     

Key code identifier. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: KEY001

type   integer     

Key type. Example: 1

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"
}
 

Request      

PUT api/driverkeys/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The key record ID. Example: 1

Body Parameters

name   string  optional    

Key name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Main Key

code   string  optional    

Key code identifier. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: KEY001

driver   string  optional    

Whether this key belongs to a driver (0 or 1). Example: 1

Must be one of:
  • 0
  • 1
type   integer  optional    

Key type. Example: 1

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"
}
 

Request      

DELETE api/driverkeys/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The key record ID. Example: 1

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
    }
]
 

Request      

GET api/drivers

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

usersOnly   string  optional    

Filter by user association (0 = without users, 1 = with users). Example: 1

Must be one of:
  • 0
  • 1
archive   string  optional    

Include archived drivers (0 = active only, 1 = include archived). Example: 0

Must be one of:
  • 0
  • 1

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"
}
 

Request      

GET api/drivers/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The driver record ID. Example: 1

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
}
 

Request      

POST api/drivers

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Driver first name. VΓ€li value ei tohi olla pikem kui 16 tΓ€hemΓ€rki. Example: John

fname   string     

Driver last name. VΓ€li value ei tohi olla pikem kui 16 tΓ€hemΓ€rki. Example: Doe

gsm   string  optional    

Phone number. VΓ€li value ei tohi olla pikem kui 16 tΓ€hemΓ€rki. Example: +37255512345

comment   string  optional    

Comment or note. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Senior driver

key_id   integer  optional    

Associated driver key ID. Example: 1

p1   string  optional    

Custom field 1. VΓ€li value ei tohi olla pikem kui 20 tΓ€hemΓ€rki. Example: Value 1

p2   string  optional    

Custom field 2. VΓ€li value ei tohi olla pikem kui 20 tΓ€hemΓ€rki. Example: Value 2

p3   string  optional    

Custom field 3. VΓ€li value ei tohi olla pikem kui 20 tΓ€hemΓ€rki. Example: Value 3

archive   string  optional    

Archive status (0 = active, 1 = archived). Example: 0

Must be one of:
  • 0
  • 1

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"
}
 

Request      

PUT api/drivers/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The driver record ID. Example: 1

Body Parameters

name   string     

Driver first name. VΓ€li value ei tohi olla pikem kui 16 tΓ€hemΓ€rki. Example: John

fname   string     

Driver last name. VΓ€li value ei tohi olla pikem kui 16 tΓ€hemΓ€rki. Example: Doe

gsm   string  optional    

Phone number. VΓ€li value ei tohi olla pikem kui 16 tΓ€hemΓ€rki. Example: +37255512345

comment   string  optional    

Comment or note. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Senior driver

key_id   integer  optional    

Associated driver key ID. Example: 1

p1   string  optional    

Custom field 1. VΓ€li value ei tohi olla pikem kui 20 tΓ€hemΓ€rki. Example: Value 1

p2   string  optional    

Custom field 2. VΓ€li value ei tohi olla pikem kui 20 tΓ€hemΓ€rki. Example: Value 2

p3   string  optional    

Custom field 3. VΓ€li value ei tohi olla pikem kui 20 tΓ€hemΓ€rki. Example: Value 3

archive   string  optional    

Archive status (0 = active, 1 = archived). Example: 0

Must be one of:
  • 0
  • 1

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"
}
 

Request      

DELETE api/drivers/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The driver record ID. Example: 1

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
    }
]
 

Request      

GET api/lastdata

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/lastdata/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

GET api/drivereport/{start}/{stop}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

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"
}
 

Request      

GET api/drivereport/{start}/{stop}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

GET api/fuelreport/{start}/{stop}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

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"
}
 

Request      

GET api/fuelreport/{start}/{stop}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

GET api/enginereport/{start}/{stop}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

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"
}
 

Request      

GET api/enginereport/{start}/{stop}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

GET api/routelog/{start}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

GET api/drivers/{start}/{stop}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

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"
}
 

Request      

GET api/drivers/{start}/{stop}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

id   string     

The vehicle object ID. Example: ABC123

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
    }
]
 

Request      

GET api/stockdata

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/stockdata/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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"
    }
]
 

Request      

GET api/files

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

pivot_type   string     

The entity type Example: route_tasks

pivot_id   string     

The entity ID Example: 12345

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"
}
 

Request      

POST api/files

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

Body Parameters

file   file     

The file to upload. Must be a file. Example: /tmp/phpp3uj6i8dc8fl41KzTYv

pivot_type   string     

Type of entity the file belongs to. Example: route_tasks

Must be one of:
  • accounts
  • logos
  • route_tasks
  • vehicle_faults
  • feedback_answers
  • tech_card_works
  • signatures
  • fish_documents
  • fish_document_signatures
pivot_id   string     

ID of the entity the file belongs to. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: 12345

max_files   integer  optional    

Maximum number of files allowed for this entity. VΓ€li value peab olema vΓ€hemalt 1. Example: 5

hidden   boolean  optional    

Whether the file should be hidden. Example: false

file_type   string  optional    

Type of file (image, cmr, delivery_note, etc.). Example: image

Must be one of:
  • image
  • cmr
  • cmr_template
  • delivery_note
  • order
  • other
  • receiver_signature
  • sender_signature
  • carrier_signature
  • fish_document
auto_crop   boolean  optional    

Automatically crop whitespace from images. Example: false

auto_type   string  optional    

Convert image to specified format. Example: webp

Must be one of:
  • jpg
  • gif
  • png
  • webp

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"
}
 

Request      

GET api/files/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the file. Example: 1

file   integer     

File ID Example: 1

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"
}
 

Request      

PUT api/files/{id}

PATCH api/files/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the file. Example: 1

file   integer     

File ID Example: 1

Body Parameters

file_type   string     

Type of file (image, cmr, delivery_note, etc.). Example: cmr

Must be one of:
  • image
  • cmr
  • cmr_template
  • delivery_note
  • order
  • other
  • receiver_signature
  • sender_signature
  • carrier_signature
  • fish_document

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
 

Request      

DELETE api/files/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the file. Example: 1

file   integer     

File ID Example: 1

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"
}
 

Request      

POST api/drawing/{file_id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

URL Parameters

file_id   integer     

The ID of the file. Example: 1

file   integer     

The file ID Example: 1

Body Parameters

file   file     

The PNG overlay image with transparency. Must be a file. VΓ€li value peab olema pilt. Example: /tmp/phpl031pv126jae23gzKkj

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"
    }
]
 

Request      

POST api/signature

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

Body Parameters

signature   file     

The signature image file. Must be a file. VΓ€li value peab olema pilt. Example: /tmp/phpaogu7viggt9j9tpUN0A

ids   integer[]     
pivot_type   string  optional    

Type of pivot for signature storage. Example: signatures

Must be one of:
  • signatures
  • fish_document_signatures
file_type   string  optional    

Type of signature. Example: receiver_signature

Must be one of:
  • receiver_signature
  • sender_signature
  • carrier_signature

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": []}]}
 

Request      

GET api/geozones

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/geozones/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the geozone. Example: architecto

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"
    }
}
 

Request      

POST api/geozones

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

geometry   object     

GeoJSON geometry object.

type   string     

Example: Polygon

Must be one of:
  • circle
  • Polygon
coordinates   object  optional    

This field is required when geometry.type is Polygon.

latlng   object  optional    

This field is required when geometry.type is circle.

radius   number  optional    

This field is required when geometry.type is circle. Example: 4326.41688

name   string     

Geozone name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Warehouse Zone

cAlarmState   boolean  optional    

Enable count alarm. Example: false

countAlarm   integer  optional    

Minimum count for alarm (min 2). VΓ€li value peab olema vΓ€hemalt 2. Example: 2

zObjects   string[]  optional    

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"
}
 

Request      

PUT api/geozones/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the geozone. Example: architecto

Body Parameters

geometry   object  optional    

GeoJSON geometry object.

type   string  optional    

This field is required when geometry is present. Example: circle

Must be one of:
  • circle
  • Polygon
coordinates   object  optional    

This field is required when geometry.type is Polygon.

latlng   object  optional    

This field is required when geometry.type is circle.

radius   number  optional    

This field is required when geometry.type is circle. Example: 4326.41688

name   string  optional    

Geozone name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Warehouse Zone

cAlarmState   boolean  optional    

Enable count alarm. Example: false

countAlarm   integer  optional    

Minimum count for alarm (min 2). VΓ€li value peab olema vΓ€hemalt 2. Example: 2

zObjects   string[]  optional    

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"
}
 

Request      

DELETE api/geozones/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the geozone. Example: architecto

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
        }
    ]
}
 

Request      

GET api/geotoobject

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

POST api/geotoobject

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Object/vehicle ID to assign to geozone. Example: 123

geozoneID   integer     

Geozone ID. Example: 1

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"
}
 

Request      

DELETE api/geotoobject/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the geotoobject. Example: architecto

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"
            }
        ]
    }
]
 

Request      

GET api/inputs

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
    }
]
 

Request      

GET api/inputs/{obj}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

obj   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

POST api/inputs/{obj}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

obj   string     

The vehicle object ID. Example: ABC123

Body Parameters

nr   integer     

Input number (1-19). VΓ€li value peab olema vahemikus 1 kuni 19. Example: 1

name   string     

Input name. Example: Ignition

color   string     

Hex RGB color code. Must match the regex /^#?[0-9A-Fa-f]{6}$/. Example: #FF0000

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"
}
 

Request      

PUT api/inputs/{obj}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

obj   string     

The vehicle object ID. Example: ABC123

id   integer     

The input record ID. Example: 5

Body Parameters

nr   integer  optional    

Input number (1-19). VΓ€li value peab olema vahemikus 1 kuni 19. Example: 1

name   string  optional    

Input name. Example: Ignition

color   string  optional    

Hex RGB color code. Must match the regex /^#?[0-9A-Fa-f]{6}$/. Example: #FF0000

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"
}
 

Request      

DELETE api/inputs/{obj}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

obj   string     

The vehicle object ID. Example: ABC123

id   integer     

The input record ID. Example: 5

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"
}
 

Request      

DELETE api/inputs/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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"
    }
]
 

Request      

GET api/input-settings

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/input-settings/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The input record ID. Example: 5

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"
}
 

Request      

POST api/input-settings

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

nr   integer     

Input number (1-19). VΓ€li value peab olema vahemikus 1 kuni 19. Example: 1

name   string     

Input name. Example: Ignition

color   string     

Hex RGB color code. Must match the regex /^#?[0-9A-Fa-f]{6}$/. Example: #FF0000

object_id   string     

Vehicle object ID to assign the input to. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 15 tΓ€hemΓ€rki. Example: ABC123

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"
}
 

Request      

PUT api/input-settings/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The input record ID. Example: 5

Body Parameters

nr   integer  optional    

Input number (1-19). VΓ€li value peab olema vahemikus 1 kuni 19. Example: 1

name   string  optional    

Input name. Example: Ignition

color   string  optional    

Hex RGB color code. Must match the regex /^#?[0-9A-Fa-f]{6}$/. Example: #FF0000

object_id   string  optional    

Vehicle object ID to assign the input to. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 15 tΓ€hemΓ€rki. Example: ABC123

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"
}
 

Request      

DELETE api/input-settings/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The input record ID. Example: 5

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"
    }
]
 

Request      

GET api/temperature

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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
 

Request      

GET api/temperature/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

PUT api/temperature/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

Body Parameters

temperatures   object[]  optional    

Array of temperature sensor configurations.

temp_key   string  optional    

Temperature key (t1, t2, t3, or t4). Example: t1

Must be one of:
  • t1
  • t2
  • t3
  • t4
name   string  optional    

Sensor display name. Example: Fridge

color   string  optional    

Hex RGB color code. Must match the regex /^#?[0-9A-Fa-f]{6}$/. Example: #FF0000

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"
}
 

Request      

DELETE api/temperature/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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"
        }
    ]
}
 

Request      

GET api/invoice

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime[]   string     

Date range [from, to] Example: ["2025-01-01", "2025-01-31"]

oid   string  optional    

Filter by organization ID Example: metrotec

manager   string  optional    

Filter by manager Example: admin

paid   integer  optional    

Filter unpaid only (must be 0) Example: 0

offset   integer  optional    

Pagination offset (-1 for all) Example: 0

Body Parameters

datetime   object     

Date range [from, to]. VΓ€ljal value peab olema 2 elementi.

0   string     

VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2025-01-01

1   string     

VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2025-01-31

oid   string  optional    

Filter by organization ID. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: metrotec

manager   string  optional    

Filter by manager. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: admin

paid   string  optional    

Filter unpaid invoices only (value must be 0). Example: 0

Must be one of:
  • 0
offset   integer  optional    

Pagination offset (-1 for all results). VΓ€li value peab olema vΓ€hemalt -1. Example: 0

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"
}
 

Request      

GET api/invoice/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The invoice number. Example: 123

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"
}
 

Request      

POST api/sendlocation/{type}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

type   string     

The location type. Must be "poi" or "vehicle". Example: vehicle

id   string     

The vehicle object ID or POI ID. Example: ABC123

Body Parameters

country_code   string     

The country calling code (e.g. +370). Example: +370

phone_nr   string     

The phone number (digits only). Must match the regex /^\d+$/. Example: 61234567

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
        ]
    }
]
 

Request      

GET api/lastdataprofile

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

oid   string  optional    

Filter by organization ID. Example: org123

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"
}
 

Request      

GET api/lastdataprofile/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The profile ID. Example: 1

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
    ]
}
 

Request      

POST api/lastdataprofile

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

oid   string     

The organization ID. Example: org123

mainFields   object  optional    

Array of main field IDs.

hasMore   boolean  optional    

Whether the profile has more fields. Example: true

is_hybrid_view   boolean  optional    

Whether hybrid view is enabled. Example: false

main_table   object  optional    

Array of main table field IDs.

extended_table   object  optional    

Array of extended table field IDs.

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"
}
 

Request      

PUT api/lastdataprofile/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The profile ID. Example: 1

Body Parameters

oid   string  optional    

The organization ID. Example: org123

mainFields   object  optional    

Array of main field IDs.

hasMore   boolean  optional    

Whether the profile has more fields. Example: true

is_hybrid_view   boolean  optional    

Whether hybrid view is enabled. Example: false

main_table   object  optional    

Array of main table field IDs.

extended_table   object  optional    

Array of extended table field IDs.

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"
}
 

Request      

DELETE api/lastdataprofile/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The profile ID. Example: 1

Navigation

Retrieve parsed navigation messages for a vehicle.

requires authentication

Returns the last navigation messages (answers and requests) for the given vehicle.

Example request:
curl --request GET \
    --get "https://testapi.metrotec.ee/api/navi/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/navi/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/navi/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/navi/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,
        "date": "14:30:00  15.01.2025",
        "dateRaw": "2025-01-15 14:30:00",
        "handled": "ok",
        "type": "a",
        "txt": "FMT:Hello"
    }
]
 

Example response (403, No access):


{
    "error": "ObjectNotAllowed"
}
 

Request      

GET api/navi/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

requires authentication

Sends a navigation request to a vehicle. Long messages (FMT/FMS) are split into chunks automatically.

Example request:
curl --request POST \
    "https://testapi.metrotec.ee/api/navirequest/ABC123" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"FMT\",
    \"txt\": \"Hello from dispatch\",
    \"x\": 25.27956,
    \"y\": 54.68726
}"
const url = new URL(
    "https://testapi.metrotec.ee/api/navirequest/ABC123"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "FMT",
    "txt": "Hello from dispatch",
    "x": 25.27956,
    "y": 54.68726
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/navirequest/ABC123';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'FMT',
            'txt' => 'Hello from dispatch',
            'x' => 25.27956,
            'y' => 54.68726,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://testapi.metrotec.ee/api/navirequest/ABC123'
payload = {
    "type": "FMT",
    "txt": "Hello from dispatch",
    "x": 25.27956,
    "y": 54.68726
}
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):


[
    {
        "id": 1,
        "date": "14:30:00  15.01.2025",
        "dateRaw": "2025-01-15 14:30:00",
        "handled": 0,
        "type": "r",
        "txt": "FMT:Hello from dispatch"
    }
]
 

Example response (400, Missing coordinates):


{
    "error": "Wrong_Parameters"
}
 

Example response (403, No access):


{
    "error": "ObjectNotAllowed"
}
 

Request      

POST api/navirequest/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

Body Parameters

type   string     

The navi message type. Example: FMT

Must be one of:
  • FMA
  • FMT
  • FMS
txt   string  optional    

The message text. Example: Hello from dispatch

x   number  optional    

Longitude coordinate (required for FMS type). Example: 25.27956

y   number  optional    

Latitude coordinate (required for FMS type). Example: 54.68726

requires authentication

Returns navigation 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/navirequests/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/navirequests/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/navirequests/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/navirequests/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",
        "SerialNr": "SN001",
        "Content": "FMT:Hello",
        "handled": 0,
        "LocalTime": "2025-01-15 14:30:00",
        "insdate": "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"
}
 

Request      

GET api/navirequests/{start}/{stop}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

id   string     

The vehicle object ID. Example: ABC123

requires authentication

Creates a navigation request for a vehicle. Supports MESSAGE, GETDESTINATION, SETLOCATION, CONTROL, and COMMAND types.

Example request:
curl --request POST \
    "https://testapi.metrotec.ee/api/navirequests" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": \"ABC123\",
    \"type\": \"MESSAGE\",
    \"lon\": 25.27956,
    \"lat\": 54.68726,
    \"functionId\": 1,
    \"msg\": \"Hello from dispatch\"
}"
const url = new URL(
    "https://testapi.metrotec.ee/api/navirequests"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "object_id": "ABC123",
    "type": "MESSAGE",
    "lon": 25.27956,
    "lat": 54.68726,
    "functionId": 1,
    "msg": "Hello from dispatch"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://testapi.metrotec.ee/api/navirequests';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 'ABC123',
            'type' => 'MESSAGE',
            'lon' => 25.27956,
            'lat' => 54.68726,
            'functionId' => 1,
            'msg' => 'Hello from dispatch',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://testapi.metrotec.ee/api/navirequests'
payload = {
    "object_id": "ABC123",
    "type": "MESSAGE",
    "lon": 25.27956,
    "lat": 54.68726,
    "functionId": 1,
    "msg": "Hello from dispatch"
}
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": "FMT:Hello",
    "handled": 0,
    "date": "2025-01-15 14:30:00"
}
 

Example response (403, No access):


{
    "error": "Not_Allowed"
}
 

Example response (404, Wrong message):


{
    "error": "Wrong_message"
}
 

Request      

POST api/navirequests

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The vehicle object ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

type   string     

The message type: MESSAGE, GETDESTINATION, SETLOCATION, CONTROL, or COMMAND. Must contain only letters and numbers. VΓ€li value ei tohi olla pikem kui 30 tΓ€hemΓ€rki. Example: MESSAGE

lon   number  optional    

Longitude (used for SETLOCATION type). Example: 25.27956

lat   number  optional    

Latitude (used for SETLOCATION type). Example: 54.68726

functionId   integer  optional    

Output function ID (required for CONTROL type). Example: 1

msg   string  optional    

The message text. Example: Hello from dispatch

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"
}
 

Request      

GET api/smsrequests/{start}/{stop}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

POST api/smsrequests

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The vehicle object ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

msg   string  optional    

The SMS message text. Example: Check engine status

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"
}
 

Request      

GET api/smsanswers/{start}/{stop}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

id   string     

The vehicle object ID. Example: ABC123

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).

Example request:
curl --request GET \
    --get "https://testapi.metrotec.ee/api/navianswers/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/navianswers/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/navianswers/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/navianswers/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": "FMT message text"
    }
]
 

Example response (400, Period too long):


{
    "error": "Ordered period should not exceed 7 days"
}
 

Request      

GET api/navianswers/{start}/{stop}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

start   string     

Start date in Y-m-dH:i:s format (no space). Example: 2025-01-1508:00:00

stop   string     

Stop date in Y-m-dH:i:s format (no space). Example: 2025-01-1517:00:00

id   string     

The vehicle object ID. Example: ABC123

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
        }
    ]
}
 

Request      

GET api/poi

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string  optional    

Optional search query for POI name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Office

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"
}
 

Request      

GET api/poi/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the poi. Example: architecto

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
    }
}
 

Request      

POST api/poi

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

type   integer  optional    

POI type (1-9). VΓ€li value peab olema vahemikus 1 kuni 9. Example: 1

lon   number     

Longitude. Example: 24.745369

lat   number     

Latitude. Example: 59.437221

radius   integer  optional    

Radius in meters. Example: 100

name   string  optional    

POI name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Main Office

comment   string  optional    

Comment or MAC address for WiFi routers. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Headquarters

rgAddress   string  optional    

Reverse geocoded address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Narva mnt 5, Tallinn

phone_nr   string  optional    

Phone number. Must match the regex /^\d+$/. Example: 5551234

country_code   string  optional    

Country code. Must match the regex /^+?\d+$/. Example: +372

contact_name   string  optional    

Contact person name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: John Doe

purpose   integer     

POI purpose: 0=POI, 1=Customer, 2=WiFi Router, 3=BLE Beacon. Example: 0

Must be one of:
  • 0
  • 1
  • 2
  • 3
old_id   integer  optional    

Example: 16

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"
}
 

Request      

PUT api/poi/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the poi. Example: architecto

Body Parameters

type   integer  optional    

POI type (1-9). VΓ€li value peab olema vahemikus 1 kuni 9. Example: 1

lon   number  optional    

Longitude. Example: 24.745369

lat   number  optional    

Latitude. Example: 59.437221

radius   integer  optional    

Radius in meters. Example: 100

name   string  optional    

POI name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Main Office

comment   string  optional    

Comment or MAC address for WiFi routers. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Headquarters

rgAddress   string  optional    

Reverse geocoded address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Narva mnt 5, Tallinn

phone_nr   string  optional    

Phone number. Must match the regex /^\d+$/. Example: 5551234

country_code   string  optional    

Country code. Must match the regex /^+?\d+$/. Example: +372

contact_name   string  optional    

Contact person name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: John Doe

purpose   integer     

POI purpose: 0=POI, 1=Customer, 2=WiFi Router, 3=BLE Beacon. Example: 0

Must be one of:
  • 0
  • 1
  • 2
  • 3

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"
}
 

Request      

DELETE api/poi/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the poi. Example: architecto

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"
        }
    ]
}
 

Request      

GET api/poisearch

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string     

Search query for POI name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Office

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"
        }
    ]
}
 

Request      

GET api/poigroups

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

PUT api/poigroups/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the poigroup. Example: architecto

Body Parameters

type_name   string     

Name for the POI group. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Warehouses

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"
        }
    ]
}
 

Request      

GET api/poireport

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

in   integer[]  optional    

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"
}
 

Request      

GET api/poireport/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the poireport. Example: architecto

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"
    }
}
 

Request      

POST api/poireport

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

datetime   string[]  optional    

VΓ€li value peab olema kehtiv kuupΓ€ev.

type   string     

Report type: poi, geo, country, or rtasks. Example: poi

Must be one of:
  • poi
  • geo
  • country
  • rtasks
type_id   integer  optional    

Optional type identifier. Example: 1

group   string     

Group by: vehicle or category. Example: vehicle

Must be one of:
  • vehicle
  • category
group_id   string  optional    

Optional group identifier. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: 123

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"
}
 

Request      

DELETE api/poireport/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the poireport. Example: architecto

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"
}
 

Request      

GET api/routelog

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
obj   string     

The object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

offset   integer  optional    

Number of records to skip. Use -1 to disable pagination. VΓ€li value peab olema vΓ€hemalt -1. Example: -1

limit   integer  optional    

Maximum number of records to return. VΓ€li value peab olema vΓ€hemalt 1. Example: 30

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
 

Request      

GET api/iolog

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
object_id   string     

The object ID to filter by. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

input   integer[]     
fuel   integer  optional    

Include fuel data in splitted km calculation. 1 to include, 0 to exclude. Example: 1

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
 

Request      

GET api/iologdetail

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
object_id   string     

The object ID to filter by. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

input   integer[]     
fuel   integer  optional    

Include fuel data in splitted km calculation. 1 to include, 0 to exclude. Example: 1

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
 

Request      

GET api/ioperiods

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
object_id   string     

The object ID to filter by. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

input   integer[]     

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
            }
        ]
    }
}
 

Request      

GET api/whlog

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
id   string     

The driver or vehicle ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

key   string     

Type of lookup: "driver" or "vehicle". Example: vehicle

Must be one of:
  • driver
  • vehicle

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
 

Request      

GET api/driveperiods

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
object_id   string  optional    

The object ID to filter by. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

driverId   integer  optional    

The driver ID to filter by. Example: 1

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
 

Request      

GET api/workperiods

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
object_id   string  optional    

The object ID to filter by. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

driverID   integer  optional    

The driver ID to filter by. Example: 1

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"
            }
        ]
    }
]
 

Request      

GET api/co2report

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
object_id   string  optional    

The object ID to filter by. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

categoryID   integer  optional    

The vehicle category ID to filter by. Example: 1

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"
}
 

Request      

GET api/routemap

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
object_id   string     

The object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

width   integer     

Image width in pixels (480-900). VΓ€li value peab olema vahemikus 480 kuni 900. Example: 900

height   integer     

Image height in pixels (360-834). VΓ€li value peab olema vahemikus 360 kuni 834. Example: 450

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"
}
 

Request      

GET api/routeloge

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
obj   string     

The object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

type   string  optional    

Type of encoded data to return. One of: fuel, input, temps, powers, rpm, kp, default. Example: default

Must be one of:
  • fuel
  • input
  • temps
  • powers
  • rpm
  • kp
  • default

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"
}
 

Request      

GET api/rawlog/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The object ID. Example: ABC123

Query Parameters

datetime   string[]     
offset   integer  optional    

Number of records to skip. Use -1 to disable pagination. VΓ€li value peab olema vΓ€hemalt -1. Example: 0

limit   integer  optional    

Maximum number of records to return. VΓ€li value peab olema vΓ€hemalt 1. Example: 30

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"
}
 

Request      

GET api/intervalroutelog/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The object ID. Example: ABC123

Query Parameters

datetime   string[]     
interval   integer     

Interval in minutes between data points. VΓ€li value peab olema vΓ€hemalt 1. Example: 5

offset   integer  optional    

Pagination offset. Use -1 for no pagination. VΓ€li value peab olema vΓ€hemalt -1. Example: 0

limit   integer  optional    

Number of records to return. VΓ€li value peab olema vΓ€hemalt 1. Example: 30

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"
}
 

Request      

PUT api/intervalroutelog/{obj}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

obj   string     

The object ID. Example: ABC123

id   integer     

The route log record ID. Example: 456

Body Parameters

t1   number  optional    

Temperature sensor 1 value. Example: 20.5

t2   number  optional    

Temperature sensor 2 value. Example: 21

t3   number  optional    

Temperature sensor 3 value.

t4   number  optional    

Temperature sensor 4 value.

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"
}
 

Request      

DELETE api/rawlog/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The object ID. Example: ABC123

Body Parameters

ids   integer[]     

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": {}
}
 

Request      

GET api/pivot

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
groupBy   string     

Group results by object or category. Example: object

Must be one of:
  • object
  • category
categoryId   integer  optional    

Filter by category ID. Example: 1

fuelType   integer  optional    

Filter by fuel type. Example: 1

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"
}
 

Request      

GET api/pivot/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The object ID. Example: ABC123

Query Parameters

datetime   string[]     

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"
}
 

Request      

GET api/daypivot/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The object ID. Example: ABC123

Query Parameters

date   string     

The date in Y-m-d format. Must be a valid date in the format Y-m-d. Example: 2025-01-15

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"
}
 

Request      

GET api/whdriverpivot/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The driver ID. Example: 123

Query Parameters

datetime   string[]     

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"
}
 

Request      

GET api/whpivot/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The object ID. Example: ABC123

Query Parameters

datetime   string[]     

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"
    }
]
 

Request      

GET api/drives

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
obj   string     

The object ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

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"
    }
]
 

Request      

GET api/speed

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
object_id   string     

The object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

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"
}
 

Request      

GET api/traveldiary

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
object_id   string  optional    

The object ID. Required for non-driver users. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

offset   integer  optional    

Pagination offset. Use -1 for no pagination. VΓ€li value peab olema vΓ€hemalt -1. Example: 0

limit   integer  optional    

Number of records to return. VΓ€li value peab olema vΓ€hemalt 1. Example: 30

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"
}
 

Request      

GET api/traveldiary/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The drive record ID. Example: 123

Query Parameters

routeOnly   boolean  optional    

When true, only route coordinates (lat/lng) are returned without full details. Example: false

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"
}
 

Request      

PUT api/traveldiary/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The drive record ID. Example: 123

Body Parameters

is_private_drive   boolean  optional    

Whether this is a private drive. Example: true

drive_description   string  optional    

Description of the drive. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Business trip to Vilnius

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"
}
 

Request      

PUT api/splitdrives/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The drive record ID. Example: 123

Body Parameters

splitAt   integer     

The route log record ID at which to split the drive. Example: 12345

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"
}
 

Request      

PUT api/joindrives/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The drive record ID. Example: 123

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
    }
]
 

Request      

GET api/fuel

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string     

Date period filter. Example: 2024-01-01 00:00:00,2024-01-31 23:59:59

object_id   string  optional    

Filter by object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

driverid   integer  optional    

Filter by primary driver ID. Example: 1

driverid2   integer  optional    

Filter by secondary driver ID. Example: 2

RevGeo   string  optional    

Filter by address (partial match). Example: Street

offset   integer  optional    

Pagination offset. Use -1 to disable pagination. VΓ€li value peab olema vΓ€hemalt -1. Example: 0

limit   integer  optional    

Number of records to return. VΓ€li value peab olema vΓ€hemalt 1. Example: 30

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"
}
 

Request      

POST api/fuel

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

id1   integer     

The first route log record ID (start point). Example: 100

id2   integer     

The second route log record ID (end point). Example: 200

object_id   string     

The object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

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"
}
 

Request      

PUT api/fuel/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The fuel record ID. Example: 1

Body Parameters

billSum   integer     

The bill sum value. Example: 150

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"
}
 

Request      

DELETE api/fuel/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The fuel record ID. Example: 1

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"
}
 

Request      

GET api/zonetask/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The task ID. Example: 12345

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
 

Request      

GET api/taskspdf

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

nr   integer[]     

Array of task IDs.

Body Parameters

nr   integer[]  optional    

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."
}
 

Request      

GET api/tasksbyperiod

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     

Array of two datetime strings [start, end].

Body Parameters

datetime   string     

Example: architecto

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"
    }
]
 

Request      

GET api/routetasks

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

start_time   string[]     

Date period [start, end].

object_id   string  optional    

Filter by vehicle ID. Example: ABC123

order_ref   string  optional    

Filter by order reference (partial match). Example: architecto

status   string  optional    

integer|integer[] Filter by status or array of statuses. Example: architecto

isDetailed   boolean  optional    

Include file and signature details. Example: true

offset   integer  optional    

Pagination offset (-1 for no pagination). Example: 0

limit   integer  optional    

Maximum records to return. Example: 30

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"
}
 

Request      

GET api/routetasks/{task_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

task_id   integer     

The ID of the task. Example: 16

task   integer     

Task ID. Example: 1

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:

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"
}
 

Request      

PUT api/routetasks/{task_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

task_id   integer     

The ID of the task. Example: 16

task   integer     

Task ID. Example: 1

Body Parameters

object_id   string  optional    

Vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

lat   number  optional    

Destination latitude. Example: 59.437

lon   number  optional    

Destination longitude. Example: 24.7536

start_time   string  optional    

Planned start time. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

stop_time   string  optional    

Planned end time. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 17:00:00

start_lat   number  optional    

Start location latitude. Example: 59.437

start_lon   number  optional    

Start location longitude. Example: 24.7536

start_address   string  optional    

Start address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Warehouse, Tallinn

task_address   string  optional    

Destination address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Customer Site, Tartu

order_ref   string  optional    

Order reference number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: ORD-2025-001

order_details   string  optional    

Order details or notes. Example: Fragile goods - handle with care

task_description   string  optional    

Task description. Example: Deliver package to reception

task_notes   string  optional    

Additional task notes. Example: Call customer before arrival

cancel_reason   string  optional    

Reason for cancellation. Example: Customer not available

status   integer  optional    

Task status (see RouteTasksStatus enum for valid values). Example: 1

Must be one of:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
planned_km   string  optional    

Planned distance in km. Example: 150

is_not_own_vehicle   boolean  optional    

Whether using a third-party vehicle. Example: false

active   boolean  optional    

Whether the task is active. Example: true

group_id   integer  optional    

Task group ID. Example: 1

customer_id   integer  optional    

Customer party ID. The id of an existing record in the parties table. Example: 1

carrier_id   integer  optional    

Carrier party ID. The id of an existing record in the parties table. Example: 2

sender_id   integer  optional    

Sender party ID. The id of an existing record in the parties table. Example: 3

trailer_nr   string  optional    

Trailer registration number. VΓ€li value ei tohi olla pikem kui 50 tΓ€hemΓ€rki. Example: TRL-001

order_id   integer  optional    

The id of an existing record in the orders table. Example: 16

driver_notes   string  optional    

Notes from driver. Example: Delivered successfully

products   object[]  optional    

List of products for this task.

product_id   integer  optional    

Product ID (optional if product_name is provided). The id of an existing record in the products table. Example: 1

product_name   string  optional    

Custom product name (used when no product_id is set). VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Custom product

quantity   number  optional    

Product quantity. VΓ€li value peab olema vΓ€hemalt 0. Example: 10

specific_quantity   string  optional    

Specific quantity (e.g. pails). VΓ€li value ei tohi olla pikem kui 100 tΓ€hemΓ€rki. Example: 5 pails

weight   number  optional    

Product net weight in kg. VΓ€li value peab olema vΓ€hemalt 0. Example: 100

net_weight   integer  optional    

Product net weight in kg. VΓ€li value peab olema vΓ€hemalt 0. Example: 80

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": []
    }
]
 

Request      

GET api/tasks

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

all   boolean  optional    

Show all tasks including completed ones. Example: false

offset   integer  optional    

Pagination offset. Example: 0

limit   integer  optional    

Number of records to return. Example: 30

files   boolean  optional    

Include files with tasks. Example: false

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:

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"
}
 

Request      

POST api/tasks

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

lat   number     

Destination latitude. Example: 59.437

lon   number     

Destination longitude. Example: 24.7536

start_time   string     

Planned start time. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

stop_time   string     

Planned end time. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 17:00:00

start_lat   number  optional    

Start location latitude. Example: 59.437

start_lon   number  optional    

Start location longitude. Example: 24.7536

start_address   string  optional    

Start address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Warehouse, Tallinn

task_address   string  optional    

Destination address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Customer Site, Tartu

order_ref   string  optional    

Order reference number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: ORD-2025-001

order_details   string  optional    

Order details or notes. Example: Fragile goods - handle with care

task_description   string  optional    

Task description. Example: Deliver package to reception

task_notes   string  optional    

Additional task notes. Example: Call customer before arrival

cancel_reason   string  optional    

Reason for cancellation. Example: Customer not available

status   integer  optional    

Task status (see RouteTasksStatus enum for valid values). Example: 1

Must be one of:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
planned_km   string  optional    

Planned distance in km. Example: 150

is_not_own_vehicle   boolean  optional    

Whether using a third-party vehicle. Example: false

active   boolean  optional    

Whether the task is active. Example: true

group_id   integer  optional    

Task group ID. Example: 1

customer_id   integer  optional    

Customer party ID. The id of an existing record in the parties table. Example: 1

carrier_id   integer  optional    

Carrier party ID. The id of an existing record in the parties table. Example: 2

sender_id   integer  optional    

Sender party ID. The id of an existing record in the parties table. Example: 3

trailer_nr   string  optional    

Trailer registration number. VΓ€li value ei tohi olla pikem kui 50 tΓ€hemΓ€rki. Example: TRL-001

order_id   integer  optional    

The id of an existing record in the orders table. Example: 16

driver_notes   string  optional    

Notes from driver. Example: Delivered successfully

products   object[]  optional    

List of products for this task.

product_id   integer  optional    

Product ID (optional if product_name is provided). The id of an existing record in the products table. Example: 1

product_name   string  optional    

Custom product name (used when no product_id is set). VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Custom product

quantity   number  optional    

Product quantity. VΓ€li value peab olema vΓ€hemalt 0. Example: 10

specific_quantity   string  optional    

Specific quantity (e.g. pails). VΓ€li value ei tohi olla pikem kui 100 tΓ€hemΓ€rki. Example: 5 pails

weight   number  optional    

Product net weight in kg. VΓ€li value peab olema vΓ€hemalt 0. Example: 100

net_weight   integer  optional    

Product net weight in kg. VΓ€li value peab olema vΓ€hemalt 0. Example: 80

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"
}
 

Request      

GET api/tasks/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the task. Example: 16

task   integer     

Task ID. Example: 1

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:

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"
}
 

Request      

PUT api/tasks/{id}

PATCH api/tasks/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the task. Example: 16

task   integer     

Task ID. Example: 1

Body Parameters

object_id   string  optional    

Vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

lat   number  optional    

Destination latitude. Example: 59.437

lon   number  optional    

Destination longitude. Example: 24.7536

start_time   string  optional    

Planned start time. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

stop_time   string  optional    

Planned end time. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 17:00:00

start_lat   number  optional    

Start location latitude. Example: 59.437

start_lon   number  optional    

Start location longitude. Example: 24.7536

start_address   string  optional    

Start address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Warehouse, Tallinn

task_address   string  optional    

Destination address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Customer Site, Tartu

order_ref   string  optional    

Order reference number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: ORD-2025-001

order_details   string  optional    

Order details or notes. Example: Fragile goods - handle with care

task_description   string  optional    

Task description. Example: Deliver package to reception

task_notes   string  optional    

Additional task notes. Example: Call customer before arrival

cancel_reason   string  optional    

Reason for cancellation. Example: Customer not available

status   integer  optional    

Task status (see RouteTasksStatus enum for valid values). Example: 1

Must be one of:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
planned_km   string  optional    

Planned distance in km. Example: 150

is_not_own_vehicle   boolean  optional    

Whether using a third-party vehicle. Example: false

active   boolean  optional    

Whether the task is active. Example: true

group_id   integer  optional    

Task group ID. Example: 1

customer_id   integer  optional    

Customer party ID. The id of an existing record in the parties table. Example: 1

carrier_id   integer  optional    

Carrier party ID. The id of an existing record in the parties table. Example: 2

sender_id   integer  optional    

Sender party ID. The id of an existing record in the parties table. Example: 3

trailer_nr   string  optional    

Trailer registration number. VΓ€li value ei tohi olla pikem kui 50 tΓ€hemΓ€rki. Example: TRL-001

order_id   integer  optional    

The id of an existing record in the orders table. Example: 16

driver_notes   string  optional    

Notes from driver. Example: Delivered successfully

products   object[]  optional    

List of products for this task.

product_id   integer  optional    

Product ID (optional if product_name is provided). The id of an existing record in the products table. Example: 1

product_name   string  optional    

Custom product name (used when no product_id is set). VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Custom product

quantity   number  optional    

Product quantity. VΓ€li value peab olema vΓ€hemalt 0. Example: 10

specific_quantity   string  optional    

Specific quantity (e.g. pails). VΓ€li value ei tohi olla pikem kui 100 tΓ€hemΓ€rki. Example: 5 pails

weight   number  optional    

Product net weight in kg. VΓ€li value peab olema vΓ€hemalt 0. Example: 100

net_weight   integer  optional    

Product net weight in kg. VΓ€li value peab olema vΓ€hemalt 0. Example: 80

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"
}
 

Request      

DELETE api/tasks/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the task. Example: 16

task   integer     

Task ID. Example: 1

Get related tasks

requires authentication

Returns tasks related to a specific object type and task ID.

Example request:
curl --request GET \
    --get "https://testapi.metrotec.ee/api/relatedtasks/1/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/relatedtasks/1/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/relatedtasks/1/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/relatedtasks/1/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."
}
 

Request      

GET api/relatedtasks/{type}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

type   integer     

Object type (1=Mixer, 2=Pump, 3=Pumi). Example: 1

id   integer     

Task ID. Example: 12345

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"
}
 

Request      

GET api/routetasksbynr

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

nr   integer[]     

Array of order reference numbers.

Body Parameters

nr   integer[]  optional    

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"
}
 

Request      

GET api/routetasksbywofull/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The work order number. Example: 12345

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"
]
 

Request      

GET api/search/{field}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

field   string     

The field to search. Example: carrier

Query Parameters

query   string     

The search query. Example: trans

Body Parameters

query   string     

VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: b

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"
    }
]
 

Request      

GET api/opentasks

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     

Date period [start, end].

obj   string     

Vehicle object ID. Example: ABC123

Body Parameters

datetime   string     

Example: architecto

obj   string     

Must contain only letters, numbers, dashes and underscores. VΓ€li value peab olema vΓ€hemalt 1 tΓ€hemΓ€rki. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ngzmiy

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
    }
]
 

Request      

GET api/routetasksbygroups/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The group ID. Example: 123

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
}
 

Request      

PUT api/routetasksbygroups/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The group ID. Example: 123

Body Parameters

status   integer  optional    

Task status. Example: 1

active   boolean  optional    

Whether tasks are active. Example: true

object_id   string  optional    

Vehicle ID. Example: ABC123

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"
}
 

Request      

GET api/tasksbywopdf/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The work order number. Example: 12345

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"
    }
]
 

Request      

GET api/orders

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

per_page   integer  optional    

Number of records per page. Example: 30

page   integer  optional    

Page number. Example: 1

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"
}
 

Request      

POST api/orders

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

start_address   string  optional    

Start address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Warehouse, Tallinn

lat   number  optional    

Destination latitude. Example: 59.437

lon   number  optional    

Destination longitude. Example: 24.7536

start_time   string     

Planned start time. Must be a valid date in the format Y-m-d H:i:s. Example: 2026-01-15 08:00:00

stop_time   string     

Planned end time. Must be a valid date in the format Y-m-d H:i:s. Example: 2026-01-15 17:00:00

order_ref   string  optional    

Order reference number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: ORD-2026-001

order_details   string  optional    

Order details or notes. Example: Fragile goods - handle with care

customer_id   integer  optional    

Customer party ID. The id of an existing record in the parties table. Example: 1

task_address   string  optional    

Destination address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Customer Site, Tartu

task_notes   string  optional    

Additional task notes. Example: Call customer before arrival

task_description   string  optional    

Task description. Example: Deliver package to reception

driver_notes   string  optional    

Notes from driver. Example: Delivered successfully

cancel_reason   string  optional    

Reason for cancellation. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Customer not available

status   integer  optional    

Order status (1-9). Example: 1

Must be one of:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
sender_id   integer  optional    

Sender party ID. The id of an existing record in the parties table. Example: 3

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"
}
 

Request      

GET api/orders/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the order. Example: 16

order   integer     

Order ID Example: 1

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"
}
 

Request      

PUT api/orders/{id}

PATCH api/orders/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the order. Example: 16

order   integer     

Order ID Example: 1

Body Parameters

start_address   string  optional    

Start address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Warehouse, Tallinn

lat   number  optional    

Destination latitude. Example: 59.437

lon   number  optional    

Destination longitude. Example: 24.7536

start_time   string  optional    

Planned start time. Must be a valid date in the format Y-m-d H:i:s. Example: 2026-01-15 08:00:00

stop_time   string  optional    

Planned end time. Must be a valid date in the format Y-m-d H:i:s. Example: 2026-01-15 17:00:00

order_ref   string  optional    

Order reference number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: ORD-2026-001

order_details   string  optional    

Order details or notes. Example: Fragile goods - handle with care

customer_id   integer  optional    

Customer party ID. The id of an existing record in the parties table. Example: 1

task_address   string  optional    

Destination address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Customer Site, Tartu

task_notes   string  optional    

Additional task notes. Example: Call customer before arrival

task_description   string  optional    

Task description. Example: Deliver package to reception

driver_notes   string  optional    

Notes from driver. Example: Delivered successfully

cancel_reason   string  optional    

Reason for cancellation. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Customer not available

status   integer  optional    

Order status (1-9). Example: 1

Must be one of:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
sender_id   integer  optional    

Sender party ID. The id of an existing record in the parties table. Example: 3

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"
}
 

Request      

DELETE api/orders/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the order. Example: 16

order   integer     

Order ID Example: 1

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"
    }
]
 

Request      

GET api/parties

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter[archived]   boolean  optional    

Show all parties including inactive Example: true

filter[role]   integer  optional    

Filter by role ID (searches in JSON array) Example: 1

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"
}
 

Request      

POST api/parties

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

company_name   string     

Company name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Example Company

role   integer[]     

Role IDs (1 = Customer, 2 = Sender, 3 = Carrier).

Must be one of:
  • 1
  • 2
  • 3
lang   string     

Default language for communications (est, rus, eng, swe, lat). Example: est

Must be one of:
  • est
  • rus
  • eng
  • swe
  • lat
company_no   string  optional    

Company registration number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: 12345678

company_vat_no   string  optional    

VAT number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: EE123456789

company_country_code   string  optional    

Company phone country code. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: +372

company_phone_nr   string  optional    

Company phone number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: 5555 5555

company_email   string  optional    

Company email address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: info@example.com

company_address   string  optional    

Company legal address. VΓ€li value ei tohi olla pikem kui 500 tΓ€hemΓ€rki. Example: Example Street 1, Tallinn

contact_name   string  optional    

Contact person name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: John Doe

contact_country_code   string  optional    

Contact person phone country code. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: +372

contact_phone_nr   string  optional    

Contact person phone number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: 5555 5556

contact_email   string  optional    

Contact person email. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: john@example.com

active   boolean  optional    

Whether the party is active. Example: true

default   boolean  optional    

Whether this is the default party for the role (only one per role per organization). Example: false

payment_term   string  optional    

VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: b

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"
}
 

Request      

GET api/parties/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the party. Example: 16

party   integer     

Party ID Example: 1

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"
}
 

Request      

PUT api/parties/{id}

PATCH api/parties/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the party. Example: 16

party   integer     

Party ID Example: 1

Body Parameters

company_name   string     

Company name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Example Company

role   integer[]     

Role IDs (1 = Customer, 2 = Sender, 3 = Carrier).

Must be one of:
  • 1
  • 2
  • 3
lang   string     

Default language for communications (est, rus, eng, swe, lat). Example: est

Must be one of:
  • est
  • rus
  • eng
  • swe
  • lat
company_no   string  optional    

Company registration number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: 12345678

company_vat_no   string  optional    

VAT number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: EE123456789

company_country_code   string  optional    

Company phone country code. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: +372

company_phone_nr   string  optional    

Company phone number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: 5555 5555

company_email   string  optional    

Company email address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: info@example.com

company_address   string  optional    

Company legal address. VΓ€li value ei tohi olla pikem kui 500 tΓ€hemΓ€rki. Example: Example Street 1, Tallinn

contact_name   string  optional    

Contact person name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: John Doe

contact_country_code   string  optional    

Contact person phone country code. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: +372

contact_phone_nr   string  optional    

Contact person phone number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: 5555 5556

contact_email   string  optional    

Contact person email. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: john@example.com

active   boolean  optional    

Whether the party is active. Example: true

default   boolean  optional    

Whether this is the default party for the role (only one per role per organization). Example: false

payment_term   string  optional    

VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: b

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
 

Request      

DELETE api/parties/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the party. Example: 16

party   integer     

Party ID Example: 1

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"
    }
]
 

Request      

GET api/products

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

archived   boolean  optional    

Show all products including inactive Example: true

show_type   integer  optional    

Filter by show type (1 = RouteTask, 2 = FishDocument) Example: 1

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"
}
 

Request      

POST api/products

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

value   string     

Product code. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: PROD001

text   string     

Product name. VΓ€li value ei tohi olla pikem kui 150 tΓ€hemΓ€rki. Example: Product Name

external_id   string  optional    

External system identifier. VΓ€li value ei tohi olla pikem kui 30 tΓ€hemΓ€rki. Example: EXT123

comment   string  optional    

Product comment. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Additional product information

active   boolean  optional    

Whether the product is active. Example: true

default   boolean  optional    

Whether this is the default product (only one per organization). Example: false

show_type   integer  optional    

Where the product should be shown (1 = RouteTask, 2 = FishDocument). Example: 1

Must be one of:
  • 1
  • 2

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"
}
 

Request      

GET api/products/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 16

product   integer     

Product ID Example: 1

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"
}
 

Request      

PUT api/products/{id}

PATCH api/products/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 16

product   integer     

Product ID Example: 1

Body Parameters

value   string     

Product code. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: PROD001

text   string     

Product name. VΓ€li value ei tohi olla pikem kui 150 tΓ€hemΓ€rki. Example: Product Name

external_id   string  optional    

External system identifier. VΓ€li value ei tohi olla pikem kui 30 tΓ€hemΓ€rki. Example: EXT123

comment   string  optional    

Product comment. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Additional product information

active   boolean  optional    

Whether the product is active. Example: true

default   boolean  optional    

Whether this is the default product (only one per organization). Example: false

show_type   integer  optional    

Where the product should be shown (1 = RouteTask, 2 = FishDocument). Example: 1

Must be one of:
  • 1
  • 2

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
 

Request      

DELETE api/products/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 16

product   integer     

Product ID Example: 1

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"
    }
]
 

Request      

GET api/ships

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter[archived]   boolean  optional    

Show all ships including inactive Example: true

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"
}
 

Request      

POST api/ships

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

ship_name   string     

Name of the ship. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Aurora

owner_name   string  optional    

Name of the ship owner. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: John Smith

board_number   string  optional    

Ship board number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: EST-1234

captain_name   string  optional    

Name of the ship captain. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Captain Jack

email   string  optional    

Email address(es) for the ship, comma-separated for multiple. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: captain@ship.com, owner@ship.com

license_number   string  optional    

Ship license number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: LIC-2025-001

receiver_id   integer  optional    

ID of the receiver party. The id of an existing record in the parties table. Example: 1

fish_destination   object  optional    

Fish destination with coordinates.

address   string  optional    

VΓ€li value ei tohi olla pikem kui 500 tΓ€hemΓ€rki. Example: Processing Plant A, Harbor 5

lat   number  optional    

Example: 59.437

lon   number  optional    

Example: 24.753

active   boolean  optional    

Whether the ship is active. Example: true

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"
}
 

Request      

GET api/ships/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the ship. Example: 16

ship   integer     

Ship ID Example: 1

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"
}
 

Request      

PUT api/ships/{id}

PATCH api/ships/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the ship. Example: 16

ship   integer     

Ship ID Example: 1

Body Parameters

ship_name   string     

Name of the ship. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Aurora

owner_name   string  optional    

Name of the ship owner. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: John Smith

board_number   string  optional    

Ship board number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: EST-1234

captain_name   string  optional    

Name of the ship captain. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Captain Jack

email   string  optional    

Email address(es) for the ship, comma-separated for multiple. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: captain@ship.com, owner@ship.com

license_number   string  optional    

Ship license number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: LIC-2025-001

receiver_id   integer  optional    

ID of the receiver party. The id of an existing record in the parties table. Example: 1

fish_destination   object  optional    

Fish destination with coordinates.

address   string  optional    

VΓ€li value ei tohi olla pikem kui 500 tΓ€hemΓ€rki. Example: Processing Plant A, Harbor 5

lat   number  optional    

Example: 59.437

lon   number  optional    

Example: 24.753

active   boolean  optional    

Whether the ship is active. Example: true

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
 

Request      

DELETE api/ships/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the ship. Example: 16

ship   integer     

Ship ID Example: 1

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."
}
 

Request      

GET api/fishdocuments/report

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter.start_time   object  optional    
filter   object  optional    
filter.start_time.0   string     

Start date (must be before or equal to end date). VΓ€li value peab olema kehtiv kuupΓ€ev. VΓ€li value peab olema kuupΓ€ev enne vΓ΅i vΓ΅rdne kuupΓ€evaga filter.start_time.1. Example: 2026-01-01

filter.start_time.1   string     

End date (must be after or equal to start date). VΓ€li value peab olema kehtiv kuupΓ€ev. VΓ€li value peab olema kuupΓ€ev pΓ€rast vΓ΅i vΓ΅rdne kuupΓ€evaga filter.start_time.0. Example: 2026-01-31

filter.status   integer  optional    

Filter by status (0=New, 1=InWorks, 2=Sent, 3=Finished). Example: 1

filter.ship_id   integer  optional    

Filter by ship ID. Example: 1

filter.object_id   string  optional    

Filter by vehicle/object ID. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: ABC123

filter.carrier_id   integer  optional    

Filter by carrier ID. Example: 1

filter[start_time]   string[]     

Date range [from, to] in YYYY-MM-DD format

filter[status]   integer  optional    

Filter by status Example: 1

filter[ship_id]   integer  optional    

Filter by ship ID Example: 1

filter[object_id]   string  optional    

Filter by vehicle/object ID Example: ABC123

filter[carrier_id]   integer  optional    

Filter by carrier ID Example: 1

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"
    }
]
 

Request      

GET api/fishdocuments

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

POST api/fishdocuments

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Vehicle/object identifier. VΓ€li value ei tohi olla pikem kui 50 tΓ€hemΓ€rki. Example: ABC123

trailer_nr   string     

Trailer number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: TRL-456

ship_id   integer     

ID of the associated ship. The id of an existing record in the ships table. Example: 1

ship_name   string     

Name of the ship. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Aurora

owner_name   string     

Name of the ship owner. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: John Smith

board_number   string     

Ship board number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: EST-1234

license_number   string     

Fishing license number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: LIC-2026-001

voyage_number   string     

Voyage number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: VOY-2026-005

receiver_id   integer     

ID of the receiver party. The id of an existing record in the parties table. Example: 1

receiver_name   string  optional    

Receiver person name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Jane Doe

destination_address   string     

Destination address. VΓ€li value ei tohi olla pikem kui 500 tΓ€hemΓ€rki. Example: Harbor Street 1, Tallinn

destination_lat   number  optional    

Destination latitude. Example: 59.437

destination_lon   number  optional    

Destination longitude. Example: 24.753

products   object[]     

Array of products with quantities. VΓ€ljal value peab olema vΓ€hemalt 1 elementi.

id   integer  optional    

ID of the existing fish document product record (for updates). Example: 1

product_id   integer     

ID of the fish product type. The id of an existing record in the products table. Example: 1

quantity   integer     

Quantity of fish in kg. VΓ€li value peab olema vΓ€hemalt 0. Example: 500

fishing_area   string  optional    

Fishing area code or name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: IIId

size_category   string  optional    

Size category. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Large

freshness_category   string  optional    

Freshness category. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: A

purpose   string  optional    

Purpose of the product. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Human consumption

count_number   string  optional    

Count number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: 100

category   string  optional    

Fish category. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: A

captain_name   string     

Name of the captain. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Captain Jack

carrier_id   integer     

ID of the carrier party. The id of an existing record in the parties table. Example: 1

unloading_at   string  optional    

Unloading date and time. VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2026-01-15 10:00:00

unloading_location   string  optional    

Unloading location. VΓ€li value ei tohi olla pikem kui 500 tΓ€hemΓ€rki. Example: Dock B

status   integer  optional    

Document status (0=new, 1=in progress, 2=completed). VΓ€li value peab olema vΓ€hemalt 0. VΓ€li value ei tohi olla suurem kui 255. Example: 0

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"
}
 

Request      

GET api/fishdocuments/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the fishdocument. Example: 16

fishDocument   integer     

Fish Document ID Example: 1

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"
}
 

Request      

PUT api/fishdocuments/{id}

PATCH api/fishdocuments/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the fishdocument. Example: 16

fishDocument   integer     

Fish Document ID Example: 1

Body Parameters

object_id   string     

Vehicle/object identifier. VΓ€li value ei tohi olla pikem kui 50 tΓ€hemΓ€rki. Example: ABC123

trailer_nr   string     

Trailer number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: TRL-456

ship_id   integer     

ID of the associated ship. The id of an existing record in the ships table. Example: 1

ship_name   string     

Name of the ship. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Aurora

owner_name   string     

Name of the ship owner. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: John Smith

board_number   string     

Ship board number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: EST-1234

license_number   string     

Fishing license number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: LIC-2026-001

voyage_number   string     

Voyage number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: VOY-2026-005

receiver_id   integer     

ID of the receiver party. The id of an existing record in the parties table. Example: 1

receiver_name   string  optional    

Receiver person name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Jane Doe

destination_address   string     

Destination address. VΓ€li value ei tohi olla pikem kui 500 tΓ€hemΓ€rki. Example: Harbor Street 1, Tallinn

destination_lat   number  optional    

Destination latitude. Example: 59.437

destination_lon   number  optional    

Destination longitude. Example: 24.753

products   object[]     

Array of products with quantities. VΓ€ljal value peab olema vΓ€hemalt 1 elementi.

id   integer  optional    

ID of the existing fish document product record (for updates). Example: 1

product_id   integer     

ID of the fish product type. The id of an existing record in the products table. Example: 1

quantity   integer     

Quantity of fish in kg. VΓ€li value peab olema vΓ€hemalt 0. Example: 500

fishing_area   string  optional    

Fishing area code or name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: IIId

size_category   string  optional    

Size category. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Large

freshness_category   string  optional    

Freshness category. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: A

purpose   string  optional    

Purpose of the product. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Human consumption

count_number   string  optional    

Count number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: 100

category   string  optional    

Fish category. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: A

captain_name   string     

Name of the captain. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Captain Jack

carrier_id   integer     

ID of the carrier party. The id of an existing record in the parties table. Example: 1

unloading_at   string  optional    

Unloading date and time. VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2026-01-15 10:00:00

unloading_location   string  optional    

Unloading location. Example: Dock B

status   integer  optional    

Document status (0=new, 1=in progress, 2=completed). VΓ€li value peab olema vΓ€hemalt 0. VΓ€li value ei tohi olla suurem kui 255. Example: 0

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:

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"
        }
    }
]
 

Request      

GET api/routetasksgroups

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

POST api/routetasksgroups

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Group name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Morning Delivery Route

group_date   string     

Date and time of the group. VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2025-01-20 08:00:00

object_id   string  optional    

Vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

other_object_id   string  optional    

Secondary vehicle object ID (e.g., for Padapigi when no primary vehicle). VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: XYZ789

work_started_at   string  optional    

Timestamp when work started. VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2025-01-20 08:15:00

should_return   boolean  optional    

Whether vehicle should return to origin. Example: true

active   boolean  optional    

Whether the group is active. Example: true

driver_name   string  optional    

Driver name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: John Doe

languages   string  optional    

Languages spoken by driver. VΓ€li value ei tohi olla pikem kui 500 tΓ€hemΓ€rki. Example: Estonian, English, Russian

driver_phone   string  optional    

Driver phone number. VΓ€li value ei tohi olla pikem kui 50 tΓ€hemΓ€rki. Example: +372 5555 5555

trailer_number   string  optional    

Trailer registration number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: TRL-123

carrier_id   integer  optional    

Party ID of the carrier. The id of an existing record in the parties table. Example: 1

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"
}
 

Request      

GET api/routetasksgroups/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the routetasksgroup. Example: 16

taskGroup   integer     

Task Group ID Example: 1

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"
}
 

Request      

PUT api/routetasksgroups/{id}

PATCH api/routetasksgroups/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the routetasksgroup. Example: 16

taskGroup   integer     

Task Group ID Example: 1

Body Parameters

name   string  optional    

Group name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Morning Delivery Route

group_date   string  optional    

Date and time of the group. VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2025-01-20 08:00:00

object_id   string  optional    

Vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

other_object_id   string  optional    

Secondary vehicle object ID (e.g., for Padapigi when no primary vehicle). VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: XYZ789

work_started_at   string  optional    

Timestamp when work started. VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2025-01-20 08:15:00

should_return   boolean  optional    

Whether vehicle should return to origin. Example: true

active   boolean  optional    

Whether the group is active. Example: true

driver_name   string  optional    

Driver name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: John Doe

languages   string  optional    

Languages spoken by driver. VΓ€li value ei tohi olla pikem kui 500 tΓ€hemΓ€rki. Example: Estonian, English, Russian

driver_phone   string  optional    

Driver phone number. VΓ€li value ei tohi olla pikem kui 50 tΓ€hemΓ€rki. Example: +372 5555 5555

trailer_number   string  optional    

Trailer registration number. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: TRL-123

carrier_id   integer  optional    

Party ID of the carrier. The id of an existing record in the parties table. Example: 1

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"
}
 

Request      

DELETE api/routetasksgroups/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the routetasksgroup. Example: 16

taskGroup   integer     

Task Group ID Example: 1

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"
}
 

Request      

POST api/routetasksbygroups/{group_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

group_id   integer     

The ID of the group. Example: 16

group   integer     

Task Group ID. Example: 1

Body Parameters

data   object[]     

Array of tasks to create.

object_id   string  optional    

Vehicle object ID. Example: ABC123

lat   number  optional    

Destination latitude. Example: 59.437

lon   number  optional    

Destination longitude. Example: 24.754

start_time   string  optional    

Task start time. Example: 2025-01-20 08:00:00

stop_time   string  optional    

Task end time. Example: 2025-01-20 17:00:00

order_ref   string  optional    

Order reference. Example: ORD-001

order_details   string  optional    

Order details. Example: Delivery of goods

task_address   string  optional    

Destination address. Example: Tartu, Estonia

start_lat   number  optional    

Starting point latitude. Example: 59.395

start_lon   number  optional    

Starting point longitude. Example: 24.662

start_address   string  optional    

Starting address. Example: Tallinn, Estonia

cancel_reason   string  optional    

Cancellation reason. Example: Customer not available

status   integer  optional    

Task status. VΓ€li value ei tohi olla suurem kui 9. Example: 1

contact_name   string  optional    

Contact person name. Example: John Doe

contact_country_code   string  optional    

Phone country code. Example: +372

contact_phone_nr   string  optional    

Phone number. Example: 5551234

amount   number  optional    

Amount/quantity. Example: 24

weight   integer  optional    

Weight in kg. Example: 15000

vehicle_type   string  optional    

Required vehicle type. Example: Curtainsider

active   boolean  optional    

Whether task is active. Example: true

unloading_time   integer  optional    

Unloading time in minutes. Example: 45

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": []
}
 

Request      

GET api/vsettings/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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
}
 

Request      

POST api/geoalarm

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The vehicle object ID. Example: ABC123

geozoneID   integer     

The geo zone ID to assign as alarm. Example: 5

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"
}
 

Request      

DELETE api/geoalarm/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The geo alarm record ID. Example: 1

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"
}
 

Request      

POST api/outputs

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

id   integer     

The output ID. Example: 1

action   string     

The action to perform (ON or OFF). Example: ON

Must be one of:
  • ON
  • OFF

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"
}
 

Request      

POST api/event

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The vehicle object ID. Example: ABC123

eventType   integer     

The event type (1=Valve, 2=Tow, 3=RepInt, 4=TamperLight, 5=LightSensor). Example: 2

Must be one of:
  • 1
  • 2
  • 3
  • 4
  • 5
description   string     

The event description. For Tow/TamperLight/LightSensor: ON or OFF. For RepInt: interval value. Example: ON

Must be one of:
  • ON
  • OFF

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"
}
 

Request      

DELETE api/event/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The event record ID. Example: 1

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": {}
    }
]
 

Request      

GET api/techcard

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

object_id   string  optional    

Filter by vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

mark   string  optional    

Filter by vehicle mark (partial match). VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Volvo

model   string  optional    

Filter by vehicle model (partial match). Example: FH16

department   string  optional    

Filter by department (partial match). Example: Transport

year   string  optional    

Filter by year of manufacture. Must be a valid date in the format Y. Example: 2023

fuelType   integer  optional    

Filter by fuel type ID. Example: 1

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"
}
 

Request      

GET api/techcard/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

PUT api/techcard/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

Body Parameters

mark   string  optional    

Vehicle mark/brand. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Volvo

model   string  optional    

Vehicle model. Example: FH16

department   string  optional    

Department name. Example: Transport

fuelType   integer  optional    

Fuel type ID. Example: 1

year   string  optional    

Year of manufacture. Must be a valid date in the format Y. Example: 2023

vin   string  optional    

Vehicle identification number. Must match the regex /^[a-zA-Z0-9-_]+$/. Example: YV2A4C2A1PB123456

next_inspection_date   string  optional    

Must be a valid date in the format Y-m-d. Example: 2026-02-26

next_inspection_period   integer  optional    

VΓ€li value peab olema vΓ€hemalt 1. Example: 16

next_maintenance_period   integer  optional    

VΓ€li value peab olema vΓ€hemalt 1. Example: 22

next_maintenance_km   integer  optional    

Example: 16

next_alcolock_period   integer  optional    

VΓ€li value peab olema vΓ€hemalt 1. Example: 22

next_tacho_period   integer  optional    

VΓ€li value peab olema vΓ€hemalt 1. Example: 67

next_inspection_by_date   boolean  optional    

Example: true

pto_purpose   string  optional    

Must match the regex /^[a-zA-Z0-9-_]+$/. Example: 1m0

curb_weight   string  optional    

Must match the regex /^[a-zA-Z0-9-_]+$/. Example: 1m0

norm_spend   number  optional    

Example: 4326.41688

tank_vol   integer  optional    

Fuel tank volume in liters. Example: 400

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
    }
]
 

Request      

GET api/techcardwork

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

object_id   string  optional    

Filter by vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

work_date   string[]  optional    
done_comment   string  optional    

Filter by done comment (partial match). Example: Oil change

work_type_id   integer  optional    

Filter by work type ID. Example: 1

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"
}
 

Request      

GET api/techcardwork/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The work record ID. Example: 1

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": []
}
 

Request      

POST api/techcardwork

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

work_date   string     

The work date in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

book_comment   string  optional    

Booking comment. Example: Scheduled maintenance

work_types   integer[]     

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"
}
 

Request      

PUT api/techcardwork/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The work record ID. Example: 1

Body Parameters

work_date   string  optional    

The work date in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

book_comment   string  optional    

Booking comment. Example: Updated schedule

done_comment   string  optional    

Done/completion comment. Example: Oil changed successfully

rows   object[]  optional    
MotoHrs   integer  optional    

Motor hours value. Example: 2500

Odo   integer  optional    

Odometer value. Example: 150000

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"
}
 

Request      

PUT api/techcardbooking/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The work record ID. Example: 1

Body Parameters

work_date   string  optional    

The work date in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

book_comment   string  optional    

Booking comment. Example: Rescheduled maintenance

rows   object[]  optional    

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"
}
 

Request      

DELETE api/techcardbooking/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The work record ID. Example: 1

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"
}
 

Request      

POST api/maintenanceinit

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

work_date   string     

The work date in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

OdoMoto   integer     

Odometer or motor hours value depending on vehicle settings. Example: 150000

next_mh_diff   integer     

Next motor hours difference for planned maintenance. Example: 500

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
}
 

Request      

GET api/odomotobydate/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

Query Parameters

work_date   string  optional    

The work date in Y-m-d H:i:s format. Defaults to current time if not provided or in the future. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

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
    }
]
 

Request      

GET api/fueltypes

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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
    }
]
 

Request      

GET api/worktypes

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
    }
]
 

Request      

GET api/departments

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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
}
 

Request      

GET api/username

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
    }
]
 

Request      

GET api/user

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

offset   integer  optional    

Pagination offset. Use -1 to disable pagination. Example: 0

limit   integer  optional    

Number of records to return. Example: 30

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"
}
 

Request      

GET api/user/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The owner account OID. Example: owner1

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"
}
 

Request      

PUT api/user/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The owner account OID. Example: owner1

Body Parameters

defLang   string  optional    

Default language code. Example: en

geoQtyAlert   boolean  optional    

Enable geozone quantity alerts. Example: true

poiColorNr   integer  optional    

POI color number. Example: 1

showPoi   boolean  optional    

Show POI on map. Example: true

logistic_emails   string  optional    

Logistic notification emails. Example: logistics@example.com

is_objects_clustered   boolean  optional    

Cluster objects on map. Example: false

address   string  optional    

Primary address. Example: 123 Main St

address1   string  optional    

Example: architecto

address2   string  optional    

Example: architecto

address3   string  optional    

Example: architecto

county   string  optional    

Example: architecto

postal_code   string  optional    

Example: architecto

kmkr   string  optional    

Example: architecto

regNr   string  optional    

Example: architecto

tehnEmail   string  optional    

Technical email address. VΓ€li value peab olema kehtiv e-posti aadress. Example: tech@example.com

phone_nr   string  optional    

Phone number. Example: +37255512345

website   string  optional    

Example: architecto

company_bank_account   string  optional    

Example: architecto

route_task_address   object  optional    

Default route task address object.

route_task_comment   string  optional    

Default route task comment. Example: Default pickup point

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": []
}
 

Request      

GET api/userprofile

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

PUT api/userprofile/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The user OID. Must match the authenticated user. Example: user1

Body Parameters

tehnEmail   string     

Technical email address. VΓ€li value peab olema kehtiv e-posti aadress. Example: tech@example.com

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
    }
]
 

Request      

GET api/subuser

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/subuser/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The sub-user OID. Example: subuser1

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"
}
 

Request      

POST api/subuser

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

access   integer     

Access level ID. Example: 3

allobj   boolean     

Example: false

defLang   string     

Example: architecto

geoQtyAlert   boolean     

Example: true

memo   string  optional    

Example: architecto

oid   string     

Unique user identifier. Must match the regex /^[\w\d_-@.]+$/u. VΓ€li value peab olema vΓ€hemalt 3 tΓ€hemΓ€rki. VΓ€li value ei tohi olla pikem kui 100 tΓ€hemΓ€rki. Example: subuser1

modul   integer[]     
name   string     

Full name of the user. Example: John Doe

object_id   string[]  optional    
password   string  optional    

Password (min 6 chars). Auto-generated if not provided. VΓ€li value peab olema vΓ€hemalt 6 tΓ€hemΓ€rki. Example: secret123

poiAccess   boolean     

Example: true

one_device_login   boolean     

Example: false

poiColorNr   integer     

Example: 16

showPoi   boolean     

Example: false

tehnEmail   string     

Technical email address. VΓ€li value peab olema kehtiv e-posti aadress. Example: john@example.com

key_id   integer  optional    

Example: 16

is_objects_clustered   boolean  optional    

Example: true

company_name   string  optional    

Example: architecto

company_nr   string  optional    

Example: architecto

legal_address   string  optional    

Example: architecto

company_vat_no   string  optional    

Example: architecto

fish_document_number   integer  optional    

Example: 16

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"
}
 

Request      

PUT api/subuser/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The sub-user OID. Example: subuser1

Body Parameters

access   integer     

Access level ID. Example: 3

allobj   boolean     

Example: false

defLang   string     

Example: architecto

geoQtyAlert   boolean     

Example: true

memo   string  optional    

Example: architecto

modul   integer[]     
name   string     

Full name of the user. Example: John Doe

object_id   string[]  optional    
password   string  optional    

New password (min 6 chars). Omit to keep current. VΓ€li value peab olema vΓ€hemalt 6 tΓ€hemΓ€rki. Example: newpass123

poiAccess   boolean     

Example: true

one_device_login   boolean     

Example: true

poiColorNr   integer     

Example: 16

showPoi   boolean     

Example: false

tehnEmail   string     

Technical email address. VΓ€li value peab olema kehtiv e-posti aadress. Example: john@example.com

key_id   integer  optional    

Example: 16

is_objects_clustered   boolean  optional    

Example: false

company_name   string  optional    

Example: architecto

company_nr   string  optional    

Example: architecto

legal_address   string  optional    

Example: architecto

company_vat_no   string  optional    

Example: architecto

fish_document_number   integer  optional    

Example: 16

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"
}
 

Request      

DELETE api/subuser/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The sub-user OID. Example: subuser1

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"
    }
]
 

Request      

GET api/auser

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

offset   integer  optional    

Pagination offset. Use -1 for all records. Example: 0

seclev   integer  optional    

Filter by security level. Example: 500

oid   string  optional    

Filter by OID (partial match). Example: company1

name   string  optional    

Filter by name (partial match). Example: John

access   integer  optional    

Filter by access level. Example: 2

Body Parameters

offset   integer  optional    

Pagination offset. Use -1 to get all records. Example: 0

seclev   integer  optional    

Filter by security level. Example: 500

oid   string  optional    

Filter by OID (partial match). Must match the regex /^[\w\d_-@.]+$/u. VΓ€li value peab olema vΓ€hemalt 3 tΓ€hemΓ€rki. VΓ€li value ei tohi olla pikem kui 100 tΓ€hemΓ€rki. Example: company1

name   string  optional    

Example: architecto

access   integer  optional    

Example: 16

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"
}
 

Request      

GET api/auser/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The owner account OID. Example: owner1

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"
}
 

Request      

POST api/auser

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

Price1   number  optional    

Example: 4326.41688

Price2   number  optional    

Example: 4326.41688

Price3   number  optional    

Example: 4326.41688

Price4   number  optional    

Example: 4326.41688

Price5   number  optional    

Example: 4326.41688

Price6   number  optional    

Example: 4326.41688

Support_id   string  optional    

Example: architecto

access   integer     

Access level ID. Example: 2

address   string  optional    

Example: architecto

address1   string  optional    

Example: architecto

address2   string  optional    

Example: architecto

address3   string  optional    

Example: architecto

county   string  optional    

Example: architecto

postal_code   string  optional    

Example: architecto

credit   integer  optional    

Example: 16

defLang   string     

Example: architecto

email   string  optional    

VΓ€li value peab olema kehtiv e-posti aadress. Example: zbailey@example.net

geoQtyAlert   boolean     

Example: true

kmkr   string  optional    

Example: architecto

lang   string     

Example: architecto

manager   string  optional    

Example: architecto

memo   string  optional    

Example: architecto

oid   string     

Unique owner account identifier. Must match the regex /^[\w\d_-@.]+$/u. VΓ€li value peab olema vΓ€hemalt 3 tΓ€hemΓ€rki. VΓ€li value ei tohi olla pikem kui 100 tΓ€hemΓ€rki. Example: company1

modul   integer[]     
name   string  optional    

Example: architecto

password   string  optional    

VΓ€li value peab olema vΓ€hemalt 6 tΓ€hemΓ€rki. Example: ]|{+-0pBNvYg

refreshInterval   integer     

Example: 16

poiAccess   boolean  optional    

Example: false

poiColorNr   integer     

Example: 16

regNr   string  optional    

Example: architecto

seclev   integer     

Security level. Example: 500

showPoi   boolean     

Example: false

tehnEmail   string     

VΓ€li value peab olema kehtiv e-posti aadress. Example: zbailey@example.net

contact_name   string     

Example: architecto

phone_nr   string     

Example: architecto

timeZone   string  optional    

Example: Asia/Yekaterinburg

ddd_id   integer  optional    

Example: 16

ATR   string  optional    

Example: architecto

CardCode   string  optional    

Example: architecto

ExpiryDate   string  optional    

Must be a valid date in the format Y-m-d. Example: 2026-02-26

routeTaskProfileId   integer  optional    

Example: 16

dateFormat   string  optional    

Must match the regex /(DD|MM|YYYY)(-|\/|.)(DD|MM|YYYY)(-|\/|.)(DD|MM|YYYY)/. Example: DD.YYYY/DD

gdpr   boolean  optional    

Example: true

payment_deadline   integer  optional    

Example: 16

per_len   integer  optional    

Example: 16

e_invoice   boolean  optional    

Example: true

is_objects_clustered   boolean  optional    

Example: true

inv_ref_nr   integer  optional    

Example: 16

country_code   string  optional    

Example: architecto

default_tilelayer   integer  optional    

Example: 16

logistic_emails   string  optional    

Example: architecto

website   string  optional    

Example: architecto

company_bank_account   string  optional    

Example: architecto

route_task_address   string  optional    
route_task_comment   string  optional    

Example: architecto

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"
}
 

Request      

PUT api/auser/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The owner account OID. Example: owner1

Body Parameters

Price1   number  optional    

Example: 4326.41688

Price2   number  optional    

Example: 4326.41688

Price3   number  optional    

Example: 4326.41688

Price4   number  optional    

Example: 4326.41688

Price5   number  optional    

Example: 4326.41688

Price6   number  optional    

Example: 4326.41688

Support_id   string  optional    

Example: architecto

access   integer     

Access level ID. Example: 2

address   string  optional    

Example: architecto

address1   string  optional    

Example: architecto

address2   string  optional    

Example: architecto

address3   string  optional    

Example: architecto

county   string  optional    

Example: architecto

postal_code   string  optional    

Example: architecto

credit   integer  optional    

Example: 16

defLang   string     

Example: architecto

email   string  optional    

VΓ€li value peab olema kehtiv e-posti aadress. Example: zbailey@example.net

geoQtyAlert   boolean     

Example: false

kmkr   string  optional    

Example: architecto

lang   string     

Example: architecto

manager   string  optional    

Example: architecto

memo   string  optional    

Example: architecto

modul   integer[]     
name   string  optional    

Example: architecto

password   string  optional    

VΓ€li value peab olema vΓ€hemalt 6 tΓ€hemΓ€rki. Example: ]|{+-0pBNvYg

refreshInterval   integer     

Example: 16

poiAccess   boolean  optional    

Example: false

poiColorNr   integer     

Example: 16

regNr   string  optional    

Example: architecto

seclev   integer     

Security level. Example: 500

showPoi   boolean     

Example: true

tehnEmail   string     

VΓ€li value peab olema kehtiv e-posti aadress. Example: zbailey@example.net

contact_name   string     

Example: architecto

phone_nr   string     

Example: architecto

timeZone   string  optional    

Example: Asia/Yekaterinburg

ddd_id   integer  optional    

Example: 16

ATR   string  optional    

Example: architecto

CardCode   string  optional    

Example: architecto

ExpiryDate   string  optional    

Must be a valid date in the format Y-m-d. Example: 2026-02-26

routeTaskProfileId   integer  optional    

Example: 16

dateFormat   string  optional    

Must match the regex /(DD|MM|YYYY)(-|\/|.)(DD|MM|YYYY)(-|\/|.)(DD|MM|YYYY)/. Example: DD.YYYY/DD

gdpr   boolean  optional    

Example: true

payment_deadline   integer  optional    

Example: 16

per_len   integer  optional    

Example: 16

e_invoice   boolean  optional    

Example: true

is_objects_clustered   boolean  optional    

Example: true

inv_ref_nr   integer  optional    

Example: 16

country_code   string  optional    

Example: architecto

default_tilelayer   integer  optional    

Example: 16

logistic_emails   string  optional    

Example: architecto

website   string  optional    

Example: architecto

company_bank_account   string  optional    

Example: architecto

route_task_address   string  optional    
poi_profile_id   string  optional    

POI profile type (0=General, 1=ContactInformation, 2=Vkg). Example: 0

Must be one of:
  • 0
  • 1
  • 2
route_task_comment   string  optional    

Example: architecto

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
}
 

Request      

GET api/auth-logs

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   object  optional    
datetime.0   string     

Start date (must be before or equal to end date). VΓ€li value peab olema kehtiv kuupΓ€ev. VΓ€li value peab olema kuupΓ€ev enne vΓ΅i vΓ΅rdne kuupΓ€evaga datetime.1. Example: 2025-01-01

datetime.1   string     

End date (must be after or equal to start date). VΓ€li value peab olema kehtiv kuupΓ€ev. VΓ€li value peab olema kuupΓ€ev pΓ€rast vΓ΅i vΓ΅rdne kuupΓ€evaga datetime.0. Example: 2025-12-31

filter   object  optional    
filter.oid   string  optional    

Filter by username. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: metrotec

filter.user_agent   string  optional    

Filter by user agent. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Mozilla/5.0

filter.ip_address   string  optional    

Filter by IP address. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: 192.168.1.1

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
}
 

Request      

GET api/{user_oid}/auth-logs

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user_oid   string     

Username Example: metrotec

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"
    }
]
 

Request      

GET api/tokens

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user_oid   string     

Username Example: metrotec

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"
    }
]
 

Request      

GET api/{user_oid}/tokens

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user_oid   string     

Example: architecto

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
 

Request      

DELETE api/{user_oid}/tokens/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user_oid   string     

Username Example: metrotec

id   integer     

The ID of the token. Example: 88

token_id   string     

Token ID Example: 90

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"
    }
]
 

Request      

GET api/api-tokens

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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..."
}
 

Request      

POST api/api-tokens

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

oid   string     

The username for token Example: metrotec

token_name   string     

The name or purpose of the token Example: API token

expires_at   date  optional    

Optional expiration date Example: 2026-12-31

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
 

Request      

DELETE api/api-tokens/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the api token. Example: 88

token_id   string     

Token ID Example: 1234

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"
    }
]
 

Request      

GET api/clients

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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
    }
]
 

Request      

GET api/vehfaultstypes

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/vehfaultstypes/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The fault type ID. Example: 1

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
}
 

Request      

POST api/vehfaultstypes

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Fault type name. Example: Engine

descriptions   string[]  optional    
description   string  optional    

Single description text. Example: Engine related faults

ordering   integer     

Sort order (0-100). VΓ€li value peab olema vahemikus 0 kuni 100. Example: 10

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"
}
 

Request      

PUT api/vehfaultstypes/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The fault type ID. Example: 1

Body Parameters

name   string  optional    

Fault type name. Example: Engine

descriptions   string[]  optional    
description   string  optional    

Single description text. Example: Engine related faults

ordering   integer  optional    

Sort order (0-100). VΓ€li value peab olema vahemikus 0 kuni 100. Example: 10

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"
}
 

Request      

DELETE api/vehfaultstypes/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The fault type ID. Example: 1

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"
}
 

Request      

GET api/transferacceptance

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

PUT api/transferacceptance/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The transfer acceptance act ID. Example: 1

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"
    }
]
 

Request      

GET api/vehfaults

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/vehfaults/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The fault record ID. Example: 1

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"
}
 

Request      

POST api/vehfaults

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

Body Parameters

vehicle_faults_type_id   integer     

The fault type ID. Example: 1

descriptions   string  optional    

JSON-encoded descriptions string. Example: ["Oil leak", "Overheating"]

file   file[]  optional    

Must be a file.

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"
}
 

Request      

PUT api/vehfaults/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

URL Parameters

id   integer     

The fault record ID. Example: 1

Body Parameters

is_solved   boolean     

Whether to mark the fault as solved. Example: true

file   file[]  optional    

Must be a file.

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"
}
 

Request      

DELETE api/vehfaults/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The fault record ID. Example: 1

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&registered_at[]=2026-01-31&object_id=ABC123&not_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": []
    }
]
 

Request      

GET api/vehfaultsrep

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

registered_at   string[]  optional    

Date range filter [from, to].

registered_at.0   string  optional    

This field is required when registered_at is present. VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2026-01-01

registered_at.1   string  optional    

This field is required when registered_at is present. VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2026-01-31

object_id   string  optional    

Filter by vehicle object ID. Example: ABC123

not_solved   string  optional    

Filter by solved status (true = only unsolved). Example: true

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&registered_at[]=2026-01-31&object_id=ABC123&not_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": []
    }
]
 

Request      

GET api/vehfaultsrep/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

Query Parameters

registered_at   string[]  optional    

Date range filter [from, to].

registered_at.0   string  optional    

This field is required when registered_at is present. VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2026-01-01

registered_at.1   string  optional    

This field is required when registered_at is present. VΓ€li value peab olema kehtiv kuupΓ€ev. Example: 2026-01-31

object_id   string  optional    

Filter by vehicle object ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

not_solved   string  optional    

Filter unsolved only. Example: true

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"
    }
]
 

Request      

GET api/vehfaultchecks

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/vehfaultchecks/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The check record ID. Example: 1

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": []
}
 

Request      

POST api/vehfaultchecks

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Vehicle object ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

data   string     

JSON-encoded array of check items with fault_id, checked (bool), and comment. Example: [{"fault_id":1,"checked":true,"comment":""},{"fault_id":2,"checked":false,"comment":"Oil leak"}]

file   object  optional    

Files grouped by fault_id. Use file[fault_id][] for multiple files per fault.

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"
}
 

Request      

GET api/vehstatus/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

PUT api/vehstatus/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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
    }
]
 

Request      

GET api/vehstatusreport

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     

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
    }
]
 

Request      

GET api/vehstatusreport/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

Query Parameters

datetime   string[]     

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"
}
 

Request      

GET api/vehstatusrepair/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The repair record ID. Example: 1

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"
}
 

Request      

POST api/vehstatusrepair

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

type_id   integer     

The status type ID. Example: 1

isOwn   boolean  optional    

Whether this is an own repair. Example: false

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"
}
 

Request      

PUT api/vehstatusrepair/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The repair record ID. Example: 1

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"
}
 

Request      

DELETE api/vehstatusrepair/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The repair record ID. Example: 1

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"
    }
]
 

Request      

GET api/vehstatustype

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/vehstatustype/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The status type ID. Example: 1

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"
}
 

Request      

POST api/vehstatustype

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

The status type name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Engine repair

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"
}
 

Request      

PUT api/vehstatustype/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The status type ID. Example: 1

Body Parameters

name   string     

The status type name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Engine repair

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"
}
 

Request      

DELETE api/vehstatustype/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The status type ID. Example: 1

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
    }
]
 

Request      

GET api/objects

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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
    }
]
 

Request      

GET api/objects-query

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string     

Search term (object_id or Serial_Nr). Min 2 chars. Example: ABC123

Body Parameters

q   string     

Must match the regex /^[a-zA-Z0-9_]+$/. VΓ€li value peab olema vΓ€hemalt 2 tΓ€hemΓ€rki. VΓ€li value ei tohi olla pikem kui 50 tΓ€hemΓ€rki. Example: b

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"
}
 

Request      

GET api/objects/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

POST api/objects

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Unique vehicle identifier. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

oid   string     

Organization ID. Must contain only letters and numbers. VΓ€li value ei tohi olla pikem kui 30 tΓ€hemΓ€rki. Example: metrotec

Serial_Nr   string     

Device serial number. Must match the regex /^[0-9_]+$/. VΓ€li value peab olema vΓ€hemalt 3 tΓ€hemΓ€rki. Example: 123456789

GSM_NR   string     

GSM phone number. Must match the regex /^[0-9+]+$/. VΓ€li value peab olema vΓ€hemalt 3 tΓ€hemΓ€rki. Example: +37255555555

Manufacture   integer     

Manufacturer ID. Example: 1

odometer   integer     

Current odometer reading in km. Example: 150000

T1max   integer     

Temperature 1 max threshold. Example: 30

T2max   integer     

Temperature 2 max threshold. Example: 30

odometer_day   string     

Date when odometer was set. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-01 00:00:00

description   string  optional    

Vehicle description. Example: Delivery truck

tank_vol   number  optional    

Fuel tank volume in liters. Example: 200.5

x_coord   number  optional    

Fixed GPS X coordinate (longitude). Example: 24.7536

y_coord   number  optional    

Fixed GPS Y coordinate (latitude). Example: 59.437

is_fixed_gps   boolean  optional    

Whether the vehicle has a fixed GPS position. Example: false

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"
}
 

Request      

PUT api/objects/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

Body Parameters

object_id   string  optional    

Unique vehicle identifier. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

oid   string  optional    

Organization ID. Must contain only letters and numbers. VΓ€li value ei tohi olla pikem kui 30 tΓ€hemΓ€rki. Example: metrotec

Serial_Nr   string  optional    

Device serial number. Must match the regex /^[0-9_]+$/. VΓ€li value peab olema vΓ€hemalt 3 tΓ€hemΓ€rki. Example: 123456789

GSM_NR   string  optional    

GSM phone number. Must match the regex /^[0-9+]+$/. VΓ€li value peab olema vΓ€hemalt 3 tΓ€hemΓ€rki. Example: +37255555555

Manufacture   integer  optional    

Manufacturer ID. Example: 1

odometer   integer  optional    

Current odometer reading in km. Example: 150000

T1max   integer  optional    

Temperature 1 max threshold. Example: 30

T2max   integer  optional    

Temperature 2 max threshold. Example: 30

odometer_day   string  optional    

Date when odometer was set. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-01 00:00:00

description   string  optional    

Vehicle description. Example: Delivery truck

tank_vol   number  optional    

Fuel tank volume in liters. Example: 200.5

x_coord   number  optional    

Fixed GPS X coordinate (longitude). Example: 24.7536

y_coord   number  optional    

Fixed GPS Y coordinate (latitude). Example: 59.437

is_fixed_gps   boolean  optional    

Whether the vehicle has a fixed GPS position. Example: false

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"
}
 

Request      

DELETE api/objects/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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
}
 

Request      

GET api/odometer/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

Query Parameters

d   string     

Date in Y-m-d H:i:s format. Example: 2025-01-15 08:00:00

Body Parameters

d   string     

Must be a valid date in the format Y-m-d H:i:s. Example: 2026-02-26 15:34:38

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"
}
 

Request      

GET api/odomoto/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

GET api/objectsingeo

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

coordinates   string     

JSON-encoded array of polygon coordinate pairs. VΓ€li value peab olema kehtiv JSON string. Example: [[24.7,59.4],[24.8,59.4],[24.8,59.5],[24.7,59.5],[24.7,59.4]]

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."
}
 

Request      

GET api/rfid/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the rfid. Example: architecto

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
    }
]
 

Request      

GET api/vehicles

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/vehicles/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

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"
}
 

Request      

PUT api/vehicles/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

Body Parameters

fuel_card_nr   string  optional    

Fuel card number. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 30 tΓ€hemΓ€rki. Example: FC-12345

categoryID   integer  optional    

Vehicle category ID. Example: 1

btime   integer  optional    

Business time threshold in seconds. Example: 300

next_maintenance_km   integer  optional    

Next maintenance odometer reading in km. Example: 200000

next_inspection_day   string  optional    

Next vehicle inspection date. Must be a valid date in the format Y-m-d. Example: 2025-06-15

next_insurance_day   string  optional    

Next insurance expiration date. Must be a valid date in the format Y-m-d. Example: 2025-12-31

odometer   integer  optional    

Current odometer reading in km. Example: 150000

idle_rpm   integer  optional    

Idle RPM threshold. Example: 800

min_rpm   integer  optional    

Minimum RPM threshold. Example: 500

odometer_day   string  optional    

Date when odometer was set. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

isBookable   boolean  optional    

Whether the vehicle can be booked. Example: true

has_route_tasks   boolean  optional    

Whether the vehicle has route tasks enabled. Example: true

calcByM   boolean  optional    

Calculate by motohours instead of odometer. Example: false

alias   string  optional    

Vehicle display name alias. Example: Truck 1

kontraktNr   integer  optional    

Leasing contract number. Example: 12345

model   string  optional    

Vehicle model name. Must contain only letters, numbers, dashes and underscores. Example: Volvo-FH16

period   integer  optional    

Leasing period in months. Example: 36

leasing_startDate   string  optional    

Leasing start date. Must be a valid date in the format Y-m-d. Example: 2024-01-01

leasing_endDate   string  optional    

Leasing end date. Must be a valid date in the format Y-m-d. Example: 2027-01-01

res_value   number  optional    

Residual value. Example: 15000.5

p1   string  optional    

Custom parameter 1. Example: Value 1

p2   string  optional    

Custom parameter 2. Example: Value 2

p3   string  optional    

Custom parameter 3. Example: Value 3

p4   string  optional    

Custom parameter 4. Example: Value 4

p5   string  optional    

Custom parameter 5. Example: Value 5

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"
}
 

Request      

PUT api/alias/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The vehicle object ID. Example: ABC123

Body Parameters

alias   string  optional    

Vehicle display name alias. Pass null to remove. Example: Truck 1

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"
    }
]
 

Request      

GET api/categories

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/categories/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The category ID. Example: 1

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"
}
 

Request      

POST api/categories

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Category name. Example: Trucks

calcByKm   boolean     

Calculate by kilometers. Example: true

calcByM   boolean     

Calculate by motohours. Example: false

shift   boolean     

Shift mode enabled. Example: false

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"
}
 

Request      

PUT api/categories/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The category ID. Example: 1

Body Parameters

name   string  optional    

Category name. Example: Trucks

calcByKm   boolean  optional    

Calculate by kilometers. Example: true

calcByM   boolean  optional    

Calculate by motohours. Example: false

shift   boolean  optional    

Shift mode enabled. Example: false

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"
}
 

Request      

DELETE api/categories/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The category ID. Example: 1

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"
            }
        }
    ]
}
 

Request      

GET api/trailers

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

archived   boolean  optional    

Include archived (inactive) trailers. Example: true

filter[object_id]   string  optional    

Filter by vehicle object ID. Example: ABC123

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
    }
}
 

Request      

POST api/trailers

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The vehicle object ID to attach trailer to. Example: ABC123

trailer_object_id   string  optional    

The trailer's object ID. Example: TRL001

trailer_nr   string  optional    

The trailer registration number. Example: 123ABC

mark   string  optional    

The trailer manufacturer/brand. Example: Schmitz

trailer_model   string  optional    

The trailer model. Example: Cargobull

active   boolean  optional    

Whether the trailer is active. Example: true

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"
}
 

Request      

GET api/trailers/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the trailer. Example: 1

trailer   integer     

The trailer ID. Example: 1

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"
}
 

Request      

PUT api/trailers/{id}

PATCH api/trailers/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the trailer. Example: 1

trailer   integer     

The trailer ID. Example: 1

Body Parameters

object_id   string     

The vehicle object ID. Example: ABC123

trailer_object_id   string  optional    

The trailer's object ID. Example: TRL001

trailer_nr   string  optional    

The trailer registration number. Example: 123ABC

mark   string  optional    

The trailer manufacturer/brand. Example: Schmitz

trailer_model   string  optional    

The trailer model. Example: Cargobull

active   boolean  optional    

Whether the trailer is active. Example: true

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"
}
 

Request      

DELETE api/trailers/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the trailer. Example: 1

trailer   integer     

The trailer ID. Example: 1

Devices

Device management

GET api/navilist/{id}

Example request:
curl --request GET \
    --get "https://testapi.metrotec.ee/api/navilist/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://testapi.metrotec.ee/api/navilist/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/navilist/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/navilist/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."
}
 

Request      

GET api/navilist/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the navilist. Example: architecto

POST api/navireq

Example request:
curl --request POST \
    "https://testapi.metrotec.ee/api/navireq" \
    --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/navireq"
);

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/navireq';
$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/navireq'
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()

Request      

POST api/navireq

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

content   string     

Message content to send. Example: Please return to base

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."
}
 

Request      

GET api/smslist/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the smslist. Example: architecto

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()

Request      

POST api/smsreq

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Vehicle object ID. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

content   string     

Message content to send. Example: Please return to base

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"
}
 

Request      

GET api/vehicles-rudus/{typeId}/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

typeId   integer     

The Rudus object type ID (1=Mixer, 2=Pump, etc). Example: 1

id   integer     

The route task ID. Example: 123

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."
}
 

Request      

GET api/wbtypes

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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."
}
 

Request      

GET api/wbtypes/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the wbtype. Example: architecto

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()

Request      

POST api/wbtypes

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

The waybill type name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Standard

hasRides   boolean  optional    

Whether this type tracks rides. Example: true

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()

Request      

PUT api/wbtypes/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the wbtype. Example: architecto

Body Parameters

name   string  optional    

The waybill type name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Standard

hasRides   boolean  optional    

Whether this type tracks rides. Example: true

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()

Request      

DELETE api/wbtypes/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the wbtype. Example: architecto

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."
}
 

Request      

GET api/wbtypeobj

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/wbtypeobj/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The assignment ID. Example: 1

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"
}
 

Request      

POST api/wbtypeobj

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The vehicle/object ID. Must contain only letters and numbers. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

typeId   integer     

The waybill type ID. Example: 1

project_id   integer  optional    

The waybill project ID. Example: 1

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"
}
 

Request      

PUT api/wbtypeobj/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The assignment ID. Example: 1

Body Parameters

object_id   string     

The vehicle/object ID. Must contain only letters and numbers. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

typeId   integer     

The waybill type ID. Example: 1

project_id   integer  optional    

The waybill project ID. Example: 1

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"
}
 

Request      

DELETE api/wbtypeobj/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The assignment ID. Example: 1

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
            }
        ]
    }
]
 

Request      

GET api/wbjobs

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/wbjobs/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The waybill job ID. Example: 1

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
        }
    ]
}
 

Request      

POST api/wbjobs

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

The job name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Delivery

external_id   string  optional    

External system identifier. Example: EXT-001

trackAddress   integer  optional    

Whether to track addresses (0 or 1). Example: 1

Must be one of:
  • 0
  • 1
type_data   object[]     

Array of type assignments.

typeId   integer     

Example: 16

external_id   string  optional    

Example: architecto

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"
}
 

Request      

PUT api/wbjobs/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The waybill job ID. Example: 1

Body Parameters

name   string     

The job name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Delivery

external_id   string  optional    

External system identifier. Example: EXT-001

trackAddress   integer  optional    

Whether to track addresses (0 or 1). Example: 1

Must be one of:
  • 0
  • 1
type_data   object[]     

Array of type assignments.

typeId   integer     

Example: 16

external_id   string  optional    

Example: architecto

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"
}
 

Request      

DELETE api/wbjobs/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The waybill job ID. Example: 1

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."
}
 

Request      

GET api/wbprojects

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/wbprojects/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The waybill project ID. Example: 1

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()

Request      

POST api/wbprojects

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

The project name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Construction Site A

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"
}
 

Request      

PUT api/wbprojects/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The waybill project ID. Example: 1

Body Parameters

name   string     

The project name. VΓ€li value ei tohi olla pikem kui 255 tΓ€hemΓ€rki. Example: Construction Site A

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"
}
 

Request      

DELETE api/wbprojects/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The waybill project ID. Example: 1

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"
    }
]
 

Request      

GET api/openedwaybills

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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
    }
]
 

Request      

GET api/rides

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     

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"
    }
]
 

Request      

GET api/wbreport

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   string[]     
object_id   string  optional    

Filter by object ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

driver_id   string  optional    

Filter by driver ID. Use false for records without a driver. Example: 5

typeId   integer  optional    

Filter by waybill type ID. Example: 1

department   string  optional    

Filter by department name. Example: Logistics

all   string  optional    

When true, returns detailed waybill records instead of aggregated data. Example: true

jobs   string  optional    

Filter by job presence: true = only with jobs, false = only without jobs. Example: true

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"
}
 

Request      

GET api/wbreportdetails/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The driver-vehicle record ID. Example: 123

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"
}
 

Request      

POST api/waybills/edit

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

drv_id   integer     

The driver-vehicle session ID. Example: 10

jobId   integer     

The waybill job ID. Example: 1

driverId   integer  optional    

The driver ID. Example: 5

object_id   string     

The vehicle/object ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

route   string  optional    

The route description. Example: Vilnius - Kaunas

km   number  optional    

Distance in kilometers. Example: 102.5

project_id   integer  optional    

The waybill project ID. Example: 1

start   string     

Start time in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

stop   string     

Stop time in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 17:00:00

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"
}
 

Request      

PUT api/waybills/edit/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The waybill ID. Example: 1

Body Parameters

jobId   integer  optional    

The waybill job ID. Example: 1

start   string  optional    

Start time in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 08:00:00

stop   string  optional    

Stop time in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s. Example: 2025-01-15 17:00:00

km   number  optional    

Distance in kilometers. Example: 102.5

project_id   integer  optional    

The waybill project ID. Example: 1

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):


[]
 

Request      

GET api/waybills

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

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"
}
 

Request      

GET api/waybills/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The waybill ID. Example: 1

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"
}
 

Request      

POST api/waybills

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

The vehicle/object ID. Must contain only letters, numbers, dashes and underscores. VΓ€li value ei tohi olla pikem kui 10 tΓ€hemΓ€rki. Example: ABC123

jobId   integer     

The waybill job ID. Example: 1

taskId   integer  optional    

The route task ID. Example: 10

comment   string  optional    

A comment for the waybill. Example: Urgent delivery

startAddress   string  optional    

The starting address. Example: Vilnius, Main St. 1

route   string  optional    

The route description. Example: Vilnius - Kaunas

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"
}
 

Request      

PUT api/waybills/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The waybill ID. Example: 1

Body Parameters

comment   string  optional    

A comment for the waybill. Example: Updated delivery note

startAddress   string  optional    

The starting address. Example: Vilnius, Main St. 1

stopAddress   string  optional    

The ending address. Example: Kaunas, Oak St. 5

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"
}
 

Request      

DELETE api/waybills/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The waybill ID. Example: 1