---
name: "getDpsInfos"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.2" }
title: "getDpsInfos - Get All DP Information of a Device"
---

## getDpsInfos

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

### Description

Get all DP information for a device, typically to retrieve DP names, used with updateDpName

### Parameters

`Params`

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

### Return Value

Type: `Promise<IGetDpsInfosResponse[]>`

Array of DP info; each item contains code, dpId, value, time, type, name

##### IGetDpsInfosResponse

| Property | Type | Description |
| --- | --- | --- |
| `code` | `string` | DP Code |
| `dpId` | `number` | DP ID |
| `value` | `string` | DP value |
| `name` | `string` | DP name |
| `time` | `number` | DP last reported time |
| `type` | `string` | DP type |

### Referenced Types

##### `interface` IGetDpsInfos

| Property | Type | Description |
| --- | --- | --- |
| `gwId` | `string` | Gateway ID; for directly connected devices, same as devId. For sub-devices, pass the gateway's device ID |
| `devId` | `string` | Device ID |


### Examples

#### Basic usage

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

getDpsInfos({
  devId: 'vdevo169477319679442',
  gwId: 'vdevo169477319679442',
}).then((res) => {
  console.log('DP info:', res);
}).catch((error) => {
  console.error(error);
});
```
