Superfy Platform API Documentation


Update Specific Route/Schedule API

Require Authentication

This API is used to update specific route/schedule for the company based on combination of deviceID and token.

URL

api/routes/update/:maintenanceScheduleID

Required parameter (in URL)

Required parameter (POST)

Optional parameter (POST)

Note: To remove projectID, projectgroupID, pinstypesID, pinstagsID, and/or projectpinID, just pass those fields with empty array. To remove minimumbinlevel, pass it with value less than or equal 0.

Example JSON Payload

{
	"deviceID": "ABCD-EFGH-IJKL-MNOP",
	"token": "c43fa596e7916827106b591e2bb026cd",
	"maintenanceScheduleID": 1,
    "maintenanceScheduleName": "Recurring Schedule",
    "startDate": 1473107580,
    "endDate": 1473439620,
    "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,
    "recurringIntervalSeconds": 86400,
    "note": "notes",
    "vehicleID": 2,
    "drivers": [5],
	"avoid": ["tolls","highways"],
	"projectID": [1,2],
	"projectgroupID": [1],
	"pinstypesID": [1, 2],
	"pinstagsID": [1, 5],
	"projectpinID": [5],
    "minimumbinlevel": 80,
	"maxCoveredRadius_meters": 1000
}

Possible return HTTP status code

Return message

{
  "status": "success",
  "message": {
    "maintenanceScheduleID": 6,
    "maintenanceScheduleName": "Recurring Schedule",
    "startDate": 1473107580,
    "endDate": 1473439620,
    "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": 86400,
    "note": "notes",
    "maxCoveredRadius_meters": 1000,
    "createdDate": 1473659551,
    "updatedDate": 1473659888,
    "createdByUserID": 3,
    "updatedByUserID": 3,
	"errorMessage": "",
    "vehicle": {
      "vehicleID": 2,
      "vehicleName": "REDDY",
      "vehicleType": "KIA",
      "vehicleNo": "N1929CJ",
      "vehicleDescription": "SOLD THIS YEAR",
      "vehicleColor": "RED",
      "vehicleYear": 2003
    },
    "drivers": [],
    "avoid": [
      "tolls",
      "highways"
    ],
    "parameters": {
      "projects": [
        {
          "projectID": 1,
          "projectName": "TEst without icon in the kost",
          "projectAddress1": "Anggrek Cakra 12",
          "projectAddress2": "",
          "projectCity": "Jakarta Barat",
          "projectState": "",
          "projectCountry": "ID",
          "projectZipCode": "",
          "projectLatitude": -6.202315807343,
          "projectLongitude": 106.78104400635
        },
        {
          "projectID": 2,
          "projectName": "edited by API",
          "projectAddress1": "Bina Nusantara University",
          "projectAddress2": "Jalan KH. Syahdan",
          "projectCity": "Jakarta Barat",
          "projectState": "",
          "projectCountry": "",
          "projectZipCode": "",
          "projectLatitude": -6.200723171234,
          "projectLongitude": 106.78497314453
        }
      ],
      "projectgroup": [
        {
          "projectgroupID": 1,
          "projectID": 1,
          "groupName": "Test Group"
        }
      ],
      "pintypes": [
        {
          "pintypeID": 1,
          "pinTypeName": "Pin Custom",
          "pinSize": "100",
          "depthWhenEmpty_cm": 0
        },
        {
          "pintypeID": 2,
          "pinTypeName": "test pin type API",
          "pinSize": "",
          "depthWhenEmpty_cm": 1000
        }
      ],
      "pinstags": [
        {
          "pinstagsID": 1,
          "tags_text": "tags"
        },
        {
          "pinstagsID": 5,
          "tags_text": "tags api"
        }
      ],
      "projectpins": [
        {
          "projectpinID": 5,
          "name": "Pin Custom",
          "serialNumber": "",
          "projectID": 5,
          "pintypeID": 1,
          "customlocationID": 1,
          "manufacturerID": 0,
          "pinAddress1": "Jalan Anggrek Cakra 6-12",
          "pinAddress2": "",
          "pinCity": "Kota Jakarta Barat",
          "pinState": "Daerah Khusus Ibukota Jakarta",
          "pinCountry": "Indonesia",
          "pinZipCode": "11530",
          "latitude": -6.20242357254,
          "longitude": 106.77905273438
        }
      ],
      "minimumbinlevel": 80
    },
    "total_execution": 0
  }
}