---
name: "getDeviceThingModelInfo"
mode: "kit"
versionRequirements:
  - { name: "DeviceKit", version: "2.0.7" }
platform:
  - "iOS"
  - "Android"
async: true
---

## getDeviceThingModelInfo

> [VERSION] DeviceKit >= 2.0.7

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Get device thing model information. The success callback returns GetDeviceThingModelInfoResponse, which includes details such as modelId, productId, and services.

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `devId` | `string` | Yes | - | `2.0.7` | Device ID |
| `complete` | `() => void` | No | - | - | Complete callback (executed on success or failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | - | Success callback |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `modelId` | `string` | `3.3.0` | Thing Model ID |
| `productId` | `string` | `3.3.0` | Product ID |
| `productVersion` | `string` | `3.3.0` | Product version |
| `services` | `ServiceModel[]` | `3.3.0` | Service list |
| `extensions` | `Record<string, any>` | `3.3.0` | Thing model extension properties in key-value pairs, used to carry additional information beyond the standard model |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extension |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Extended error code |
| `errorMsg` | `string` | Extended error message |


### Referenced Types

##### `interface` ServiceModel

| Property | Type | Required | Since | Description |
| --- | --- | --- | --- | --- |
| `properties` | `ThingProperty[]` | Yes | `3.3.0` | Property list |
| `actions` | `ThingAction[]` | Yes | `3.3.0` | Action list |
| `events` | `ThingEvent[]` | Yes | `3.3.0` | Event list |

##### `type` ThingProperty

| Property | Type | Required | Since | Description |
| --- | --- | --- | --- | --- |
| `abilityId` | `number` | Yes | `3.3.0` | Property ID |
| `accessMode` | `string` | Yes | `3.3.0` | Access mode: ro=read-only, wr=write-only, rw=read-write |
| `typeSpec` | `Record<string, any>` | Yes | `3.3.0` | Property type specification (JSON structure with definitions for data type, value range, etc.) |
| `defaultValue` | `Record<string, any>` | Yes | `3.3.0` | Default value |
| `code` | `string` | Yes | `3.3.0` | Identifier code |

##### `type` ThingAction

| Property | Type | Required | Since | Description |
| --- | --- | --- | --- | --- |
| `abilityId` | `number` | Yes | `3.3.0` | Action ID |
| `inputParams` | `Record<string, any>[]` | Yes | `3.3.0` | List of action input parameter specifications; each item is a parameter definition object (including fields such as code and typeSpec). |
| `outputParams` | `Record<string, any>[]` | Yes | `3.3.0` | List of action output parameter specifications; each item is a parameter definition object (including fields such as code and typeSpec). |
| `code` | `string` | Yes | `3.3.0` | Identifier code |

##### `type` ThingEvent

| Property | Type | Required | Since | Description |
| --- | --- | --- | --- | --- |
| `abilityId` | `number` | Yes | `3.3.0` | Event ID |
| `outputParams` | `Record<string, any>[]` | Yes | `3.3.0` | List of event output parameter specifications; each item is a parameter definition object (including fields such as code and typeSpec). |
| `code` | `string` | Yes | `3.3.0` | Identifier code |
