Update Positions

Trip Management’s Update GPS Positions API lets you add a list of GPS points traced by the vehicle. If the received GPS position is not within the region set during trip planning, an error message will be returned.

POST /trip/gpsposition

Request Fields

FieldDescriptionTypeRequired
tripIdThe alkTripId returned when you planned the trip.
Note: If no trip is found with the given alkTripId, then an error message will be returned. If the tmsTripId in your planning system is also supplied in the body of this request, then the alkTripId will be ignored irrespective of whether it is valid or not and the trip corresponding to the provided tmsTripId will be updated. In this case, if no trip is found with the given tmsTripId, then an error message will be returned.
integerYes if tmsTripId is not supplied.
tmsTripIdThe tmsTripId of your previously generated route.
Note: Even if tripId, which is the alkTripId, is also supplied with this request, it will be ignored and only trip corresponding to the given tmsTripId will be updated. If no trip is found with the given tmsTripId, then an error message will be returned.
stringYes if tripId is not supplied.
locationsList of GPS Coordinates tracked by the vehicle. If no time is provided, then the list should be in ascending order. i.e. the last position should be at the end of the list.List <GPSCoords>Yes
locations > coordsThe object containing the latitude/longitude of the GPS.Coords objectYes
locations > coords > latThe GPS latitude. Minimum 4 decimal digits required. Desired 6 decimal digits.stringYes
locations > coords > lonThe GPS longitude. Minimum 4 decimal digits required. Desired 6 decimal digits.stringYes
locations > SpeedSpeedintegerNo
locations > HeadingHeadingintegerNo
locations > AltitudeAltitudeintegerNo
locations > DeviceDTThe device time. The value must be in ISO-8601 format.stringNo

Sample Request

{
  "tripId": "136",
  "locations": [
    {
      "coords": {
        "lat": "40.058447",
        "lon": "-78.081017"
      },
      "speed": 45,
      "heading": 26,
      "altitude": 1000,
      "deviceDT": "2017-09-06T19:05:16+00:00"
    },
    {
      "coords": {
        "lat": "40.061247",
        "lon": "-78.099054"
      },
      "deviceDT": "2017-09-07T01:05:16-04:00"
    }
  ]
}

Sample Response

{
  "success": true,
  "message": null
}