Download OpenAPI specification:
Metrotec API is a RESTful web service that allows developers to programmatically interact with Metrotec data over HTTPS using JSON. The base URL for the Metrotec API is https://api.metrotec.ee/public/ If you have questions about using the API or need to report a bug, please email us at info@metrotec.ee.
Set a clearly identifiable User-Agent HTTP header that uniquely identifies your company and integration software. Please use only printable ASCII characters. Examples of good practice (substitute your own names):
User-Agent: MyDomain.com
User-Agent: MyApplication
User-Agent: MyApplication/1.0.0
User-Agent: MyApplication/1.0.0 (api-requests/1.0.0)
All API requests must specify the version of the API that your integration was built with.
Add this version number to the Accept HTTP header as an additional argument.
Replace X.Y.Z
in the following example with the most recent version number shown at the top of the documentation page:
GET /routelog/ HTTP/1.1
Host: api.metrotec.ee
Accept: application/json; version=X.Y.Z
User-Agent: MyApplication/1.0.0
You can use the browsable API without specifying a version for development purposes, but all production system requests must include the version in the Accept header.
The API responds with names and labels in English by default. To receive localized responses, indicate your preferred language using the appropriate HTTP header.
Timestamps in the API are in UTC by default. Timestamps displayed in the web and mobile apps use the account timezone, which typically differs from UTC.
Metrotec uses conventional HTTP response codes to indicate the success or failure of API requests: - 2xx range: Success - 4xx range: Error based on provided information - 5xx range: Error with Metrotec's servers
Status code | Status text | Description |
---|---|---|
200 | OK | Request succeeded |
400 | Bad Request | Often missing a required parameter |
401 | Unauthorized | No valid auth token provided |
404 | Resource not found | Parameters were valid but request not found |
50* | Server Errors | Something went wrong on our end |
Use your Metrotec username and password for API authentication. See the "Authorization" section for information on generating an API token.
To authenticate, include the token in the Authorization HTTP header:
Authorization: Bearer [token]
username required | string User account username |
password required | string User account password |
{- "username": "string",
- "password": "string"
}
{- "jwt": "string",
- "expires": 0
}
[- {
- "id": 0,
- "oid": "string",
- "object_id": "string",
- "lon": 0.1,
- "lat": 0.1,
- "start_lat": 0.1,
- "start_lon": 0.1,
- "start_address": "string",
- "start_time": "2019-08-24T14:15:22Z",
- "stop_time": "2019-08-24T14:15:22Z",
- "order_ref": "string",
- "order_details": "string",
- "task_address": "string",
- "task_description": "string",
- "cancel_reason": "string",
- "status": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "work_started_at": "2019-08-24T14:15:22Z",
- "work_finished_at": "2019-08-24T14:15:22Z",
- "sender": "string",
- "invoice_nr": "string",
- "user_km": 0,
- "distance": "string",
- "geozone_entered_at": "2019-08-24T14:15:22Z",
- "geozone_left_at": "2019-08-24T14:15:22Z",
- "closeType": 0,
- "planned_km": 0,
- "ut": 0,
- "alias": "string",
- "concrete_type": "string",
- "concrete_strength_class": "string",
- "environmental_class": "string",
- "dmax": "string",
- "consistency_class": "string",
- "cement_type": "string",
- "additives": "string",
- "concrete_extra_info": "string",
- "concrete_extra_info2": "string",
- "preparation_time": "2019-08-24T14:15:22Z",
- "volume": 0,
- "unload_method": "string",
- "driving_instructions": "string",
- "client_id": 0,
- "offer_number": "string",
- "ordered_volume": 0,
- "delivered_volume": 0,
- "pumped_volume": 0,
- "work_order_number": "string",
- "notes": "string",
- "operator_name": "string",
- "pumper_name": "string",
- "pump_type": "string",
- "client_emails": "string",
- "last_cargo": 0
}
]
object_id required | string Vehicle registration number |
start_lat | number <float> Starting point latitude |
start_lon | number <float> Starting point longitude |
start_address | string Starting point address |
lat required | number <float> Destination latitude |
lon required | number <float> Destination longitude |
start_time required | string <date-time> Task start time (UTC, YYYY-MM-DD HH:MM:SS) |
stop_time required | string <date-time> Task expected stop time (UTC, YYYY-MM-DD HH:MM:SS) |
order_ref required | string Reference number from your system (must be unique) |
order_details | string Order details, client name, etc. |
task_address | string Task location address |
task_description | string Task description |
planned_km | number Planned distance between start and stop points in kilometers |
concrete_type | string <= 255 characters Concrete type specification (customer specific) |
concrete_strength_class | string <= 30 characters Concrete strength class (customer specific) |
environmental_class | string <= 50 characters Environmental class specification (customer specific) |
dmax | string <= 50 characters Maximum aggregate size (customer specific) |
consistency_class | string <= 50 characters Concrete consistency class (customer specific) |
cement_type | string <= 50 characters Type of cement used (customer specific) |
additives | string <= 255 characters Additives used in concrete (customer specific) |
concrete_extra_info | string <= 255 characters Additional concrete specifications (customer specific) |
concrete_extra_info2 | string <= 255 characters Secondary additional concrete specifications (customer specific) |
preparation_time | string <date-time> Concrete preparation time (YYYY-MM-DD HH:MM:SS) (customer specific) |
volume | number <float> Volume of concrete (customer specific) |
unload_method | string <= 255 characters Method used to unload concrete (customer specific) |
driving_instructions | string <= 255 characters Special instructions for drivers (customer specific) |
client_id | integer Client identifier (customer specific) |
offer_number | string <= 50 characters Offer reference number (customer specific) |
ordered_volume | number <float> Volume of concrete ordered (customer specific) |
delivered_volume | number <float> Volume of concrete delivered (customer specific) |
pumped_volume | number <float> Volume of concrete pumped (customer specific) |
work_order_number | string <= 50 characters Work order reference number (customer specific) |
notes | string <= 255 characters Additional notes |
operator_name | string <= 100 characters Name of the operator |
pumper_name | string <= 100 characters Name of the pumping contractor/operator (customer specific) |
pump_type | string <= 255 characters Type of pump used (customer specific) |
client_emails | string Multiple client email addresses (comma-separated) (customer specific) |
last_cargo | integer or null Is last cargo in order or not (1 - is, 0 - is not) (customer specific) |
{- "object_id": "string",
- "start_lat": 0.1,
- "start_lon": 0.1,
- "start_address": "string",
- "lat": 0.1,
- "lon": 0.1,
- "start_time": "2019-08-24T14:15:22Z",
- "stop_time": "2019-08-24T14:15:22Z",
- "order_ref": "string",
- "order_details": "string",
- "task_address": "string",
- "task_description": "string",
- "planned_km": 0,
- "concrete_type": "string",
- "concrete_strength_class": "string",
- "environmental_class": "string",
- "dmax": "string",
- "consistency_class": "string",
- "cement_type": "string",
- "additives": "string",
- "concrete_extra_info": "string",
- "concrete_extra_info2": "string",
- "preparation_time": "2019-08-24T14:15:22Z",
- "volume": 0.1,
- "unload_method": "string",
- "driving_instructions": "string",
- "client_id": 0,
- "offer_number": "string",
- "ordered_volume": 0.1,
- "delivered_volume": 0.1,
- "pumped_volume": 0.1,
- "work_order_number": "string",
- "notes": "string",
- "operator_name": "string",
- "pumper_name": "string",
- "pump_type": "string",
- "client_emails": "string",
- "last_cargo": 0
}
{- "id": 0,
- "oid": "string",
- "object_id": "string",
- "lon": 0.1,
- "lat": 0.1,
- "start_lat": 0.1,
- "start_lon": 0.1,
- "start_address": "string",
- "start_time": "2019-08-24T14:15:22Z",
- "stop_time": "2019-08-24T14:15:22Z",
- "order_ref": "string",
- "order_details": "string",
- "task_address": "string",
- "task_description": "string",
- "cancel_reason": "string",
- "status": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "work_started_at": "2019-08-24T14:15:22Z",
- "work_finished_at": "2019-08-24T14:15:22Z",
- "sender": "string",
- "invoice_nr": "string",
- "user_km": 0,
- "distance": "string",
- "geozone_entered_at": "2019-08-24T14:15:22Z",
- "geozone_left_at": "2019-08-24T14:15:22Z",
- "closeType": 0,
- "planned_km": 0,
- "ut": 0,
- "alias": "string",
- "concrete_type": "string",
- "concrete_strength_class": "string",
- "environmental_class": "string",
- "dmax": "string",
- "consistency_class": "string",
- "cement_type": "string",
- "additives": "string",
- "concrete_extra_info": "string",
- "concrete_extra_info2": "string",
- "preparation_time": "2019-08-24T14:15:22Z",
- "volume": 0,
- "unload_method": "string",
- "driving_instructions": "string",
- "client_id": 0,
- "offer_number": "string",
- "ordered_volume": 0,
- "delivered_volume": 0,
- "pumped_volume": 0,
- "work_order_number": "string",
- "notes": "string",
- "operator_name": "string",
- "pumper_name": "string",
- "pump_type": "string",
- "client_emails": "string",
- "last_cargo": 0
}
id required | integer Task ID |
object_id | string Vehicle registration number |
start_lat | number <float> Starting point latitude |
start_lon | number <float> Starting point longitude |
start_address | string Starting point address |
lat | number <float> Destination latitude |
lon | number <float> Destination longitude |
start_time | string <date-time> Task start time (UTC, YYYY-MM-DD HH:MM:SS) |
stop_time | string <date-time> Task expected stop time (UTC, YYYY-MM-DD HH:MM:SS) |
order_ref | string Reference number from your system |
order_details | string Order details, client name, etc. |
task_address | string Task location address |
task_description | string Task description |
status | integer Enum: 1 2 3 4 5 Task status (1=Created, 2=In progress, 3=Completed, 4=Rejected, 5=Cancelled) |
planned_km | number Planned distance between start and stop points in kilometers |
concrete_type | string <= 255 characters Concrete type specification (customer specific) |
concrete_strength_class | string <= 30 characters Concrete strength class (customer specific) |
environmental_class | string <= 50 characters Environmental class specification (customer specific) |
dmax | string <= 50 characters Maximum aggregate size (customer specific) |
consistency_class | string <= 50 characters Concrete consistency class (customer specific) |
cement_type | string <= 50 characters Type of cement used (customer specific) |
additives | string <= 255 characters Additives used in concrete (customer specific) |
concrete_extra_info | string <= 255 characters Additional concrete specifications (customer specific) |
concrete_extra_info2 | string <= 255 characters Secondary additional concrete specifications (customer specific) |
preparation_time | string <date-time> Concrete preparation time (YYYY-MM-DD HH:MM:SS) (customer specific) |
volume | number <float> Volume of concrete (customer specific) |
unload_method | string <= 255 characters Method used to unload concrete (customer specific) |
driving_instructions | string <= 255 characters Special instructions for drivers (customer specific) |
client_id | integer Client identifier |
offer_number | string <= 50 characters Offer reference number (customer specific) |
ordered_volume | number <float> Volume of concrete ordered (customer specific) |
delivered_volume | number <float> Volume of concrete delivered (customer specific) |
pumped_volume | number <float> Volume of concrete pumped (customer specific) |
work_order_number | string <= 50 characters Work order reference number (customer specific) |
notes | string <= 255 characters Additional notes |
operator_name | string <= 100 characters Name of the operator (customer specific) |
pumper_name | string <= 100 characters Name of the pumping contractor/operator (customer specific) |
pump_type | string <= 255 characters Type of pump used (customer specific) |
last_cargo | integer or null Is last cargo in order or not (1 - is, 0 - is not) (customer specific) |
{- "object_id": "string",
- "start_lat": 0.1,
- "start_lon": 0.1,
- "start_address": "string",
- "lat": 0.1,
- "lon": 0.1,
- "start_time": "2019-08-24T14:15:22Z",
- "stop_time": "2019-08-24T14:15:22Z",
- "order_ref": "string",
- "order_details": "string",
- "task_address": "string",
- "task_description": "string",
- "status": 1,
- "planned_km": 0,
- "concrete_type": "string",
- "concrete_strength_class": "string",
- "environmental_class": "string",
- "dmax": "string",
- "consistency_class": "string",
- "cement_type": "string",
- "additives": "string",
- "concrete_extra_info": "string",
- "concrete_extra_info2": "string",
- "preparation_time": "2019-08-24T14:15:22Z",
- "volume": 0.1,
- "unload_method": "string",
- "driving_instructions": "string",
- "client_id": 0,
- "offer_number": "string",
- "ordered_volume": 0.1,
- "delivered_volume": 0.1,
- "pumped_volume": 0.1,
- "work_order_number": "string",
- "notes": "string",
- "operator_name": "string",
- "pumper_name": "string",
- "pump_type": "string",
- "last_cargo": 0
}
[- {
- "ID": 0,
- "objectID": "string",
- "Xpos": 0.1,
- "Ypos": 0.1,
- "Counter1": 0,
- "Counter2": 0,
- "GMTime": "2019-08-24T14:15:22Z",
- "Speed": 0,
- "Heading": "string",
- "Input": 0,
- "LastCommunicationLocalTime": "2019-08-24T14:15:22Z",
- "Content": "string",
- "Power": 0.1,
- "BatLevel": 0,
- "NoGPSFix": "string",
- "t1": 0,
- "t2": 0,
- "t3": 0,
- "t4": 0
}
]
{- "ID": 0,
- "objectID": "string",
- "Xpos": 0.1,
- "Ypos": 0.1,
- "Counter1": 0,
- "Counter2": 0,
- "GMTime": "2019-08-24T14:15:22Z",
- "Speed": 0,
- "Heading": "string",
- "Input": 0,
- "LastCommunicationLocalTime": "2019-08-24T14:15:22Z",
- "Content": "string",
- "Power": 0.1,
- "BatLevel": 0,
- "NoGPSFix": "string",
- "t1": 0,
- "t2": 0,
- "t3": 0,
- "t4": 0
}
Returns a list of vehicles located within a specified geographic polygon
coordinates required | string Examples: coordinates=[[24.868293,59.318745], [24.871149,59.318745], [24.871149,59.320103], [24.868293,59.320103], [24.868293,59.318745]] Array of points [longitude, latitude] that form a polygon. Must be a correct polygon with at least 4 points where the first point equals the last point. |
[- "000AAA"
]
period_start required | string <date-time> Examples: 2017-10-2400:00:00 Start date in format YYYY-MM-DDHH:MM:SS |
period_stop required | string <date-time> Examples: 2017-10-3123:59:59 End date in format YYYY-MM-DDHH:MM:SS |
vehicle_id required | string Vehicle ID |
[- {
- "ID": 53611736,
- "objectID": "000AAA",
- "startTime": "2025-02-14 06:13:24",
- "previousStopTime": "2025-02-13 17:17:59",
- "stopTime": "2025-02-14 06:34:30",
- "stopEnd": "2025-02-14 08:04:12",
- "routeLengthKM": 14.92,
- "drivingTimeSeconds": 1266,
- "pauseTimeSeconds": 5382,
- "averageSpeed": 35.91,
- "maxSpeed": 76,
- "AddressAtStartingPoint": "EE, Harju maakond, Kiili vald, Kiili küla, Tamme 1",
- "AddressAtEndPoint": "EE, Harju maakond, Tallinn, Nõmme linnaosa, Valdeku 168",
- "status": "0"
}
]
period_start required | string <date-time> Examples: 2017-10-2400:00:00 Start date in format YYYY-MM-DDHH:MM:SS |
period_stop required | string <date-time> Examples: 2017-10-3123:59:59 End date in format YYYY-MM-DDHH:MM:SS |
vehicle_id required | string Vehicle ID |
[- {
- "ID": 129925446,
- "objectID": "000AAA",
- "startTime": "2025-02-14 06:13:24",
- "stopTime": "2025-02-14 06:18:26",
- "stopEnd": "2025-02-14 06:21:24",
- "runningTime": "00:05:02",
- "input": 7,
- "status": 0,
- "distance": 0,
- "fuel": -2,
- "required": null
}
]
period_start required | string <date-time> Examples: 2017-10-2400:00:00 Start date in format YYYY-MM-DDHH:MM:SS |
period_stop required | string <date-time> Examples: 2017-10-3123:59:59 End date in format YYYY-MM-DDHH:MM:SS |
vehicle_id required | string Vehicle ID |
[- {
- "ID": 3434188,
- "objectID": "000AAA",
- "startTime": "2025-02-18 07:53:40",
- "stopTime": "2025-02-18 07:54:23",
- "maxTime": "2025-02-18 07:54:23",
- "fuelBeforeL": 8,
- "fuelAfterL": 54,
- "routeLengthKM": 379.32,
- "fuelAddress": "EE, Harju maakond, Tallinn, Mustamäe linnaosa, A. H. Tammsaare tee 96a",
- "required": null
}
]
start_from required | string <date-time> Examples: 2017-10-3121:45:57 Start date in format YYYY-MM-DDHH:MM:SS |
vehicle_id required | string Vehicle ID |
[- {
- "GMTime": "2025-02-17 23:54:54",
- "fuel": 10,
- "lat": 59.3196,
- "lon": 24.8709,
- "input": 0,
- "t1": 0,
- "t2": 0,
- "t3": 0,
- "t4": 0,
- "location": "EE, Harju maakond, Kiili vald, Mõisaküla, Tammetõru",
- "required": null
}
]
Returns working and repair time for all vehicles in a specified period
datetime[] required | Array of strings <date-time> [ items <date-time > ] Examples: datetime[]=2021-11-30 22:00:00&datetime[]=2021-12-08 21:59:59 Period start and end timestamps (UTC) in format YYYY-MM-DD HH:MM:SS |
[- {
- "id": "123ABC",
- "alias": "CAR01",
- "work": 543324,
- "repair": 0,
- "own_repair": 0
}
]
Returns detailed work and repair periods for a specific vehicle
id required | string Vehicle ID |
datetime[] required | Array of strings <date-time> [ items <date-time > ] Examples: datetime[]=2021-11-30 22:00:00&datetime[]=2021-12-08 21:59:59 Period start and end timestamps (UTC) in format YYYY-MM-DD HH:MM:SS |
[- {
- "id": 490480,
- "object_id": "123ABC",
- "start": "2021-12-02 16:58:09",
- "stop": "2021-12-02 18:06:14",
- "type_id": 0,
- "name": "Jaan Tamm",
- "status": "work",
- "driver_id": 2279,
- "startTimestamp": 1638464289,
- "stopTimestamp": 1638468374
}
]
Returns the count of rides for each vehicle within the specified period
datetime[] required | Array of strings <date-time> [ items <date-time > ] Examples: datetime[]=2021-06-02 12:00:00&datetime[]=2021-06-02 12:59:59 Period start and end timestamps (UTC) in format YYYY-MM-DD HH:MM:SS |
[- {
- "key": "123ABC",
- "rides": 2
}
]
[- {
- "id": 72228,
- "lat": 59.292025874924356,
- "lon": 27.07949659225727,
- "name": "Metrotec",
- "purpose": 0,
- "comment": "Important place",
- "rgAddress": "Haljas tee 25, Pirita, Tallinn, 12012 Harju Maakond, Eesti",
- "type": 1,
- "radius": 100,
- "country_code": "+372",
- "phone_nr": "55667788",
- "contact_name": "Viktor"
}
]
lat required | number <float> Latitude |
lon required | number <float> Longitude |
name | string <= 50 characters POI name |
purpose required | integer POI purpose - 0-POI, 1-Customer, 2-WIFI router, 3-Bluetooth beacon |
comment required | string <= 255 characters POI comment. If Wifi Router or Bluetooth beacon, is required and should be valid MAC address. |
type | integer [ 1 .. 9 ] Default: 1 POI group |
radius | integer Default: 50 POI radius in meters |
rgAddress | string POI address |
phone_nr | string Phone number |
country_code | string Phone country number |
contact_name | string Contact name |
{- "lat": 24.868293,
- "lon": 59.318745,
- "name": "Home",
- "purpose": 0,
- "comment": "AD-6A-9F-DA-13-7D",
- "type": 1,
- "radius": 10,
- "rgAddress": "Vehemaa tee 5, Viimsi",
- "phone_nr": "55667788",
- "country_code": "+1",
- "contact_name": "King Arthur"
}
startUse | string <date-time> Examples: startUse=2017-10-2400:00:00 Start date in format YYYY-MM-DDHH:MM:SS |
stopUse | string <date-time> Examples: stopUse=2017-10-3123:59:59 End date in format YYYY-MM-DDHH:MM:SS |
object_id required | string Examples: object_id=000AAA Vehicle ID |
[- {
- "id": 1,
- "name": "Car",
- "fname": "Driver",
- "gsm": "55667788",
- "comment": "",
- "p1": "",
- "p2": "",
- "p3": "",
- "user_id": "driver1",
- "key_id": null,
- "code": null,
- "keyName": null,
- "driver": null
}
]
datetime[] | Array of any <date-time> [ items <date-time > ] Examples: datetime[]=2024-10-24 00:00:00&datetime[]=2024-10-31 23:59:59 Start and end date in format YYYY-MM-DD HH:MM:SS |
object_id | string Examples: object_id=000AAA Vehicle ID |
[- {
- "id": 1,
- "owner": "metrotec",
- "oid": "metrotec",
- "user_id": "Driver 1",
- "object_id": "000AAA",
- "driver_id": 2778,
- "start_time": "2024-09-25 06:00:00",
- "stop_time": "2024-09-25 09:00:00",
- "est_stop_time": "2024-09-25 09:00:00",
- "purpose": "Vanuri külastus ja transport poodi - tagasi",
- "added": "2024-09-23 10:14:28",
- "pin": 4729,
- "oldpin": 0,
- "name": "King Arthur",
- "tehnKontakt": "+37255444333",
- "memo": "",
- "alias": null,
- "km": 0
}
]
Returns a list of all currently opened waybills (all datetime values are in UTC)
[- {
- "id": 1,
- "object_id": "123ABC",
- "jobName": "Job 1",
- "start": "2021-06-02 04:02:08",
- "stop": "2021-06-02 04:02:08",
- "driverName": "John Smith",
- "alias": "DRIVER1"
}
]
Requests recent information from all objects with fuel tank data
[- {
- "ID": 777366686,
- "objectID": "FTrans",
- "alias": "CAR1",
- "Xpos": 24.6066633,
- "Ypos": 59.3960766,
- "Counter1": 4678.4,
- "Counter2": 0,
- "GMTime": "2019-08-30 08:56:09",
- "Speed": 0,
- "Heading": "357°",
- "Input": 2,
- "LastCommunicationLocalTime": "2019-08-30 11:56:15",
- "Content": "2019-08-30 08:56:09,24.6066633,59.3960766,357,0,14,0,1,E03:07:0505001B18AE0003012014:021D1597160CA5:00:00",
- "Power": 0,
- "BatLevel": 6.5,
- "NoGPSFix": "0",
- "t1": 20,
- "t2": 0,
- "t3": 0,
- "t4": 0,
- "GroupID": 170,
- "GroupName": "Küte",
- "CustomerID": 90000036,
- "TankNr": 900069,
- "tank_vol": 9150
}
]
Requests recent information together with the next refill time from specified tank
object_id required | string Object ID/Tank identifier |
[- {
- "ID": 777366686,
- "objectID": "FTrans",
- "alias": "CAR1",
- "Xpos": 24.6066633,
- "Ypos": 59.3960766,
- "Counter1": 4678.4,
- "Counter2": 0,
- "GMTime": "2019-08-30 08:56:09",
- "Speed": 0,
- "Heading": "357°",
- "Input": 2,
- "LastCommunicationLocalTime": "2019-08-30 11:56:15",
- "Content": "2019-08-30 08:56:09,24.6066633,59.3960766,357,0,14,0,1,E03:07:0505001B18AE0003012014:021D1597160CA5:00:00",
- "Power": 0,
- "BatLevel": 6.5,
- "NoGPSFix": "0",
- "t1": 20,
- "t2": 0,
- "t3": 0,
- "t4": 0,
- "GroupID": 170,
- "GroupName": "Küte",
- "CustomerID": 90000036,
- "TankNr": 900069,
- "tank_vol": 9150,
- "Counter": 530,
- "next_refill_time": "15.03.2022 21:25"
}
]