---
name: "getDpReportLog"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.2" }
title: "getDpReportLog - Get DP Report Logs"
---

## getDpReportLog

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

### Description

Get DP reporting logs (supports pagination)

### Parameters

`Params`

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

### Return Value

Type: `Promise<IGetDpReportLogResponse>`

Log data, including total count, DP log list, and whether there is a next page

##### IGetDpReportLogResponse

| Property | Type | Description |
| --- | --- | --- |
| `total` | `number` | Total count |
| `dps` | `Dp[]` | See DP |
| `hasNext` | `boolean` | Has next page |

### Referenced Types

##### `interface` IGetDpReportLog

| Property | Type | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID |
| `dpIds` | `string` | DP ID, multiple IDs separated by commas |
| `offset` | `number` | Pagination offset |
| `limit` | `number` | Page size, up to 1000 |
| `sortType` | `"DESC" \| "ASC"` | Sort order: 'DESC' (descending, default) or 'ASC' (ascending) |

##### `type` Dp

| Property | Type | Description |
| --- | --- | --- |
| `timeStamp` | `number` | Timestamp format for reported data |
| `dpId` | `number` | DP ID |
| `timeStr` | `string` | Time format converted according to the device time zone: yyyy-MM-dd HH:mm:ss |
| `value` | `string` | DP value |


### Examples

#### Basic usage

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

getDpReportLog({
  devId: 'vdevo169477319679442',
  dpIds: '1,2',
  offset: 0,
  limit: 50,
  sortType: 'DESC',
}).then((res) => {
  console.log('Reported logs:', res);
}).catch((error) => {
  console.error(error);
});
```
