detectDeviceSnap (Device snapshot detection)
detectDeviceSnap: Device snapshot detection
What it does
Captures one frame from a bound device channel and runs cloud AI detection on that image. Use this when you want the platform to grab the scene instead of supplying your own URL or Base64.
This API detects humans, vehicles, animals, and packages.
The device must be online and bound to your developer account. Respect snapshot rate limits similar to setDeviceSnapEnhanced; do not call in a tight loop.
Request URL
POST https://openapi-[DataCenter].easy4ip.com/openapi/detectDeviceSnap
Minimum permission
Administrator accessToken; the device must be on your developer account.
Request parameters
| Parameter name | Parameter type | Required or not | Parameter description |
|---|---|---|---|
| token | String | Yes | Administrator accessToken |
| deviceId | String | Yes | Device serial number |
| channelId | String | Yes | Channel ID |
Common request fields and signing: Signing conventions and Common request payload.
Sample input
{
"id": "98a7a257-c4e4-4db3-a2d3-d97a3836b87c",
"system": {
"ver": "1.0",
"appId": "lcdxxxxxxxxx",
"sign": "b7e5bbcc6cc07941725d9ad318883d8e",
"time": 1599013514,
"nonce": "fbf19fc6-17a1-4f73-a967-75eadbc805a2"
},
"params": {
"token": "At_12345678901234567890123456789012",
"deviceId": "TESTQWERXXXX",
"channelId": "0"
}
}
Response data fields
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| url | String | Image URL |
| detectResult | Boolean | Whether a target was detected |
| targets | Array | Detected targets |
| targets[].targetRegion | Object | Target region in px |
| targets[].targetRegion.x | Double | X coordinate |
| targets[].targetRegion.width | Double | Width |
| targets[].targetRegion.height | Double | Height |
| targets[].targetType | String | Target type: human, vehicle, animal, box |
| targets[].confidence | Integer | Confidence score |
Sample output
{
"result": {
"msg": "Success.",
"code": "0",
"data": {
"url": "https://example.com/snap/sample.jpg",
"detectResult": true,
"targets": [
{
"targetRegion": {
"x": 120.0,
"width": 64.0,
"height": 96.0
},
"targetType": "human",
"confidence": 85
}
]
}
},
"id": "98a7a257-c4e4-4db3-a2d3-d97a3836b87c"
}
Error codes
Offline, unbound devices or snapshot failures may return DV family codes. See Error codes.
