Creates a sensor with given parameters

Params

Param name Description
sensor
required

Object containing information about the sensor to be created


Value: Must be a Hash
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request
  curl -X POST -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"sensor":{"name":"WM-124","description":"WM-124","type":"Water Meter","tags":"1-Inch,Pune","coordinates":[18.123,73.123],"traits":{"status":"green"}}}' https://api.datonis.io/api/v2/sensors

Response (returns details of the sensor created)
{
  "sensor": {
    "bi_directional": false,
    "coordinates": [
      18.123,
      73.123
    ],
    "description": "WM-124",
    "sensor_key": "6e78c8ad89f4fabfdda4a4144a92ca958ff84td9",
    "type": "Water Meter",
    "meta_data": null,
    "name": "WM-124",
    "state": null,
    "tags_array": [
      "1-Inch",
      "Pune"
    ],
    "traits": {
      "status": "green"
    },
    "unit_of_measure": null,
    "alive": false,
    "tags": "1-Inch,Pune",
    "last_event": null,
    "last_beat": null,
    "created_at": 1396514265,
    "updated_at": 1416569091
  }
}