Get Available Routes/Schedules API
Require Authentication
This API is used to get available routes/schedules for the company based on combination of deviceID and token.
URL
api/routes/list
Required parameter (POST)
- deviceID
- token
Optional parameter (GET)
All optional parameters use GET method. So it should be embedded in the URL, e.g: api/projects/list?q=project&o=projectName
- q «contains keyword that want to be looked for. Keyword will search maintenanceScheduleName field only»
- r «used to filter data to get recurring routes/schedules only. Value must be "Y" or "N"»
- s «used to filter data by routes/schedules processStatusType. Value must be 1 (active), 2 (missed), 3 (completed)»
- o «used to sort data, contains field name. Available value: maintenanceScheduleName, startDate, total_execution. Default value: maintenanceScheduleName»
- ot «used to sort data, contains sort type. Available value: asc, desc. Default value: asc»
- per_page «indicates how many data that will be displayed in each call. Value must be a number between 1 to 500. Default value: none (unlimited result)»
- offset «indicates the first data index that will be displayed in each call. Value must be a number with minimum value is 0. Default value: 0»
Example JSON Payload
{
"deviceID": "ABCD-EFGH-IJKL-MNOP",
"token": "bb602ab13b8090268cd6e3bb9dfa39e2"
}
Possible return HTTP status code
- 200
- 401
- 405
Return message
{
"status": "success",
"message": {
"current_parameter": "?offset=0",
"next_parameter": "",
"previous_parameter": "",
"start": 0,
"total": 4,
"lists": [
{
"maintenanceScheduleID": 2489,
"maintenanceScheduleName": "pagi sore",
"startDate": 0,
"endDate": 0,
"defaultStartCoordinates_address1": "",
"defaultStartCoordinates_address2": "",
"defaultStartCoordinates_city": "",
"defaultStartCoordinates_state": "",
"defaultStartCoordinates_country": "",
"defaultStartCoordinates_postcode": "",
"defaultStartCoordinates_latitude": -6.154994010925,
"defaultStartCoordinates_longitude": 106.80372619629,
"defaultEndCoordinates_address1": "",
"defaultEndCoordinates_address2": "",
"defaultEndCoordinates_city": "",
"defaultEndCoordinates_state": "",
"defaultEndCoordinates_country": "",
"defaultEndCoordinates_postcode": "",
"defaultEndCoordinates_latitude": -6.164274215698,
"defaultEndCoordinates_longitude": 106.80966949463,
"optimized": "Y",
"recurring": "Y",
"recurringIntervalSeconds": 9999,
"note": "",
"createdDate": 1669912371,
"updatedDate": 1669912409,
"createdByUserID": 90,
"updatedByUserID": 90,
"errorMessage": "",
"deleted": "N",
"maxCoveredRadius_meters": 0,
"vehicle": null,
"drivers": [],
"total_execution": 77,
"processStatus": "completed",
"processStatusType": 3
},
{
"maintenanceScheduleID": 4469,
"maintenanceScheduleName": "Sample Schedule",
"startDate": 1473118380,
"endDate": 1473450420,
"defaultStartCoordinates_address1": "Jalan Panjang Alteri Kedoya 19C",
"defaultStartCoordinates_address2": "",
"defaultStartCoordinates_city": "Kota Jakarta Barat",
"defaultStartCoordinates_state": "Daerah Khusus Ibukota Jakarta",
"defaultStartCoordinates_country": "ID",
"defaultStartCoordinates_postcode": "11530",
"defaultStartCoordinates_latitude": -6.202293395996,
"defaultStartCoordinates_longitude": 106.76934051514,
"defaultEndCoordinates_address1": "Jalan Sulaiman 50-67",
"defaultEndCoordinates_address2": "",
"defaultEndCoordinates_city": "Kota Jakarta Barat",
"defaultEndCoordinates_state": "Daerah Khusus Ibukota Jakarta",
"defaultEndCoordinates_country": "ID",
"defaultEndCoordinates_postcode": "11540",
"defaultEndCoordinates_latitude": -6.206111907959,
"defaultEndCoordinates_longitude": 106.77803039551,
"optimized": "Y",
"recurring": "Y",
"recurringIntervalSeconds": 9999,
"note": "notes Sample API",
"createdDate": 1692277299,
"updatedDate": 1692277299,
"createdByUserID": 90,
"updatedByUserID": 90,
"errorMessage": "",
"deleted": "N",
"maxCoveredRadius_meters": 0,
"vehicle": {
"vehicleID": 2,
"vehicleName": "UDMK6",
"vehicleType": "UDMK6",
"vehicleNo": "214435",
"vehicleDescription": "",
"vehicleColor": "",
"vehicleYear": 0
},
"drivers": [],
"total_execution": 0,
"processStatus": "started",
"processStatusType": 2
},
{
"maintenanceScheduleID": 2497,
"maintenanceScheduleName": "testong",
"startDate": 1669986000,
"endDate": 10800,
"defaultStartCoordinates_address1": "Jalan Karet Pasar Baru Barat I No. 39",
"defaultStartCoordinates_address2": "",
"defaultStartCoordinates_city": "Central Jakarta",
"defaultStartCoordinates_state": "Jakarta",
"defaultStartCoordinates_country": "ID",
"defaultStartCoordinates_postcode": "10220",
"defaultStartCoordinates_latitude": -6.204736232758,
"defaultStartCoordinates_longitude": 106.81300354004,
"defaultEndCoordinates_address1": "Jalan Keamanan No. 73-A",
"defaultEndCoordinates_address2": "",
"defaultEndCoordinates_city": "West Jakarta",
"defaultEndCoordinates_state": "Jakarta",
"defaultEndCoordinates_country": "ID",
"defaultEndCoordinates_postcode": "11130",
"defaultEndCoordinates_latitude": -6.15145111084,
"defaultEndCoordinates_longitude": 106.81300354004,
"optimized": "Y",
"recurring": "Y",
"recurringIntervalSeconds": 9999,
"note": "",
"createdDate": 1669946860,
"updatedDate": 1669946964,
"createdByUserID": 90,
"updatedByUserID": 90,
"errorMessage": "",
"deleted": "N",
"maxCoveredRadius_meters": 0,
"vehicle": {
"vehicleID": 17,
"vehicleName": "Hino Plant",
"vehicleType": "Hino",
"vehicleNo": "B 3343 BC",
"vehicleDescription": "For Test Only",
"vehicleColor": "Blue",
"vehicleYear": 2006
},
"drivers": [],
"total_execution": 1,
"processStatus": "started",
"processStatusType": 2
},
{
"maintenanceScheduleID": 3985,
"maintenanceScheduleName": "Test_schedule",
"startDate": 0,
"endDate": 0,
"defaultStartCoordinates_address1": "",
"defaultStartCoordinates_address2": "",
"defaultStartCoordinates_city": "",
"defaultStartCoordinates_state": "",
"defaultStartCoordinates_country": "",
"defaultStartCoordinates_postcode": "",
"defaultStartCoordinates_latitude": 53.670783996582,
"defaultStartCoordinates_longitude": -8.958295822144,
"defaultEndCoordinates_address1": "",
"defaultEndCoordinates_address2": "",
"defaultEndCoordinates_city": "",
"defaultEndCoordinates_state": "",
"defaultEndCoordinates_country": "",
"defaultEndCoordinates_postcode": "",
"defaultEndCoordinates_latitude": 53.668113708496,
"defaultEndCoordinates_longitude": -8.961567878723,
"optimized": "Y",
"recurring": "Y",
"recurringIntervalSeconds": 9999,
"note": "",
"createdDate": 1686907035,
"updatedDate": 1686907035,
"createdByUserID": 90,
"updatedByUserID": 90,
"errorMessage": "",
"deleted": "N",
"maxCoveredRadius_meters": 0,
"vehicle": null,
"drivers": [],
"total_execution": 0,
"processStatus": "started",
"processStatusType": 2
}
]
}
}
Note: use "next_parameter" and "previous_parameter" to go to next or previous result page. Just combine it with the API URL, e.g: "api/projects/list"+next_parameter or "api/projects/list"+previous_parameter