---
name: "getAiVisualBoxInfo"
mode: "kit"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.5" }
---

## getAiVisualBoxInfo

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.5

### Description

Query Vision Box information

### Parameters

`Params`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `params` | `GetAiVisualBoxInfoParams` | Yes | - | Request body |

### Referenced Types

##### `type` GetAiVisualBoxInfoParams

| Property | Type | Description |
| --- | --- | --- |
| `stockId` | `string` | Inventory ID |
| `visionBoxId` | `string` | Vision Box ID (optional) |
| `gid` | `string` | Home gid |

##### `enum` ReportType

| Enum Value | Actual Value | Description |
| --- | --- | --- |
| `ReportType.DAILY` | `1` | Daily report |
| `ReportType.WEEKLY` | `2` | Weekly report |

##### `interface` VisionBoxEvent

| Property | Type | Description |
| --- | --- | --- |
| `eventCode` | `string` | Event code |
| `eventValue` | `string` | Event value |
| `eventType` | `"VisionEventType.PRESET" \\| "VisionEventType.CUSTOM"` | Event type (preset / custom) |

##### `enum` SceneType

| Enum Value | Actual Value | Description |
| --- | --- | --- |
| `SceneType.security` | `0` | Security scenario |
| `SceneType.album` | `1` | Gallery scenario |

##### `enum` VisionEventType

| Enum Value | Actual Value | Description |
| --- | --- | --- |
| `VisionEventType.PRESET` | `0` | Preset event |
| `VisionEventType.CUSTOM` | `1` | Custom event |


### Examples

#### Request example

```typescript
import { getAiVisualBoxInfo } from '@tuya-miniapp/cloud-api';

getAiVisualBoxInfo({ gid: '194137', stockId: 'stock-1', visionBoxId: 'vb-1' })
  .then((box) => console.log(box))
  .catch(console.error);
```

#### Response example

```json
{
  "visionBoxId": "vb-1",
  "visionBoxName": "Living Room Cube",
  "serviceStockId": "stock-1",
  "visionBoxState": 1,
  "generateDescState": 0,
  "reportTypeList": [1],
  "reportLangType": "zh",
  "visionBoxEventList": [],
  "sceneType": 0
}
```
