1. API Description
api request domain name:
iot.cloud.tencent.com/api/exploreropen/tokenapi.
This interface (AppGetDeviceDataHistory) is used to obtain Device Object Model historical data.2. Input Parameter
Name | Type | Required | Description |
AccessToken | String | Yes | Common parameter. AccessToken is used for user authentication of a logged-in user. |
RequestId | String | Yes | Common parameter. Unique request ID can be generated manually. It is recommended to use uuId. When locating issues, you need to provide the RequestId for the request. |
Action | String | Yes | Common parameter. This interface takes values: AppGetDeviceDataHistory. |
DeviceId | String | Yes | Device ID, product ID/device name. |
| | | |
FieldName | String | Yes | Inquiry attribute name. |
Context | String | No | The paging cursor can be omitted for the initial query. |
MinTime | Int | Yes | Start time, millisecond timestamp. |
MaxTime | Int | Yes | End time, millisecond timestamp. |
Limit | Int | Yes | Single page data volume. |
3. Output Parameters
Name | Type | Description |
RequestId | String | Common parameter. Unique request ID, same as the input parameter. When locating issues, you need to provide the RequestId for the request. |
Context | String | Pagination cursor |
FieldName | String | Inquiry attribute name. |
Listover | Bool | Whether all the data has been queried. True indicates that you can continue reading if not fully read. False indicates that it has been completely read. |
Results | Array of DataHistoryItem | Return data. |
4. Samples
Example 1
Input Example
POST https://iot.cloud.tencent.com/api/exploreropen/tokenapi HTTP/1.1content-type: application/json{"RequestId": "f92406b3-5a9a-4fe8-bc43-45e3d794bb68","Action": "AppGetDeviceDataHistory","ProductId": "22F9Y6II7O","DeviceName": "light1","MinTime": 1560949017000,"MaxTime": 1561035417000,"Limit": 20,"FieldName": "light_switch","AccessToken": "8b4a70dd16105f******************18edd4e78a3bb8ec"}
Output example: successful
{"Response": {"Context": "abc","FieldName": "brightness","Listover": false,"RequestId": "f92406b3-5a9a-4fe8-bc43-45e3d794bb68","Results": [{"Time": "1560949025494","Value": "77"}]}}
5. Error Code
Error Code | Description |
InternalError | Internal error. |
InvalidParameterValue | Invalid parameter value. |
InvalidParameterValue.InvalidAccessToken | The Token is invalid. |