---
name: "getDevProperty"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.2" }
title: "getDevProperty - Get Custom Device Property Data"
---

## getDevProperty

> [VERSION] @ray-js/ray >= 1.5.2

### Description

Retrieve device property data set via custom settings; write it with saveDevProperty

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `IGetDevProperty` | Yes | Request parameters |

### Return Value

Type: `Promise<IDevPropertyItem[]>`

Array of device property data

##### IDevPropertyItem

| Property | Type | Description |
| --- | --- | --- |
| `bizType` | `number` | Business type |
| `code` | `string` | Custom device property key |
| `devId` | `string` | Device ID |
| `gmtCreate` | `number` | Creation time |
| `gmtModified` | `number` | Last modified time |
| `id` | `string` | Unique identifier |
| `type` | `string` | Configuration rules for saving device properties |
| `value` | `string` | Attribute value |

### Referenced Types

##### `interface` IGetDevProperty

| Property | Type | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID |
| `bizType` | `number` | Business type (custom) |
| `code` | `string` | Device custom attribute key |


### Examples

#### Basic usage

```ts
import { getDevProperty } from '@ray-js/ray';

getDevProperty({
  devId: 'your_device_id',
  bizType: 0,
  code: 'hello',
}).then((response) => {
  console.log('Device property:', response);
}).catch((err) => {
  console.error(err);
});
```
