Executes a data service API operation-related query task to obtain data from a data source.
Usage notes
You can call this operation up to five times per second per account.
The RAM users of an Alibaba Cloud account share the quota of the account.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | ListAnalyticsData | The operation that you want to perform. Set the value to ListAnalyticsData. |
ApiPath | String | Yes | /iot-cn-npk1v******/system/query/hist_dev_cnt_stat | The path of the API operation. To obtain the value of the API Path parameter in the IoT Platform console, go to the Data Service API page and view the details page of the API operation. |
Condition.N.FieldName | String | Yes | testCode | The name of the conditional column of the API operation. To obtain the value of the conditional column in the IoT Platform console, go to the Data Service API page and view the details page of the API operation. |
Condition.N.Operate | String | Yes | = | The comparison operator. Valid values: To obtain the operators that are available for the conditional column in the IoT Platform console, go to the Data Service API page and view the details page of the API operation.
For example, a data collection has six records and the value of the
Note If you specify |
IotInstanceId | String | Yes | iot-cn-npk1u****** | The ID of the instance to which the API operation belongs. For more information, see Obtain the ID of an instance. |
IsoId | String | No | oxs_iso_id | The ID of the logical isolation. Ignore this parameter. |
PageSize | Integer | No | 100 | The number of entries per page. Valid values: 1 to 100. Default value: 100. Note If you enable pagination, you must configure this parameter. |
Condition.N.Value | String | No | 4 | The value of the conditional column. To obtain the value of the conditional column in the IoT Platform console, go to the Data Service API page and view the details page of the API operation. Note If you do not specify BETWEEN for the |
Condition.N.BetweenStart | String | No | 1 | The beginning of the value range. To obtain the value range of the conditional column in the IoT Platform console, go to the Data Service API page and view the details page of the API operation. Note If you specify BETWEEN for the |
Condition.N.BetweenEnd | String | No | 5 | The end of the value range. To obtain the value range of the conditional column in the IoT Platform console, go to the Data Service API page and view the details page of the API operation. Note If you specify BETWEEN for the |
PageNum | Integer | No | 1 | The number of the page to return. Default value: 1. |
In addition to the preceding operation-specific request parameters, you must configure common request parameters when you call this operation. For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
Code | String | Success | The response code. Valid values:
|
Data | Struct | The data returned if the call is successful. | |
Count | Long | 3 | The total number of entries returned. |
HasNext | Boolean | false | Indicates whether the next page exists. Valid values:
|
PageNum | Integer | 1 | The page number. |
PageSize | Integer | 100 | The number of entries per page. |
ResultJson | String | [{\"testCode\":\"TBB186\",\"testLevel\":5,\"testWorkYears\":3,\"testName\":\"Jack\"},{\"testCode\":\"TBB1314\",\"testLevel\":2,\"testWorkYears\":4,\"testName\":\"Tom\"},{\"testCode\":\"TBB8888\",\"testLevel\":2,\"testWorkYears\":5,\"testName\":\"Eric\"}]" | The details of the returned data. |
ErrorMessage | String | insufficient auth: no access permissions | The error message returned if the call fails. |
RequestId | String | 7EC5B624-AF1B-4C4D-BA82-A02BA1****** | The ID of the request. |
Success | Boolean | false | Indicates whether the call was successful. Valid values:
|
Examples
Sample requests
http(s)://iot.cn-shanghai.aliyuncs.com/?Action=ListAnalyticsData
&ApiPath=/iot-cn-npk1v******/system/query/hist_dev_cnt_stat
&Condition.1.FieldName=testCode
&Condition.1.Operate==
&IotInstanceId=iot-cn-npk1u******
&<Common request parameters>
Sample success responses
XML
format
<ListAnalyticsDataResponse>
<RequestId> 7EC5B624-AF1B-4C4D-BA82-A02BA1******</RequestId>
<Data>
<ResultJson>[{\"testCode\":\"TBB186\",\"testLevel\":5,\"testWorkYears\":3,\"testName\":\"Jack\"},{\"testCode\":\"TBB1314\",\"testLevel\":2,\"testWorkYears\":4,\"testName\":\"Tom\"},{\"testCode\":\"TBB8888\",\"testLevel\":2,\"testWorkYears\":5,\"testName\":\"Eric\"}]"</ResultJson>
<PageSize>100</PageSize>
<PageNum>1</PageNum>
<Count>3</Count>
<HasNext>false</HasNext>
</Data>
<Code>Success</Code>
<Success>true</Success>
</ListAnalyticsDataResponse>
JSON
format
{
"RequestId": "7EC5B624-AF1B-4C4D-BA82-A02BA1******",
"Data": {
"ResultJson": "[{\"testCode\":\"TBB186\",\"testLevel\":5,\"testWorkYears\":3,\"testName\":\"Jack\"},{\"testCode\":\"TBB1314\",\"testLevel\":2,\"testWorkYears\":4,\"testName\":\"Tom\"},{\"testCode\":\"TBB8888\",\"testLevel\":2,\"testWorkYears\":5,\"testName\":\"Eric\"}]",
"PageSize": 100,
"PageNum": 1,
"Count": 3,
"HasNext": false
},
"Code": "Success",
"Success": true
}
Error codes
For a list of error codes, see Service error codes.