Skip to main content

Get Datapoint Value

 

Purpose


This API is used to get datapoint values of managed entities either as time series data or single value by applying aggregation, time grouping, and period.


Request URL 

{api-domain}/iot/{version}/datapoints/data
 

Supported Modules

Supported Modules : Datapoints
 

Supported Modules

Authorization: Zoho-oauthtoken {{oauth}}
 

Scope

ZohoIOT.settings.cirrus.data.READ
 

Possible Operations

READ

 
Parameters

Param name, type, mandatory
 

  • datapoint_name - string, mandatory

    Possible values: Datapoint Name.


  • source - string, mandatory

     Possible values: Datapoint's source ME name.


  • aggregation - string, optional

    To get aggregated values of datapoint and source.

    Possible values: Possible aggregation values: sum, avg, max, min, last_value, first_value (default value: last_value)


  • time_grouping - string, optional

    To get aggregated values of datapoint and source based on time grouping.

      Possible values: Possible time grouping values: hour, day, week, month


  • period - string, optional

     To get aggregated values of datapoint and source for the specified period.

.      Possible period values: lasthour, last24hours, today, yesterday, this week, last7days, lastweek, thismonth, lastmonth, last30days, thisyear, lastyear(default value last 15 mins).

Sample Request 1

Copied//Purpose : Getting SUM of last 15 minutes values of <datapoint_name> and source<me_name>

curl --location -g '{{api-domain}}/iot/v1/datapoints/data?datapoint_name=<datapoint_name>&source=<me_name>&aggregation=sum' \
--header 'Authorization: Zoho-oauthtoken {{oauth}}' \
--header 'Content-Type: application/json'

Response 1

Copied{
"<datapoint_name>":20
}

Request 2

Copied//Purpose : Getting SUM of datapoint values of this week group by day for datapoint <datapoint_name> and source <me_name> 

curl --location -g '{{api-domain}}/iot/v1/datapoints/data?datapoint_name=<datapoint_name>&source=<me_name>&aggregation=sum&period=thisweek&time_grouping=day' \
--header 'Authorization: Zoho-oauthtoken {{oauth}}' \
--header 'Content-Type: application/json'

Response 2

Copied{
 "<datapoint_name>": [
   [
     "Jul 01", 20
   ],
   [
     "Jul 02", 30
   ],
   [

     "Jul 03", 40
   ]
 ]
}