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

## getAlbumSetting

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

### 描述

时光相册配置获取 api

### 参数

`Params`

| 参数 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `params` | `GetAlbumSettingReq` | 是 | - | 请求体 |

### 引用对象

##### `type` GetAlbumSettingReq

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `stockId` | `string` | 库存 id |
| `gid` | `string` | 家庭 id |

##### `interface` VisionBoxEvent

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `eventCode` | `string` | 事件编码 |
| `eventValue` | `string` | 事件取值 |
| `eventType` | `"VisionEventType.PRESET" \\| "VisionEventType.CUSTOM"` | 事件类型（预置 / 自定义） |

##### `enum` VisionEventType

| 枚举值 | 实际值 | 描述 |
| --- | --- | --- |
| `VisionEventType.PRESET` | `0` | 预置事件 |
| `VisionEventType.CUSTOM` | `1` | 自定义事件 |


### 示例代码

#### 请求示例

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

getAlbumSetting({ stockId: '1', gid: '194137' })
  .then((cfg) => console.log(cfg))
  .catch(console.error);
```

#### 返回示例

```json
{
  "id": "album-1",
  "albumName": "宝宝房",
  "enableStatus": 1,
  "timedCaptureConfig": ["12:00"],
  "smartCaptureConfig": [
    { "eventCode": "person", "eventValue": "1", "eventType": 0 }
  ]
}
```
