GET /api/v3/things
List all things

Returns a list of all things belonging to an account as per the specified criteria. This API is paginated and returns 20 things by default. A thing is uniquely identified by a 'thing_key'. This key should be used in all the other API referencing a particular thing.

Params

Param name Description
page
optional

Page number of results to be fetched, Default 1


Value: Must be Integer.
per
optional

Number of things records to be returned in one page, Default 20


Value: Must be Integer.
order_by
optional

Field on which resultant things should be sorted


Value: Must be a String
order
optional

Order, asc or desc, in which results should be sorted


Value: Must be a String
things
optional

List of things that should be queried for


Value: Must be an array of any type
timestamp_format
optional

Format, “str” or “int”, in which timestamps should be returned, Default “int”


Value: Must be a String
search
optional

Keywords based on which things should be searched. Currently you can search things on - thing_key, name or tag


Value: Must be a String
scope
optional

Matching condition if multiple keywords are specified for search. Valid values are “all” or “any”. Default is “all”


Value: Must be a String
bi_directional
optional

Whether to return things that have bi-directional support, Default all will be returned


Value: Must be a Boolean
expr
optional

Expression based on user_defined_properties for searching things based on user_defined_properties value


Value: Must be a String
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
group_key
optional

Returns things belonging to the specified group


Value: Must be a String
thing_template_key
optional

Returns things belonging to the specified thing template


Value: Must be a String
field_list
optional

[Deprecated]Comma separated list of fields required in the result.


Value: Must be an array of any type
is_oem
optional

Returns things of child accounts along with things of oem account if is_oem flag is true.


Value: Must be one of: <code>true</code>, <code>false</code>, <code>true</code>, <code>false</code>.

Examples

Request - listing all things without any criteria
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" https://api.datonis.io/api/v3/things

Response (returns first 20 records)
{
  "total_count": 6,
  "page": 1,
  "things": [
    {
      "bi_directional": true,
      "coordinates": [
        18.123,
        73.123
      ],
      "created_at": 1448363909,
      "description": "Thing for washing machines",
      "name": "Fully Automated Washing Machine",
      "state": null,
      "tags_array": [
        "Pune"
      ],
      "thing_key": "8955641a65",
      "updated_at": 1448432790,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Installation Type": "Free Standing",
        "Manufacturer": "LG",
        "Color": "White",
        "status": "green"
      },
      "alive": false,
      "tags": "Pune",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Washing Machine",
      "thing_template_key": "af31ae5fb2"
    },
    {
      "bi_directional": false,
      "coordinates": [
        20.15,
        78.09
      ],
      "created_at": 1448363909,
      "description": "Thing for washing machines",
      "name": "Semi Automated Washing Machine",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "f3ba14f785",
      "updated_at": 1448363909,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Installation Type": "Free Standing",
        "Manufacturer": "LG",
        "Color": "Red"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Washing Machine",
      "thing_template_key": "af31ae5fb2"
    },
    {...
Request - listing things by specifying number of things to be returned at a time (page size) and specific set to be returned (page)
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"per":"2", "page":"2"}' https://api.datonis.io/api/v3/things

Response (returns page 2 with 2 things per page)
{
  "total_count": 6,
  "page": "2",
  "things": [
    {
      "bi_directional": true,
      "coordinates": [
        22.25,
        79.99
      ],
      "created_at": 1448363909,
      "description": "Thing for Refrigerator",
      "name": "French Door Refrigerator",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "ad253ccad2",
      "updated_at": 1448363909,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Manufacturer": "LG",
        "Color": "Red"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Refrigerator",
      "thing_template_key": "2a5t58bbt8"
    },
    {
      "bi_directional": false,
      "coordinates": [
        21.15,
        79.09
      ],
      "created_at": 1448363909,
      "description": "Thing for Refrigerator",
      "name": "Ice Maker Refrigerator",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "eeccaf4f8a",
      "updated_at": 1448363909,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Manufacturer": "LG",
        "Color": "White"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Refrigerator",
      "thing_template_key": "2a5t58bbt8"
    }
  ]
}
Request - listing things ordered by a field with string formatted timestamps
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"timestamp_format":"str","order_by":"name","order":"desc"}' https://api.datonis.io/api/v3/things

Response (returns things in the reverse order of name and timestamps in string format)
{
  "total_count": 6,
  "page": 1,
  "things": [
    {
      "bi_directional": false,
      "coordinates": [
        20.15,
        78.09
      ],
      "created_at": "2015/11/24 11:18:29",
      "description": "Thing for Refrigerator",
      "name": "Top Fridge Refrigerator",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "6b913at941",
      "updated_at": "2015/11/24 11:18:29",
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Manufacturer": "LG",
        "Color": "Red"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Refrigerator",
      "thing_template_key": "2a5t58bbt8"
    },
    {
      "bi_directional": false,
      "coordinates": [
        20.15,
        78.09
      ],
      "created_at": "2015/11/24 11:18:29",
      "description": "Thing for washing machines",
      "name": "Semi Automated Washing Machine",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "f3ba14f785",
      "updated_at": "2015/11/24 11:18:29",
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Installation Type": "Free Standing",
        "Manufacturer": "LG",
        "Color": "Red"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Washing Machine",
      "thing_template_key": "af31ae5fb2"
    },
    {
      "bi_directional": false,
 ...
Request - listing things based on some search criteria with all keywords matching
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"search":"Meter state"}' https://api.datonis.io/api/v3/things

Response (returns things containing both keywords 'Meter' as well as 'state')
{
  "total_count": 1,
  "page": 1,
  "things": [
    {
      "bi_directional": true,
      "coordinates": [
        20.15,
        78.09
      ],
      "created_at": 1448363909,
      "description": "Thing for Energy Meters",
      "name": "Energy Meter 1",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "54ca6t8155",
      "updated_at": 1448363909,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Energy Meter",
      "thing_template_key": "bdb1fd1ae1"
    }
  ]
}
Request - listing things based on some search criteria with any of the keywords matching
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"search":"Meter state","scope":"any"}' https://api.datonis.io/api/v3/things

Response (returns things containing either of the keywords 'Meter' or 'state')
{
  "total_count": 6,
  "page": 1,
  "things": [
    {
      "bi_directional": true,
      "coordinates": [
        18.123,
        73.123
      ],
      "created_at": 1448363909,
      "description": "Thing for washing machines",
      "name": "Fully Automated Washing Machine",
      "state": null,
      "tags_array": [
        "Pune"
      ],
      "thing_key": "8955641a65",
      "updated_at": 1448432790,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Installation Type": "Free Standing",
        "Manufacturer": "LG",
        "Color": "White",
        "status": "green"
      },
      "alive": false,
      "tags": "Pune",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Washing Machine",
      "thing_template_key": "af31ae5fb2"
    },
    {
      "bi_directional": false,
      "coordinates": [
        20.15,
        78.09
      ],
      "created_at": 1448363909,
      "description": "Thing for washing machines",
      "name": "Semi Automated Washing Machine",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "f3ba14f785",
      "updated_at": 1448363909,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Installation Type": "Free Standing",
        "Manufacturer": "LG",
        "Color": "Red"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Washing Machine",
      "thing_template_key": "af31ae5fb2"
    },
    {
      "bi_directional": true,
      "coordinates": [
        22.25,
        79.99
      ],
      "created_at": 1448363909,
      "description": "Thing for Refrigerator",
      "name": "French Door Refrigerator",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "ad253ccad2",
      "updated_at": 1448363909,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Manufacturer": "LG",
        "Color": "Red"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Refrigerator",
      "thing_template_key": "2a5t58bbt8"
    },
    {
      "bi_directional": false,
      "coordinates": [
        21.15,
        79.09
      ],
      "created_at": 1448363909,
      "description": "Thing for Refrigerator",
      "name": "Ice Maker Refrigerator",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
     ...
Request - listing things based on keys specified
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"things":["eeccaf4f8a","f3ba14f785"]}' https://api.datonis.io/api/v3/things

Response (returns things matching the keys specified)
{
  "total_count": 2,
  "page": 1,
  "things": [
    {
      "bi_directional": false,
      "coordinates": [
        20.15,
        78.09
      ],
      "created_at": 1448363909,
      "description": "Thing for washing machines",
      "name": "Semi Automated Washing Machine",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "f3ba14f785",
      "updated_at": 1448363909,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Installation Type": "Free Standing",
        "Manufacturer": "LG",
        "Color": "Red"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Washing Machine",
      "thing_template_key": "af31ae5fb2"
    },
    {
      "bi_directional": false,
      "coordinates": [
        21.15,
        79.09
      ],
      "created_at": 1448363909,
      "description": "Thing for Refrigerator",
      "name": "Ice Maker Refrigerator",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "eeccaf4f8a",
      "updated_at": 1448363909,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Manufacturer": "LG",
        "Color": "White"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Refrigerator",
      "thing_template_key": "2a5t58bbt8"
    }
  ]
}
Request - listing things that support bi directional communication
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"bi_directional":true}' https://api.datonis.io/api/v3/things

Response (returns things that support bi_directional communication)
{
  "total_count": 3,
  "page": 1,
  "things": [
    {
      "bi_directional": true,
      "coordinates": [
        18.123,
        73.123
      ],
      "created_at": 1448363909,
      "description": "Thing for washing machines",
      "name": "Fully Automated Washing Machine",
      "state": null,
      "tags_array": [
        "Pune"
      ],
      "thing_key": "8955641a65",
      "updated_at": 1448432790,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Installation Type": "Free Standing",
        "Manufacturer": "LG",
        "Color": "White",
        "status": "green"
      },
      "alive": false,
      "tags": "Pune",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Washing Machine",
      "thing_template_key": "af31ae5fb2"
    },
    {
      "bi_directional": true,
      "coordinates": [
        22.25,
        79.99
      ],
      "created_at": 1448363909,
      "description": "Thing for Refrigerator",
      "name": "French Door Refrigerator",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "ad253ccad2",
      "updated_at": 1448363909,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Manufacturer": "LG",
        "Color": "Red"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Refrigerator",
      "thing_template_key": "2a5t58bbt8"
    },
    {
      "bi_directional": true,
      "coordinates": [
      ...
Request - listing things based on given expression for user_defined_properties
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"expr":"this.user_defined_properties.Color=='"'Red'"'"}' https://api.datonis.io/api/v3/things

Response (returns things after evaluating expression based on user_defined_properties)
{
  "total_count": 3,
  "page": 1,
  "things": [
    {
      "bi_directional": false,
      "coordinates": [
        20.15,
        78.09
      ],
      "created_at": 1448363909,
      "description": "Thing for washing machines",
      "name": "Semi Automated Washing Machine",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "f3ba14f785",
      "updated_at": 1448363909,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Installation Type": "Free Standing",
        "Manufacturer": "LG",
        "Color": "Red"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Washing Machine",
      "thing_template_key": "af31ae5fb2"
    },
    {
      "bi_directional": true,
      "coordinates": [
        22.25,
        79.99
      ],
      "created_at": 1448363909,
      "description": "Thing for Refrigerator",
      "name": "French Door Refrigerator",
      "state": null,
      "tags_array": [
        "Residencial"
      ],
      "thing_key": "ad253ccad2",
      "updated_at": 1448363909,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Manufacturer": "LG",
        "Color": "Red"
      },
      "alive": false,
      "tags": "Residencial",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Refrigerator",
      "thing_template_key": "2a5t58bbt8"
    },
    {
      "bi_directional": false,
      "coordinates": [
        20.15,
       ...
Request - listing things that belong to a group
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"group_key":"6fdd6c9ef8"}' https://api.datonis.io/api/v3/things

Response (returns things belonging to the specified group)
{
  "total_count": 1,
  "page": 1,
  "things": [
    {
      "bi_directional": true,
      "coordinates": [
        18.123,
        73.123
      ],
      "created_at": 1448363909,
      "description": "Thing for washing machines",
      "name": "Fully Automated Washing Machine",
      "state": null,
      "tags_array": [
        "Pune"
      ],
      "thing_key": "8955641a65",
      "updated_at": 1448432790,
      "user_defined_properties": {
        "Firmware Ver": "1.0",
        "STATE": "OK",
        "Installation Type": "Free Standing",
        "Manufacturer": "LG",
        "Color": "White",
        "status": "green"
      },
      "alive": false,
      "tags": "Pune",
      "last_event": null,
      "last_beat": null,
      "thing_template_name": "Washing Machine",
      "thing_template_key": "af31ae5fb2"
    }
  ]
}

POST /api/v3/things
Create a thing

Creates a thing with given parameters

Params

Param name Description
thing
required

Object containing information about the thing 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
is_oem
optional

Create thing in child account by oem user if is_oem flag is true.


Value: Must be a Boolean
child_organisation_key
optional

Organisation key of child account where oem user wants to create thing. Required field if is_oem is present.


Value: Must be a String

Examples

Request
  curl -X POST -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"thing":{"name":"Fully Automated Washing Machine","description":"Thing for washing machines","user_defined_properties":{"Firmware Ver":"1.0","STATE":"OK","Installation Type":"Free Standing","Manufacturer":"LG","Color":"White"},"bi_directional":"true","tags":"Corporate","coordinates":[21.15,79.09]},"thing_template_key":"af31ae5fb2"}' https://api.datonis.io/api/v3/things

Response (returns details of the thing created)
{
  "thing": {
    "bi_directional": true,
    "coordinates": [
      21.15,
      79.09
    ],
    "created_at": 1448363909,
    "description": "Thing for washing machines",
    "name": "Fully Automated Washing Machine",
    "state": null,
    "tags_array": [
      "Corporate"
    ],
    "thing_key": "8955641a65",
    "updated_at": 1448363909,
    "user_defined_properties": {
      "Firmware Ver": "1.0",
      "STATE": "OK",
      "Installation Type": "Free Standing",
      "Manufacturer": "LG",
      "Color": "White"
    },
    "alive": false,
    "tags": "Corporate",
    "last_event": null,
    "last_beat": null,
    "thing_template_name": "Washing Machine",
    "thing_template_key": "af31ae5fb2"
  }
}

GET /api/v3/things/:thing_key
Fetch information for a thing

Returns details of the thing requested

Params

Param name Description
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
is_oem
optional

Show thing of child account if is_oem flag is true.


Value: Must be one of: <code>true</code>, <code>false</code>, <code>true</code>, <code>false</code>.

Examples

Request - get details of the specified thing (thing_key specified as a part of the url)
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A"  https://api.datonis.io/api/v3/things/8955641a65

Response (returns details of the thing requested)
{
  "thing": {
    "bi_directional": true,
    "coordinates": [
      21.15,
      79.09
    ],
    "created_at": 1448363909,
    "description": "Thing for washing machines",
    "name": "Fully Automated Washing Machine",
    "state": null,
    "tags_array": [
      "Corporate"
    ],
    "thing_key": "8955641a65",
    "updated_at": 1448363909,
    "user_defined_properties": {
      "Firmware Ver": "1.0",
      "STATE": "OK",
      "Installation Type": "Free Standing",
      "Manufacturer": "LG",
      "Color": "White"
    },
    "alive": false,
    "tags": "Corporate",
    "last_event": null,
    "last_beat": null,
    "thing_template_name": "Washing Machine",
    "thing_template_key": "af31ae5fb2"
  }
}

PUT /api/v3/things/:thing_key
Updates a thing

Updates a thing with given parameters

Params

Param name Description
thing
required

Object containing information about the thing to be updated


Value: Must be a Hash
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
is_oem
optional

Update thing in child account by oem user if is_oem flag is true.


Value: Must be a Boolean

Examples

Request - containing parameters to be modified
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"thing":{"tags":"Pune","coordinates":[18.123,73.123]}}' https://api.datonis.io/api/v3/things/8955641a65

Response (returns details of the thing updated)
{
  "thing": {
    "bi_directional": true,
    "coordinates": [
      18.123,
      73.123
    ],
    "created_at": 1448363909,
    "description": "Thing for washing machines",
    "name": "Fully Automated Washing Machine",
    "state": null,
    "tags_array": [
      "Pune"
    ],
    "thing_key": "8955641a65",
    "updated_at": 1448432116,
    "user_defined_properties": {
      "Firmware Ver": "1.0",
      "STATE": "OK",
      "Installation Type": "Free Standing",
      "Manufacturer": "LG",
      "Color": "White"
    },
    "alive": false,
    "tags": "Pune",
    "last_event": null,
    "last_beat": null,
    "thing_template_name": "Washing Machine",
    "thing_template_key": "af31ae5fb2"
  }
}

DELETE /api/v3/things/:thing_key
Delete a thing

Deletes the specified thing from the system. All associated data is also lost.

Params

Param name Description
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
is_oem
optional

Delete thing in child account by oem user if is_oem flag is true.


Value: Must be a Boolean

Examples

Request
  curl -X DELETE -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A"  https://api.datonis.io/api/v3/things/8955641a65

Response
{
}

PUT /api/v3/things/:thing_key/tag
Adds tags to a thing

Adds specified tags to an existing list of tags for a thing

Params

Param name Description
tags
optional

Comma separated list of tags to be added to the thing


Value: Must be a String
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
is_oem
optional

Add tag in thing of child account by oem user if is_oem flag is true.


Value: Must be a Boolean

Examples

Request - containing the list of tags to be added
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"tags":"Baner,automatic"}' https://api.datonis.io/api/v3/things/8955641a65/tag

Response (returns details of the thing with updated tags)
{
  "thing": {
    "bi_directional": true,
    "coordinates": [
      18.123,
      73.123
    ],
    "created_at": 1448363909,
    "description": "Thing for washing machines",
    "name": "Fully Automated Washing Machine",
    "state": null,
    "tags_array": [
      "Pune",
      "Baner",
      "automatic"
    ],
    "thing_key": "8955641a65",
    "updated_at": 1448432329,
    "user_defined_properties": {
      "Firmware Ver": "1.0",
      "STATE": "OK",
      "Installation Type": "Free Standing",
      "Manufacturer": "LG",
      "Color": "White"
    },
    "alive": false,
    "tags":...

PUT /api/v3/things/:thing_key/untag
Removes tags from a thing

Removes specified tags from the list of tags associated with a thing

Params

Param name Description
tags
optional

Comma separated list of tags to be removed from the thing


Value: Must be a String
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
is_oem
optional

Remove tag from thing of child account by oem user if is_oem flag is true.


Value: Must be a Boolean

Examples

Request - containing the list of tags to be removed
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"tags":"Baner,automatic"}' https://api.datonis.io/api/v3/things/8955641a65/untag

Response (returns details of the thing with updated tags)
{
  "thing": {
    "bi_directional": true,
    "coordinates": [
      18.123,
      73.123
    ],
    "created_at": 1448363909,
    "description": "Thing for washing machines",
    "name": "Fully Automated Washing Machine",
    "state": null,
    "tags_array": [
      "Pune"
    ],
    "thing_key": "8955641a65",
    "updated_at": 1448432412,
    "user_defined_properties": {
      "Firmware Ver": "1.0",
      "STATE": "OK",
      "Installation Type": "Free Standing",
      "Manufacturer": "LG",
      "Color": "White"
    },
    "alive": false,
    "tags": "Pune",
    "last_event": null,
   ...

PUT /api/v3/things/:thing_key/set_user_defined_properties
Set user defined user_defined_properties (properties) on a thing

Adds specified user defined properties on a thing

Params

Param name Description
user_defined_properties
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
is_oem
optional

Add user defined properties in thing of child account by oem user if is_oem flag is true.


Value: Must be a Boolean

Examples

Request - containing user defined properties to be added
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A"  -d '{"user_defined_properties":{"status":"green","customer_code":13433}}' https://api.datonis.io/api/v3/things/8955641a65/set_user_defined_properties

Response (returns details of the thing with updated user_defined_properties (properties))
{
  "thing": {
    "bi_directional": true,
    "coordinates": [
      18.123,
      73.123
    ],
    "created_at": 1448363909,
    "description": "Thing for washing machines",
    "name": "Fully Automated Washing Machine",
    "state": null,
    "tags_array": [
      "Pune"
    ],
    "thing_key": "8955641a65",
    "updated_at": 1448432550,
    "user_defined_properties": {
      "Firmware Ver": "1.0",
      "STATE": "OK",
      "Installation Type": "Free Standing",
      "Manufacturer": "LG",
      "Color": "White",
      "status": "green",
      "customer_code": 13433
    },
    "alive": false,
    "tags": "Pune",
    "last_event": null,
    "last_beat": null,
    "thing_template_name": "Washing Machine",
    "thing_template_key": "af31ae5fb2"
  }
}

PUT /api/v3/things/:thing_key/remove_user_defined_properties
Remove user defined properties on a thing

Removes specified user defined properties on a thing

Params

Param name Description
user_defined_properties
optional

List of user_defined_properties keys to be removed


Value: Must be an array of any type
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
is_oem
optional

Remove user defined properties in thing of child account by oem user if is_oem flag is true.


Value: Must be a Boolean

Examples

Request - containing user defined properties to be removed
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A"  -d '{"user_defined_properties":["customer_code"]}' https://api.datonis.io/api/v3/things/8955641a65/remove_user_defined_properties

Response (returns details of the thing with updated user_defined_properties (properties))
{
  "thing": {
    "bi_directional": true,
    "coordinates": [
      18.123,
      73.123
    ],
    "created_at": 1448363909,
    "description": "Thing for washing machines",
    "name": "Fully Automated Washing Machine",
    "state": null,
    "tags_array": [
      "Pune"
    ],
    "thing_key": "8955641a65",
    "updated_at": 1448432790,
    "user_defined_properties": {
      "Firmware Ver": "1.0",
      "STATE": "OK",
      "Installation Type": "Free Standing",
      "Manufacturer": "LG",
      "Color": "White",
      "status": "green"
    },
    "alive": false,
    "tags": "Pune",
    "last_event": null,
    "last_beat": null,
    "thing_template_name": "Washing Machine",
    "thing_template_key": "af31ae5fb2"
  }
}