Get Directions

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

POST /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.
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 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.
stringYes if tripId is not supplied.
stopThis field may optionally be passed in to get the Directions Report using different Stops than the route ran with previously.Array <Stop>No
stop > 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.
stop > stopTypeType of stop
Origin, Work, Waypoint, FuelStop, RestStopShort, RestStopLong, RestStopCycleReset, Destination, RestStopFullDay, RestStopDriverSwitch, BorderCrossing
stringNo. Default is Work
stop > 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.
stop > 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.
stop > location > address > streetAddressThe street address of this trip stop.stringYes, if coords object is not supplied and if using a different set of stops than the route ran with previously.
stop > location > address > cityThe city of this trip stop.stringYes, if coords object is not supplied and if using a different set of stops than the route ran with previously.
stop > location > address > stateThe state of this trip stop.stringYes, if coords object is not supplied and if using a different set of stops than the route ran with previously.
stop > location > address > zipThe zip/postal code of this trip stop.stringYes, if coords object is not supplied and if using a different set of stops than the route ran with previously.
stop > location > address > countyThe county where this trip stop is located.stringNo
stop > 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.
stop > location > coords > latThe latitude of the stop. Minimum 4 decimal digits required. Desired 6 decimal digits.stringYes, if address object is not supplied and if using a different set of stops than the route ran with previously.
stop > location > coords > lonThe longitude of the stop.Minimum 4 decimal digits required. Desired 6 decimal digits.stringYes, if address object is not supplied and if using a different set of stops than the route ran with previously.
stop > location > labelA display name for this trip stop.stringNo
stop > earliestArrivalTimeThe date and time of start of the appointment window. The value must be in ISO-8601 format.dateNo
stop > latestArrivalTimeThe date and time of end of the appointment window. The value must be in ISO-8601 format.dateNo
stop > plannedDurationThe estimated duration at stop in minutes.integerNo
stop > 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.integerNo, default is 15
stop > 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.integerNo, default is a high number
stop > metadataNotes about the stop. These will not be delivered to the driver.stringNo

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 legComplex 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
    }
  ]
];