Skip to main content

Get Vehicle Trips

Contents

Gets a vehicle’s trips for up to a 45-day period. The query looks from the startDate to the endDate, with a default startDate of the current time and a default endDate of 45 days in the future.

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

Field Description Type Required
tspVehicleId The fleetwide unique identifier of the vehicle.
string
Yes
startDate The start date of the 45-day period for a query 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 cannot 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
endDate The end date of the period for a query of trips, which can be up to 45 days from the startDate.
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 is 45 days after the startDate (if provided). If startDate is not provided, the end date is by default 45 days from the current time.
date
No
routeStatus Set 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
pageNumber Set if you would like to call one page at a time to more efficiently page through a large number of results. Each page will include the number of trips set by the pageSize parameter.
Default value is 1 - the first page.
number
No
pageSize The 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
  }
];
Last updated November 23, 2021.
API Endpoint:

Contents