Superfy Platform API Documentation


Get Allocated Sensor History on a Piny API

Require Authentication

This API is used to get allocated sensor history on a pin for the company based on combination of deviceID and token.


URL

api/projects/sensors/:projectID/:projectpinID

Required parameter (in URL)

Required parameter (POST)

Optional parameter (GET)

All optional parameters use GET method. So it should be embedded in the URL, e.g: api/projects/sensors/1/1?q=bin&o=allocationDate

Example JSON Payload

{
	"deviceID": "ABCD-EFGH-IJKL-MNOP",
	"token": "bb602ab13b8090268cd6e3bb9dfa39e2"
}

Possible return HTTP status code

Return message

{
  "status": "success",
  "message": {
    "current_parameter": "?offset=0",
    "next_parameter": "?offset=0",
    "previous_parameter": "?offset=0",
    "start": 0,
    "total": 4,
    "lists": [{
      "sensorallocatedID": 1,
      "sensorsID": 1,
      "sensorstokenID": 1,
      "sensorCompany": "LX Group",
      "sensorDeviceID": 1231,
      "firmwareVersion": "1231",
      "sensorName": "tes",
      "description": "asdasd",
      "allocationDate": 1462817660,
      "depthWhenEmpty_cm": 100,
      "distanceSensorToFillLine_cm": 0,
      "endDate": 1463685439
    }, {
      "sensorallocatedID": 2,
      "sensorsID": 1,
      "sensorstokenID": 1,
      "sensorCompany": "LX Group",
      "sensorDeviceID": 1231,
      "firmwareVersion": "1231",
      "sensorName": "tes",
      "description": "asdasd",
      "allocationDate": 1463479639,
      "depthWhenEmpty_cm": 100,
      "distanceSensorToFillLine_cm": 10,
      "endDate": 1463685439
    }, {
      "sensorallocatedID": 6,
      "sensorsID": 1,
      "sensorstokenID": 1,
      "sensorCompany": "LX Group",
      "sensorDeviceID": 1231,
      "firmwareVersion": "1231",
      "sensorName": "tes",
      "description": "asdasd",
      "allocationDate": 1463685089,
      "depthWhenEmpty_cm": 100,
      "distanceSensorToFillLine_cm": 10,
      "endDate": 1463685521
    }, {
      "sensorallocatedID": 7,
      "sensorsID": 1,
      "sensorstokenID": 1,
      "sensorCompany": "LX Group",
      "sensorDeviceID": 1231,
      "firmwareVersion": "1231",
      "sensorName": "tes",
      "description": "asdasd",
      "allocationDate": 1463685570,
      "depthWhenEmpty_cm": 100,
      "distanceSensorToFillLine_cm": 10,
      "endDate": 0
    }]
  }
}

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/sensors"+next_parameter or "api/projects/sensors"+previous_parameter
If "endDate" is 0, it means that the sensor is allocated to that bin.