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

## getAiVisualMessageKey

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

### 描述

获取 ipc 业务数据密钥（用于消息图片等）

### 参数

`Params`

| 参数 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `params` | `GetAiVisualMessageKey[]` | 是 | - | GetAiVisualMessageKey 对象数组 |

##### GetAiVisualMessageKey 的属性

| 属性 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `businessNo` | `string` | 是 | - | 业务字段 |
| `deviceId` | `string` | 是 | - | 设备 id |
| `time` | `number` | 是 | - | 需查询数据的起始时间 |
| `homeId` | `string` | 是 | - | 家庭 id |


### 示例代码

#### 请求示例

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

getAiVisualMessageKey([
  { businessNo: 'bn-1', deviceId: 'vdevo1', time: 1700000000000, homeId: '194137' },
])
  .then((res) => console.log(res))
  .catch(console.error);
```

#### 返回示例

```json
[{ "businessNo": "bn-1", "businessKey": "******" }]
```
