Add location with tether-server
Introduction
The Add Vehicle Locations API is used to send vehicle location data to FT platform. Vehicle data can come from GPS device providers. The location information is used by FT to track vehicles in nearly real-time.
Add Vehicle Locations API End Point
Request
Request Parameters
Name | Type | Location | Description | Example |
---|---|---|---|---|
Authorization | string | headers | JWT token required to authenticate API call. | Authorization: Bearer eyJhbGciOiJIUzI1Ni |
connection_id | integer | headers | used to identify a valid GPS connection with freight tiger | connection_id: <connection_id> |
Request Body
Example Request Body
[
{
"vehicleNumber": "MH04JU2142",
"latitude": 19.099,
"longitude": 72.871,
"speed": 40.0,
"deviceTimestamp": 1629361417
},
{
"vehicleNumber": "MH04JU2143",
"latitude": 18.099,
"longitude": 71.871,
"speed": 50.0,
"deviceTimestamp": 1629361418
}
]
JSON Schema
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/object1630405725.json",
"title": "Root",
"type": "array",
"default": [],
"items":{
"$id": "#root/items",
"title": "Items",
"type": "object",
"required": [
"vehicleNumber",
"latitude",
"longitude",
"deviceTimestamp"
],
"properties": {
"vehicleNumber": {
"$id": "#root/items/vehicleNumber",
"title": "Vehiclenumber",
"type": "string",
"default": "",
"examples": [
"MH04JU2142"
],
"pattern": "^.*$",
"description": "the vehicle number tracked by gps device",
"minLength": 1
},
"latitude": {
"$id": "#root/items/latitude",
"title": "Latitude",
"type": "number",
"examples": [
19.099
],
"default": 0.0,
"description": "latitude of the vehicle at that instant"
},
"longitude": {
"$id": "#root/items/longitude",
"title": "Longitude",
"type": "number",
"examples": [
72.871
],
"default": 0.0,
"description": "longitude of the vehicle at that instant"
},
"speed": {
"$id": "#root/items/speed",
"title": "Speed",
"type": "number",
"examples": [
40.0
],
"minimum": 0.0,
"default": 0,
"description": "speed of the vehicle at that instant"
},
"deviceTimestamp": {
"$id": "#root/items/deviceTimestamp",
"title": "Devicetimestamp",
"type": "integer",
"examples": [
1629361417
],
"default": 0,
"description": "current epoch timestamp for which gps data is recorded"
}
}
}
}
High-Level Process Flow
The API gets an array of vehicles and their last known locations
API saves the vehicles and their last known locations in a temporary table
The location data in a temporary table is consumed FT Location Service.
Responses
Status Code - 200
{
"status": true,
"message": "Vehicle location added successfully"
}
Status Code - 400
Post your questions in the comment box to get answers from the experts who watch this page.
For engineering support: visit FT Support