Adds specified user defined traits (properties) on a sensor
Param name | Description |
---|---|
traits optional |
map of key value pairs to be set Value: Must be a Hash |
pretty optional |
Return a pretty formatted response if true, Default is false Value: Must be a Boolean |
Request - containing traits (properties) to be added curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"traits":{"status":"green","customer_code":13433}}' https://api.datonis.io/api/v2/sensors/16dc891e4b255735d7tafete13e6fdc412628t84/set_traits Response (returns details of the sensor with updated traits (properties)) { "sensor": { "bi_directional": false, "coordinates": [ "18.5203", "73.8567" ], "description": "", "sensor_key": "16dc891e4b255735d7tafete13e6fdc412628t84", "type": "Energy Meter", "meta_data": { "properties": { "voltage": { "type": "number" }, "power": { "type": "number" } }, "additionalProperties": false }, "name": "EM-100", "state": "registered", "tags_array": [ "1-Phase", "15-Amps", "Pune" ], "traits": { "status": "green", "customer_code": 13433 }, "unit_of_measure": null, "alive": false, "tags": "1-Phase,15-Amps,Pune", "last_event": null, "last_beat": 1428644189 } }