Get Company Trips

Contents

Gets all trips for a given API key regardless of driver or vehicle for a period of up to 45 days. 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 /v2/trip?startDate={startDate time}&endDate={endDate time}&pageNumber={pageNumber}&pageSize={pageNumber}

Resource URL

https://tripmanagement.alk.com/api/v2/trip?startDate={startDate time}&endDate={endDate time}&pageNumber={pageNumber}&pageSize={pageNumber}

Request Fields

Field Description Type Required
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
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
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
pageSize The number of trips per page.
Default value is 100.
number
No

Sample Response

{
       "name": "alk_test_trip",
       "actualStartDate": "2020-11-17T14:55:56+00:00",
       "plannedStartTime": "2017-09-19T16:35:21+04:00",
       "id": 48400072,
       "tripStatus": 2,
       "createdOn": "2020-11-17T13:55:58+00:00",
       "ownerId": 511508865,
       "tspVehicleId": vehicle3,
       "tspDriverId": test@alk.com
   },
   {
       "name": "Trip 2",
       "actualStartDate": "2020-11-16T09:06:46-05:00",
       "plannedStartTime": "2020-11-16T11:00:00-05:00",
       "id": 48354758,
       "tripStatus": 3,
       "createdOn": "2020-11-16T14:05:41+00:00",
       "ownerId": 511511502,
       "tspVehicleId": null,
       "tspDriverId": "test@alk.com"
   },
   {
       "name": "Trip1",
       "actualStartDate": "2020-11-13T18:50:24-05:00",
       "plannedStartTime": "2016-07-01T07:00:00-04:00",
       "id": 48248461,
       "tripStatus": 2,
       "createdOn": "2020-11-13T21:50:24+00:00",
       "ownerId": 511511502,
       "tspVehicleId": test-truck,
       "tspDriverId": "test@alk.com"
   },
   {
       "name": "test_stops_auto_update",
       "actualStartDate": "2020-11-13T18:48:10-05:00",
       "plannedStartTime": "2016-07-01T07:00:00-04:00",
       "id": 48248391,
       "tripStatus": 2,
       "createdOn": "2020-11-13T21:48:10+00:00",
       "ownerId": 511508865,
       "tspVehicleId": semi-truck,
       "tspDriverId": "test@alk.com"
   },
   {
       "name": "test_trip2",
       "actualStartDate": "2020-11-13T22:42:02+00:00",
       "plannedStartTime": "2020-11-13T21:42:02+00:00",
       "id": 48248092,
       "tripStatus": 2,
       "createdOn": "2020-11-13T21:42:03+00:00",
       "ownerId": 511508865,
       "tspVehicleId": null,
       "tspDriverId": test@alk.com
   },
   {
       "name": "abc",
       "actualStartDate": "2020-11-13T21:32:12+00:00",
       "plannedStartTime": "2020-11-13T21:32:10+00:00",
       "id": 48247738,
       "tripStatus": 2,
       "createdOn": "2020-11-13T21:32:10+00:00",
       "ownerId": 511508865,
       "tspVehicleId": null,
       "tspDriverId": test@alk.com
   },
   {
       "name": "test_stop",
       "actualStartDate": "2020-11-13T21:31:55+00:00",
       "plannedStartTime": "2020-11-13T21:31:35+00:00",
       "id": 48247721,
       "tripStatus": 2,
       "createdOn": "2020-11-13T21:31:36+00:00",
       "ownerId": 511508865,
       "tspVehicleId": null,
       "tspDriverId": null
   },
   {
       "name": "test_stop5",
       "actualStartDate": "2020-11-13T21:05:28+00:00",
       "plannedStartTime": "2020-11-13T20:05:28+00:00",
       "id": 48244000,
       "tripStatus": 2,
       "createdOn": "2020-11-13T20:05:28+00:00",
       "ownerId": 511508865,
       "tspVehicleId": null,
       "tspDriverId": test@alk.com
   },
   {
       "name": "test_stop6",
       "actualStartDate": "2020-11-13T21:02:57+00:00",
       "plannedStartTime": "2020-11-13T20:02:57+00:00",
       "id": 48243870,
       "tripStatus": 2,
       "createdOn": "2020-11-13T20:02:59+00:00",
       "ownerId": 511508865,
       "tspVehicleId": null,
       "tspDriverId": null
   },
   {
       "name": "test_stop7",
       "actualStartDate": "2020-11-13T20:02:23+00:00",
       "plannedStartTime": "2020-11-13T20:02:17+00:00",
       "id": 48243835,
       "tripStatus": 2,
       "createdOn": "2020-11-13T20:02:18+00:00",
       "ownerId": 511508865,
       "tspVehicleId": mazda,
       "tspDriverId": test@alk.com
   }
Last updated November 19, 2020.