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

## getSmartEventSwitchState

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

### Description

Query smart event switch

### Parameters

`Params`

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

### Referenced Types

##### `type` GetSmartEventSwitchStateParams

| Property | Type | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID |
| `serviceBusinessType` | `"aiSmartFreeEvent" \| "aiSmartFreeEventImage2Text"` | Smart event business type |


### Examples

#### Request example

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

getSmartEventSwitchState({
  devId: 'vdevo1',
  serviceBusinessType: 'aiSmartFreeEvent',
})
  .then((r) => console.log(r))
  .catch(console.error);
```

#### Response example

```json
{ "hadService": true, "switchState": 1, "extContent": "{}" }
```
