Skip to content

Query Device Historical Event Logs

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

Request Method:GET

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

Response Data Type:*/*

API Description: Event log 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)
endDateTimpEnd time (timestamp, in milliseconds)queryfalseinteger(int64)
eventTypeEvent type (Offline:0, Online:1, Reconnect:2, Information:3, Alert:4, Fault:5, Reset:6)queryfalsestring
languageLanguage: CN/EN (default: CN)queryfalsestring
pageNumPage number (default: 1)queryfalseinteger(int32)
pageSizePage size, number of items per page (default: 10)queryfalseinteger(int32)

Response Status:

Status CodeDescriptionSchema
200OKActionResult«List«DeviceEventVO»»
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
dataObjectarrayDeviceEventVO
  abIdabIdinteger(int64)
  createTimeStart timestring
  deviceKeyDevice keystring
  eventCodeEvent codestring
  eventNameEvent namestring
  eventTypeEvent typestring
  extDataExtended informationobject
  ididstring
  outputDataOutput parametersstring
  packetIdpacketIdinteger(int32)
  productKeyProduct keystring
  ticketticketstring
exp1string
msgPrompt messageobject
pageNumCurrent page numberobject
pageSizeItems per pageobject
pagesTotal pagesobject
totalTotal countobject

Response Example:

javascript
{
	"code": {},
	"data": [
		{
			"abId": 0,
			"createTime": "",
			"deviceKey": "",
			"eventCode": "",
			"eventName": "",
			"eventType": "",
			"extData": {},
			"id": "",
			"outputData": "",
			"packetId": 0,
			"productKey": "",
			"ticket": ""
		}
	],
	"exp1": "",
	"msg": {},
	"pageNum": {},
	"pageSize": {},
	"pages": {},
	"total": {}
}