Returns raw event data for a thing

Params

Param name Description
thing_key
optional

Thing key


Value: Must be a String
from
optional

From Date in format 'yyyy/mm/dd hh:mm:ss'


Value: Must be a String
to
optional

To Date in format 'yyyy/mm/dd hh:mm:ss'


Value: Must be a String
page
optional

Page number of results to be fetched


Value: Must be Integer.
per
optional

Number of records to be returnes in one page


Value: Must be Integer.
timestamp_format
optional

Format, int or str in which event timestamps should be returned


Value: Must be a String
time_zone
optional

time zone in which to return data e.g. “Mumbai”, “EST” etc


Value: Must be a String
order
optional

Order of time_stamp, asc or desc, in which events will be filtered


Value: Must be a String
metrics
optional

List of fields required in the result.


Value: Must be an array of any type
data_format
optional

Format in which event data should be returned e.g. “array” , “map”


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

Return thing data of child thing if is_oem flag is true.


Value: Must be a Boolean
query_by_created_at
optional

If set to true, “from” and “to” range is applied on “created_at” field instead of “timestamp”


Value: Must be a Boolean

Examples

Request raw data for a thing for a period of 5 minutes in time zone Mumbai with 10 events per page.
  curl -X POST -H "Content-Type:application/json" --header 'X-Auth-Token:IEkmVGHsa4R3cGPw56MkfQ' -d '{"thing_key":"11a6238e445dtd65a45ddfdabd6b8f41dbfetdfd", "from":"2016/02/02 17:05:00", "to":"2016/02/02 17:10:00", "time_zone":"Mumbai" , "time_format":"str", "per":"10"}' 'https://api.datonis.io/api/v3/datonis_query/thing_data'

Returns upto 10 events.
{
  "11a6238e445dtd65a45ddfdabd6b8f41dbfetdfd": {
    "total_event_count": 22,
    "page_number": "1",
    "event_data": [
      {
        "timestamp": "2016/02/02 17:09:53",
        "data": {
          "mem": 171.573,
          "cpu": 1.365
        }
      },
      {
        "timestamp": "2016/02/02 17:09:36",
        "data": {
          "mem": 172.742,
          "cpu": 7.427
        }
      },
      {
        "timestamp": "2016/02/02 17:09:07",
        "data": {
          "mem": 302.88,
          "cpu": 6.717
        }
      },
      {
        "timestamp": "2016/02/02 17:08:30",
       ...
Request page no 2 of raw data for a thing for a period of 5 minutes in time zone Mumbai with 10 events per page.
  curl -X POST -H "Content-Type:application/json" --header 'X-Auth-Token:IEkmVGHsa4R3cGPw56MkfQ' -d '{"thing_key":"11a6238e445dtd65a45ddfdabd6b8f41dbfetdfd", "from":"2016/02/02 17:05:00", "to":"2016/02/02 17:10:00", "time_zone":"Mumbai" , "time_format":"str", "per":10, "page":2}' 'https://api.datonis.io/api/v3/datonis_query/thing_data'

Return data for page no 2.
{
  "11a6238e445dtd65a45ddfdabd6b8f41dbfetdfd": {
    "total_event_count": 22,
    "page_number": "2",
    "event_data": [
      {
        "timestamp": "2016/02/02 17:07:01",
        "data": {
          "cpu": 0.463,
          "mem": 159.714
        }
      },
      {
        "timestamp": "2016/02/02 17:06:56",
        "data": {
          "mem": 192.217,
          "cpu": 0.613
        }
      },
      {
        "timestamp": "2016/02/02 17:06:55",
        "data": {
          "cpu": 0.099,
          "mem": 161.124
        }
      },
      {
        "timestamp": "2016/02/02 17:06:42",
       ...
Request raw data where time is returned in integer format (seconds after epoch)
  curl -X POST -H "Content-Type:application/json" --header 'X-Auth-Token:IEkmVGHsa4R3cGPw56MkfQ' -d '{"thing_key":"11a6238e445dtd65a45ddfdabd6b8f41dbfetdfd", "from":"2016/02/02 17:05:00", "to":"2016/02/02 17:10:00", "time_zone":"Mumbai" , "time_format":"int", "per":10, "page":2}' 'https://api.datonis.io/api/v3/datonis_query/thing_data'

Returns data with timestamps in integer form.
{
  "11a6238e445dtd65a45ddfdabd6b8f41dbfetdfd": {
    "total_event_count": 22,
    "page_number": "2",
    "event_data": [
      {
        "timestamp": 1454413021,
        "data": {
          "cpu": 0.463,
          "mem": 159.714
        }
      },
      {
        "timestamp": 1454413016,
        "data": {
          "mem": 192.217,
          "cpu": 0.613
        }
      },
      {
        "timestamp": 1454413015,
        "data": {
          "cpu": 0.099,
          "mem": 161.124
        }
      },
      {
        "timestamp": 1454413002,
        "data": {
          "cpu": 5.308,
         ...
Request raw data only for 'cpu' field.
  curl -X POST -H "Content-Type:application/json" --header 'X-Auth-Token:IEkmVGHsa4R3cGPw56MkfQ' -d '{"thing_key":"e4aa3e35t675fc57ce81f3dd6e2dcdef492at4f7", "from":"2015/04/02 17:05:00", "to":"2015/04/02 17:10:00", "time_zone":"Mumbai" , "time_format":"int", "per":"10", "page":"1", "metrics":["cpu"]}' 'https://api.datonis.io/api/v3/datonis_query/thing_data'

Return data with only the required fields.
{
  "e4aa3e35t675fc57ce81f3dd6e2dcdef492at4f7": {
    "total_event_count": 30,
    "page_number": "1",
    "event_data": [
      {
        "data": {
          "cpu": 1.3250000000000002
        },
        "time_stamp": 1427974799
      },
      {
        "data": {
          "cpu": 1.45
        },
        "time_stamp": 1427974797
      },
      {
        "data": {
          "cpu": 1.45
        },
        "time_stamp": 1427974795
      },
      {
        "data": {
          "cpu": 1.45
        },
        "time_stamp": 1427974794
      },
      {
        "data": {
          "cpu": 1.35
        },
  ...