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

## getAlbumSetting

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

### Method signature

```typescript
getAlbumSetting(params: GetAlbumSettingReq)
```

### Description

Time Album settings get API

### Parameters

`Params`

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

### Return Value

Type: `Promise<TimeAlbumSettingDto>`

Album settings (TimeAlbumSettingDto: includes primary key id on TimeAlbumSettingPayload; the minituya response table has formatting errors—use types as the source of truth)

### Referenced Types

##### `type` GetAlbumSettingReq

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `stockId` | `string` | Yes | Inventory ID |
| `gid` | `string` | Yes | Home ID |

##### `interface` TimeAlbumSettingDto

| Property | Type | Description |
| --- | --- | --- |
| `id` | `string` | Primary key ID |
| `albumName` | `string` | Album name |
| `enableStatus` | `0 \| 1` | Enabled status |
| `timedCaptureConfig` | `string[]` | Scheduled capture settings |
| `smartCaptureConfig` | `VisionBoxEvent[]` | Smart capture settings |

##### `enum` VisionEventType

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

##### `type` VisionBoxEvent

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


### Valid Values

##### `TimeAlbumSettingDto.enableStatus`

| Value | Description | Since |
| --- | --- | --- |
| `0` | - | - |
| `1` | - | - |

##### `VisionEventType`

| Value | Description | Since |
| --- | --- | --- |
| `0` | Preset event | - |
| `1` | Custom event | - |


### Examples

#### Request example

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

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

#### Response example

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