Skip to main content

Get Route Path

Contents

Trip Management’s Get Route Path API retrieves the latitude/longitude coordinates of a route. There are multiple endpoints for this request that you can select from depending on whether you are trying to retrieve and display the current, planned, or latest route. All endpoints are queried via GET requests using either a tmsTripId from the TMS system or the Trimble TripId that was returned when you planned the trip.

The base URL for all requests is https://tripmanagement.trimblemaps.com/api.

Endpoints

Description Endpoints
Get the route path for the current route from the last arrived stop forward to the end of the route. /trip/{tripId}/routePath
/trip/routePath?tripId={tmsTripId}
Get the current full route path. This will provide the latest version of the route path with any modifications or changes that were made after the trip was put InProgress. /trip/{tripId}/routePath?includeAllStops=true
/trip/routePath?tripId={tmsTripId}&includeAllStops=true
Get the initial planned route path that is saved and consistent from the moment the trip was put InProgress. This means that any modifications that happen along the route while the driver is executing will not be present in this version of the route path. /trip/{tripId}/routePath/initial
/trip/routePath/initial?tripId={tmsTripId}
Get the latest version of the route path from the asset’s current location forward. This means if the driver is out of route or deviated from the original/current path including all stops, the suggested path of returning to the planned route will also be returned. /trip/{tripId}/routePath/latest
/trip/routePath/latest?tripId={tmsTripId}

Example

The endpoints can be used to display the Current Route, the Initial (Planned) Route, and the Latest Route, as shown below in Trimble’s Trip Viewer.

Trip viewer route path screenshot

Request Fields

Field Description Type Required
tripId The alkTripId returned when you planned the trip.
integer
or
string
Either tripId or tmsTripId is required depending on the endpoint. Not both.
tmsTripId The tmsTripId in your planning system.
integer
or
string
Either tripId or tmsTripId is required depending on the endpoint. Not both.

Response Fields

Same response for both the types of requests

Field Description Type
Type The type of the GetRoutePath response.
string
TMinutes The total duration of the trip, in minutes
integer
TDistance The total distance of the trip in the distance units specified by the trip’s options (Miles or KM).
integer
Geometry Contains the Coordinate points along the route.
GeoJsonGeometry object
Geometry/type The type of the geometric object.
string
Geometry/coordinates An array of latitude and longitude coordinates along the route.
Array <double>

Example

Sample Response

The sample below is truncated for space. Actual responses often include hundreds or thousands of coordinates, depending on the length of the route.

{
    "type": "Feature",
    "geometry": {
        "type": "MultiLineString",
        "coordinates": [
            [
                [
                    -81.371743,
                    28.319701
                ],
                [
                    -81.371743,
                    28.319701
                ]
            ],
            [
                [
                    -81.371743,
                    28.319701
                ],
                [
                    -81.37177,
                    28.319692
                ],
                [
                    -84.490644,
                    33.767836
                ]
            ]
        ]
    },
    "tMinutes": 514,
    "tDistance": 549.689
}
Last updated October 22, 2024.
API Endpoint:

Contents