Superfy Platform API Documentation


Add New Route/Schedule API

Require Authentication

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


URL

api/routes/add

Required parameter (POST)

Optional parameter (POST)

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",
    "maxCoveredRadius_meters": 1000,
    "vehicleID": 2,
    "drivers": [5],
	"avoid": ["tolls","highways"],
	"projectID": [1,2],
	"projectgroupID": [1],
	"pinstypesID": [1, 2],
	"pinstagsID": [1, 5],
	"projectpinID": [5],
    "minimumbinlevel": 80
}

Possible return HTTP status code

Return message, contains newly created project

{
  "status": "success",
  "message": {
    "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",
    "maxCoveredRadius_meters": 0,
    "createdDate": 1692277299,
    "updatedDate": 1692277299,
    "createdByUserID": 90,
    "updatedByUserID": 90,
    "errorMessage": "",
    "vehicle": {
      "vehicleID": 2,
      "vehicleName": "UDMK6",
      "vehicleType": "UDMK6",
      "vehicleNo": "214435",
      "vehicleDescription": "",
      "vehicleColor": "",
      "vehicleYear": 0
    },
    "drivers": [],
    "avoid": [
      "tolls",
      "highways"
    ],
    "parameters": {
      "projects": [
        {
          "projectID": 1,
          "projectName": "Civic Zone",
          "projectAddress1": "",
          "projectAddress2": "",
          "projectCity": "",
          "projectState": "",
          "projectCountry": "AU",
          "projectZipCode": "",
          "projectLatitude": -35.331661224365,
          "projectLongitude": 149.16545104981
        },
        {
          "projectID": 2,
          "projectName": "Kambah Zone",
          "projectAddress1": "",
          "projectAddress2": "",
          "projectCity": "",
          "projectState": "",
          "projectCountry": "AU",
          "projectZipCode": "",
          "projectLatitude": -35.331661224365,
          "projectLongitude": 149.16545104981
        }
      ],
      "projectgroup": [
        {
          "projectgroupID": 1,
          "projectID": 1,
          "groupName": "General Waste"
        }
      ],
      "pintypes": [],
      "pinstags": [
        {
          "pinstagsID": 1,
          "tags_text": "wheelie bin"
        },
        {
          "pinstagsID": 5,
          "tags_text": "240"
        }
      ],
      "projectpins": [
        {
          "projectpinID": 5,
          "name": "ACT.01 Wheelie Bin Bowen Park (Near Toilets)",
          "serialNumber": "",
          "projectID": 1,
          "pintypeID": 4,
          "customlocationID": 0,
          "manufacturerID": 0,
          "pinAddress1": "Bowen Park",
          "pinAddress2": "",
          "pinCity": "Barton",
          "pinState": "Australian Capital Territory",
          "pinCountry": "AU",
          "pinZipCode": "2600",
          "latitude": -35.308013916016,
          "longitude": 149.13975524902
        }
      ],
      "onlypins": [],
      "minimumbinlevel": 80
    },
    "total_execution": 0
  }
}