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"
    }
  ]
}