Skip to content

Query Device Historical Uplink/Downlink Data Logs

API Address:/v2/quecdatastorage/r1/openapi/device/data/history

Request Method:GET

Request Data Type:application/x-www-form-urlencoded

Response Data Type:*/*

API Description: Device historical uplink/downlink information query

Request Parameters:

Parameter NameParameter DescriptionRequest TypeRequiredData TypeSchema
deviceKeyDevice Key. If deviceKey is provided, productKey must also be provided. The combination of productKey and deviceKey corresponds one-to-one with deviceId. If productKey and deviceKey combination is provided, deviceId is not needed. If you provide both deviceId and the productKey/deviceKey combination, deviceId takes precedencequerytruestring
productKeyProduct Key. If productKey is provided, deviceKey must also be provided. The combination of productKey and deviceKey corresponds one-to-one with deviceId. If productKey and deviceKey combination is provided, deviceId is not needed. If you provide both deviceId and the productKey/deviceKey combination, deviceId takes precedencequerytruestring
beginDateTimpStart time (timestamp, in milliseconds)queryfalseinteger(int64)
deviceIdDevice ID, corresponds one-to-one with the productKey and deviceKey combination. If deviceId is provided, productKey and deviceKey combination is not needed. If you provide both deviceId and the productKey/deviceKey combination, deviceId takes precedencequeryfalseinteger(int64)
directionData type: 1 - UP (uplink), 2 - DOWN (downlink)queryfalseinteger(int32)
endDateTimpEnd time (timestamp, in milliseconds)queryfalseinteger(int64)
languageLanguage: CN/EN (default: CN)queryfalsestring
pageNumPage number (default: 1)queryfalseinteger(int32)
pageSizePage size, number of items per page (default: 10)queryfalseinteger(int32)
sendStatusSend status: 0 - Not sent; 1 - Sent; -1 - Send failedqueryfalseinteger(int32)

Response Status:

Status CodeDescriptionSchema
200OKActionResult«List«DeviceData»»
50000Service exception
50005Parameter check error
50007The deviceID, productKey or deviceKey is empty
70000Hub service unavailable
70089You have limited permission to operate this project or product or device
70130Non-existent device
91001Token does not exist
91004Token incorrect
91005Doesn't have permission
91006User not in IP white list
91007Please enable API permission

Response Parameters:

Parameter NameParameter DescriptionTypeSchema
codeReturn codeobject
dataObjectarrayDeviceData
  createTimeCreation timestring(date-time)
  dataBase64 datastring
  dataTypeData typestring
  deviceIdDevice IDinteger(int64)
  deviceKeyDevice keystring
  directionData type: 1 - UP (uplink), 2 - DOWN (downlink)integer(int32)
  dmDataSaved thing model data JSONstring
  extDataExtended informationobject
  idIDstring
  msgTypeMessage typestring
  productIdProduct IDinteger(int64)
  productKeyProduct keystring
  sendStatusSend status: 0 - Not sent; 1 - Sent; -1 - Send failedinteger(int32)
  sendTimeSend timestring(date-time)
  sourceTypeTypestring
  ticketUnique data valuestring
  updateTimeModification timestring(date-time)
exp1string
msgPrompt messageobject
pageNumCurrent page numberobject
pageSizeItems per pageobject
pagesTotal pagesobject
totalTotal countobject

Response Example:

javascript
{
	"code": {},
	"data": [
		{
			"createTime": "",
			"data": "",
			"dataType": "",
			"deviceId": 0,
			"deviceKey": "",
			"direction": 0,
			"dmData": "",
			"extData": {},
			"id": "",
			"msgType": "",
			"productId": 0,
			"productKey": "",
			"sendStatus": 0,
			"sendTime": "",
			"sourceType": "",
			"ticket": "",
			"updateTime": ""
		}
	],
	"exp1": "",
	"msg": {},
	"pageNum": {},
	"pageSize": {},
	"pages": {},
	"total": {}
}