Get Inspection Events

Last Updated on : 2023-06-21 07:13:03download

Get the list of inspection events reported by the inspection devices linked with a specified asset. You can query the inspection events in the last 31 days.

API address

GET: /v1.0/iot-03/store-inspection/assets/{asset_id}/events

Request parameter

Parameter name Type IN Required Description
asset_id String uri true The asset ID.
device_ids String query false The list of device IDs separated with commas (,). Maximum value: 20. The events of each device are displayed one by one on pages.
event_types String query false The types of inspection events. Multiple IDs are separated with commas (,).
  • ai_no_helmet: not wearing a helmet.
  • ai_no_suit: not wearing work clothes.
  • ai_enter_area: intrusion.
  • ai_sleep: sleep during working time.
  • ai_chanl_block: channel blocked.
  • ai_calling: phone calls.
  • ai_smoking: smoking.
start_time Long query false The 13-bit timestamp of the start time of an exception. When end_time exists, start_time must be set and earlier than end_time. If the value is empty, you will query the data of the last 31 days.
end_time Long query false The 13-bit timestamp of the end time of an exception. When start_time exists, end_time must be set and later than start_time. If the value is empty, you will query the data of the last 31 days.
page_size Integer query false The number of items returned on each page. Default value: 20. The value must be a positive integer and the maximum value is 100.
page_no Integer query false The page number. Default value: 1. The value must be a positive integer.

Return parameter

Parameter name Type Description
result Page The returned result.

Description of result

Parameter name Type Description
total Long The total entries of data that meets the criteria.
list List The list of inspection events.
has_more Boolean Indicates whether there is another page. Valid values: true: yes. false: no.

Description of list

Parameter name Type Description
name String The name of a specified inspection event.
event_time Long The 13-bit timestamp of the occurrence time.
event_type String The type of event.
  • ai_no_helmet: not wearing a helmet.
  • ai_no_suit: not wearing work clothes.
  • ai_enter_area: intrusion.
  • ai_sleep: sleep during working time.
  • ai_chanl_block: channel blocked.
  • ai_calling: phone calls.
  • ai_smoking: smoking.
device_id String The ID of a specified inspection device.
device_name String The name of a specified inspection device.
event_id String The ID of a specified inspection event.
files List The list of files related with inspection events.

Description of files

Parameter name Type Description
file_desc String The description of the files.
image_url String A pre-signed URL accessible to the event file, valid for 2 hours.

Request example

GET: /v1.0/iot-03/store-inspection/assets/142310607698275****/events?device_ids=6cf46c2ba4e7b25536****,vdevo16284993087****

Return example

{ "result": { "has_more": false, "list": [ { "device_id": "6cf46c2ba4e7b25536****", "device_name": "PTZ Camera with Dual Light-SC084-WN04-400W-Beta", "event_id": "446186****", "event_time": 1628580350000, "event_type": "ai_enter_area", "files": [ { "file_desc": "bigImage", "image_url": "https://ty-cn-storage30-1254153901.cos.ap-shanghai.myqcloud.com/3a1f04-38505253-a1b2f8a7c1845059/unify/1628579799.jpeg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDopcCYgw0qRoyV5qfKjvg2pPkqESnb5zI%26q-sign-time%3D1628587878%3B1628595078%26q-key-time%3D1628587878%3B1628595078%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3Dbfd91dfd4c93a49d20daff931e025aa3d632****" }, { "file_desc": "smallImage", "image_url": "https://ty-cn-storage30-1254153901.cos.ap-shanghai.myqcloud.com/3a1f04-38505253-a1b2f8a7c1845059/unify/1628579799.jpeg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDopcCYgw0qRoyV5qfKjvg2pPkqESnb5zI%26q-sign-time%3D1628587878%3B1628595078%26q-key-time%3D1628587878%3B1628595078%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3Dbfd91dfd4c93a49d20daff931e025aa3d632****" } ], "name": "ai_enter_area" }, { "device_id": "6cf46c2ba4e7b25536****", "device_name": "PTZ Camera with Dual Light-SC084-WN04-400W-Beta", "event_id": "446183****", "event_time": 1628571312000, "event_type": "ai_enter_area", "files": [ { "file_desc": "bigImage", "image_url": "https://ty-cn-storage30-1254153901.cos.ap-shanghai.myqcloud.com/3a1f04-38505253-a1b2f8a7c1845059/unify/1628568170.jpeg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDopcCYgw0qRoyV5qfKjvg2pPkqESnb5zI%26q-sign-time%3D1628587878%3B1628595078%26q-key-time%3D1628587878%3B1628595078%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3Dccafd56e45904bd50d3aa93b401b1e6e8a97****" }, { "file_desc": "smallImage", "image_url": "https://ty-cn-storage30-1254153901.cos.ap-shanghai.myqcloud.com/3a1f04-38505253-a1b2f8a7c1845059/unify/1628568170.jpeg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDopcCYgw0qRoyV5qfKjvg2pPkqESnb5zI%26q-sign-time%3D1628587878%3B1628595078%26q-key-time%3D1628587878%3B1628595078%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3Dccafd56e45904bd50d3aa93b401b1e6e8a97****" } ], "name": "ai_enter_area" }, { "device_id": "6cf46c2ba4e7b25536****", "device_name": "PTZ Camera with Dual Light-SC084-WN04-400W-Beta", "event_id": "446182****", "event_time": 1628566274000, "event_type": "ai_enter_area", "files": [ { "file_desc": "bigImage", "image_url": "https://ty-cn-storage30-1254153901.cos.ap-shanghai.myqcloud.com/3a1f04-38505253-a1b2f8a7c1845059/unify/1628565175.jpeg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDopcCYgw0qRoyV5qfKjvg2pPkqESnb5zI%26q-sign-time%3D1628587878%3B1628595078%26q-key-time%3D1628587878%3B1628595078%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3D26dcb7cedb6efb97dce68c34e7694b73b088****" }, { "file_desc": "smallImage", "image_url": "https://ty-cn-storage30-1254153901.cos.ap-shanghai.myqcloud.com/3a1f04-38505253-a1b2f8a7c1845059/unify/1628565175.jpeg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDopcCYgw0qRoyV5qfKjvg2pPkqESnb5zI%26q-sign-time%3D1628587878%3B1628595078%26q-key-time%3D1628587878%3B1628595078%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3D26dcb7cedb6efb97dce68c34e7694b73b088****" } ], "name": "ai_enter_area" }, { "device_id": "vdevo16284993087****", "device_name": "Security Camera-vdevo" "event_id": "446164****", "event_time": 1628499988000, "event_type": "ai_no_suit", "files": [ { "file_desc": "bigImage", "image_url": "https://airtake-private-data-1254153901.cos.ap-shanghai.myqcloud.com/groot-test-tuya/image/21a3c1cefff5df476e8c4609e8d330e1.jpeg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDopcCYgw0qRoyV5qfKjvg2pPkqESnb5zI%26q-sign-time%3D1628587878%3B1628595078%26q-key-time%3D1628587878%3B1628595078%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3D9fb2a1457017473d2c1fe04e0ccbf4926edd****" }, { "file_desc": "smallImage", "image_url": "https://airtake-private-data-1254153901.cos.ap-shanghai.myqcloud.com/groot-test-tuya/image/21a3c1cefff5df476e8c4609e8d330e1.jpeg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDopcCYgw0qRoyV5qfKjvg2pPkqESnb5zI%26q-sign-time%3D1628587878%3B1628595078%26q-key-time%3D1628587878%3B1628595078%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3D9fb2a1457017473d2c1fe04e0ccbf4926edd****" } ], "name": "ai_no_suit" } ], "total": 4 }, "success": true, "t": 1628587878504 }

Error code

For more information, see error code.