Get Trips

Trip Management’s Get Trips API gets user trips within a given date range and filtered by trip status. It also allows a consumer application to page through query results efficiently.

GET /trips/query?startDate={startDate}&endDate={endDate}&routeStatus={routeStatus}&pageNumber={pageNumber}&pageSize={pageSize}

Resource URL

https://tripmanagement.alk.com/api/trips/query?startDate={startDate}&endDate={endDate}&routeStatus={routeStatus}&pageNumber={pageNumber}&pageSize={pageSize}

Request Fields

FieldDescriptionTypeRequired
tspDriverIdThe fleetwide unique identifier of the driver.
string
Yes
startDateIf 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 is going to be used. If planned start date can’t be found, then the date the trip was created on is going to be used. Any trip after the start date can be a candidate.
The value must be in ISO-8601 format like: 2017-09-19T07:35:21-05:00
Default value is end date minus 7 days
date
No
endDateIf 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 is going to be used. If planned start date can’t be found, then the date the trip was created on is going to be used. Any trip before the end date can be a candidate.
The value must be in ISO-8601 format like: 2017-09-19T07:35:21-05:00
Default value is now.
date
No
routeStatusEnumeration flag value. Combination of status codes can be queried. A trip having a status code in one of the values can be a candidate.
  • 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
pageNumberThe API allows the consumer app efficiently paging through large result sets.
Default value is 1 - the fist page.
number
No
pageSizeThe number of trips per page.
Default value is 100.
number
No

Sample Response

[
  {
    tmsTripId: "alk_readonly_test_trip",
    name: "alk_postman_test_trip",
    plannedStartTime: "2017-09-19T07:35:21-05:00",
    actualStartDate: null,
    tripStatus: "Planned",
    tmsId: "TMWSuite",
    tmsCustomerId: "",
    tmsUserId: "",
    createdBy: "1",
    createdOn: "2017-12-15T18:24:31-05:00",
    alkTripId: 14460
  },
  {
    tmsTripId: "alk_readonly_test_trip",
    name: "alk_postman_test_trip",
    plannedStartTime: "2017-09-19T07:35:21-05:00",
    actualStartDate: null,
    tripStatus: "Planned",
    tmsId: "TMWSuite",
    tmsCustomerId: "",
    tmsUserId: "",
    createdBy: "1",
    createdOn: "2017-12-15T18:25:15-05:00",
    alkTripId: 14461
  }
];