Skip to main content

Get Directions

Contents

Trip Management’s Get Directions provides turn-by-turn directions for the associated route.

POST /trip/getDirections

Resource URL

https://tripmanagement.alk.com/api/trip/getDirections

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 directions for the trip corresponding to the provided tmsTripId will be returned. In this case, if no trip is found with the given tmsTripId, then an error message will be returned.
integer
Yes 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 directions for trip corresponding to the given tmsTripId will be returned. If no trip is found with the given tmsTripId, then an error message will be returned.
string
Yes if tripId is not supplied.
stopsThis field may optionally be passed in to get the Directions Report using different Stops than the route ran with previously.
Array <Stop>
No
stops > stopSequenceThe order in which the stops are to be executed.integer Yes, if using a different set of stops than the route ran with previously.
stops > stopTypeThe type of stop . Options are: Origin, Work, Waypoint, FuelStop, Destination, Delivery, Pickup, Break, RestStopShort, RestStopLong, RestStopCycleReset, RestStopFullDay, RestStopDriverSwitch, RestStopShortSplittable (EU ONLY), and RestStopLongSplittable (EU ONLY).
string
No. Default is Work
stops > locationEach stop array must have either coord object or address object for location.
location object
Yes, if using a different set of stops than the route ran with previously.
stops > location > addressAn address object representing the street address, city, state, and postal code of a stop.
address object
Yes, if coords object is not supplied and if using a different set of stops than the route ran with previously.
stops > location > address > streetAddressThe street address of this trip stop.
string
Yes, if coords object is not supplied and if using a different set of stops than the route ran with previously.
stops > location > address > cityThe city of this trip stop.
string
Yes, if coords object is not supplied and if using a different set of stops than the route ran with previously.
stops > location > address > stateThe state of this trip stop.
string
Yes, if coords object is not supplied and if using a different set of stops than the route ran with previously.
stops > location > address > zipThe zip/postal code of this trip stop.
string
Yes, if coords object is not supplied and if using a different set of stops than the route ran with previously.
stops > location > address > countyThe county where this trip stop is located.
string
No
stops > location > coordsContains the latitude and longitude of the stop.
Coords object
Yes, if address object is not supplied and if using a different set of stops than the route ran with previously.
stops > location > coords > latThe latitude of the stop. Minimum 4 decimal digits required. Desired 6 decimal digits.
string
Yes, if address object is not supplied and if using a different set of stops than the route ran with previously.
stops > location > coords > lonThe longitude of the stop.Minimum 4 decimal digits required. Desired 6 decimal digits.
string
Yes, if address object is not supplied and if using a different set of stops than the route ran with previously.
stops > location > labelA display name for this trip stop.
string
No
stops > earliestArrivalTimeThe date and time of start of the appointment window. The value must be in ISO-8601 format.
date
No
stops > latestArrivalTimeThe date and time of end of the appointment window. The value must be in ISO-8601 format.
date
No
stops > plannedDurationThe estimated duration at stop in minutes.
integer
No
stops > atRiskThresholdNumber of minutes prior to the end of the delivery window that, if the driver’s ETA lands within this period, the stop will be flagged as “At Risk”. For example, if set to 20 minutes, and the delivery window is from 1pm-3pm, the stop is At Risk if the ETA is anywhere between 2:40pm and 3:00pm. The stop is On Time if ETA is prior to 2:40pm, and Late if ETA is after 3:00pm.
integer
No, default is 15
stops > tooEarlyThresholdNumber of minutes prior to the start of the delivery window that, if the driver’s ETA lands before this period, the stop will be flagged as “Too Early”. For example, if set to 20 minutes, and the delivery window is from 1pm-3pm, the stop is “Too Early” if the ETA is anytime before 12:40pm. The stop is Early if ETA is prior to 1:00pm. anywhere between 2:40pm and 3:00pm.
integer
No, default is a high number
stops > metadataNotes about the stop. These will not be delivered to the driver.
string
No

Response Fields

FieldDescriptionType
OriginThe Origin Stop of the route.
Stop object
DestinationThe Destination Stop of the route.
Stop Object
ReportLegsAn object containing a the Origin and Destination for each leg, as well as the Directions for that leg
Complex Object

Sample Response

[
  [
    {
      origin: {
        timeZone: "EST",
        errors: [],
        speedLimitInfo: null,
        confidenceLevel: "Exact",
        distanceFromRoad: 0.002,
        distanceFromRoadSpecified: true,
        crossStreet: null,
        address: {
          streetAddress: "24 Yawkey Way",
          city: "Boston",
          state: "MA",
          zip: null,
          county: null,
          country: null,
          splc: null,
          countryPostalFilterSpecified: false,
          abbreviationFormatSpecified: false
        },
        coords: {
          lat: "42.346689",
          lon: "-71.098860"
        },
        region: "NA",
        regionSpecified: true,
        label: "",
        placeName: ""
      },
      destination: {
        timeZone: "EST",
        errors: [],
        speedLimitInfo: null,
        confidenceLevel: "Exact",
        distanceFromRoad: 0.013,
        distanceFromRoadSpecified: true,
        crossStreet: null,
        address: {
          streetAddress: "61 Brookline Avenue",
          city: "Boston",
          state: "MA",
          zip: null,
          county: null,
          country: null,
          splc: null,
          countryPostalFilterSpecified: false,
          abbreviationFormatSpecified: false
        },
        coords: {
          lat: "42.346933",
          lon: "-71.099155"
        },
        region: "NA",
        regionSpecified: true,
        label: "",
        placeName: ""
      },
      reportLegs: [
        {
          origin: {
            timeZone: "EST",
            errors: [],
            speedLimitInfo: null,
            confidenceLevel: "Exact",
            distanceFromRoad: 0.002,
            distanceFromRoadSpecified: true,
            crossStreet: null,
            address: {
              streetAddress: "24 Yawkey Way",
              city: "Boston",
              state: "MA",
              zip: null,
              county: null,
              country: null,
              splc: null,
              countryPostalFilterSpecified: false,
              abbreviationFormatSpecified: false
            },
            coords: {
              lat: "42.346689",
              lon: "-71.098860"
            },
            region: "NA",
            regionSpecified: true,
            label: "",
            placeName: ""
          },
          reportLines: [
            {
              warn: null,
              direction: "24 Yawkey Way, Boston, MA 02215",
              dist: null,
              time: null,
              interCh: null,
              delay: null
            },
            {
              warn: null,
              direction: "Go south on Local",
              dist: null,
              time: null,
              interCh: null,
              delay: null
            },
            {
              warn: null,
              direction: "Drive less than 0.1 miles",
              dist: "0.000",
              time: "0:00",
              interCh: null,
              delay: null
            }
          ],
          dest: {
            timeZone: "EST",
            errors: [],
            speedLimitInfo: null,
            confidenceLevel: "Exact",
            distanceFromRoad: 0.002,
            distanceFromRoadSpecified: true,
            crossStreet: null,
            address: {
              streetAddress: "24 Yawkey Way",
              city: "Boston",
              state: "MA",
              zip: null,
              county: null,
              country: null,
              splc: null,
              countryPostalFilterSpecified: false,
              abbreviationFormatSpecified: false
            },
            coords: {
              lat: "42.346689",
              lon: "-71.098860"
            },
            region: "NA",
            regionSpecified: true,
            label: "",
            placeName: ""
          }
        }
      ],
      routeID: null
    }
  ]
];
Last updated November 30, 2021.
Contents