Get Vehicle Trips

​ Trip Management’s Get Vehicle Trips API gets a vehicle’s trips for a 45-day period that begins at the entered startDate. The pageSize and pageNumber parameters can be set if you want your application to page through a large number of query results. ​

GET /service.svc/vehicletrips/query?startDate={startDate}&pageNumber={pageNumber}&pageSize={pageSize}&routeStatus={routeStatus}&tspVehicleId={tspvehicleId}'

Resource URL

https://tripmanagement.alk.com/service.svc/vehicletrips/query?startDate={startDate}&pageNumber={pageNumber}&pageSize={pageSize}

Request Fields

FieldDescriptionTypeRequired
tspVehicleIdThe fleetwide unique identifier of the vehicle.
string
Yes
startDateThe start date of the 45-day period for which you want a list of trips. If a trip has an actual start date, it is used to perform the comparison. If a trip does not have an actual start date, planned start date will be used. If planned start date can’t be found, then the date the trip was created will be used. Any trip after the start date can be a candidate.
The value must be in ISO-8601 format, for example: 2017-09-19T07:35:21-05:00
Default value is the current time.
date
No
routeStatusSet if you would only like trips with a specific status returned. A single status or a combination of status codes can be queried. Status codes include:
  • Planned = 1
  • Dispatched = 2
  • InProgress = 4
  • Completed = 8
  • Canceled = 16
  • Declined = 32
  • Deleted = 64
  • ReceivedByClient = 128
Default value is the combination of all above.
number
No
pageNumberSet if you would like to call one page at a time to more efficiently page through a large number of result. Each page will include the number of trips set by the pageSize parameter.
Default value is 1 - the fist page.
number
No
pageSizeThe number of trips per page.
Default value is 100.
number
No

Sample Response

[
  {
    name: "test_driver_trips",
    plannedStartTime: "2020-04-01T15:07:06+00:00",
    actualStartDate: null,
    tripStatus: "Completed",
    createdOn: "2020-04-01T15:07:16+00:00",
    ownerId: 501405469,
    alkTripId: 29584786
  },
  {
    name: "",
    plannedStartTime: "2020-04-01T14:07:04+00:00",
    actualStartDate: null,
    tripStatus: "Planned",
    createdOn: "2020-04-01T14:07:37+00:00",
    ownerId: 501405469,
    alkTripId: 29584773
  }
];