---
name: "getPetEatingList"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.6.27" }
title: "getPetEatingList - Get pet eating records."
---

## getPetEatingList

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

### Description

Get paginated pet feeding records

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `GetPetEatingList` | Yes | Request parameters: ownerId, pagination pageNo/pageSize, optional time range and dataType, etc. |

### Return Value

Type: `Promise<PetEatingResult>`

Promise that resolves to paginated data (total, has next page, record list, etc.)

##### PetEatingResult

| Property | Type | Description |
| --- | --- | --- |
| `totalCount` | `number` | Total record count |
| `pageNo` | `number` | Page number |
| `pageSize` | `number` | Page size |
| `hasNext` | `boolean` | Whether there is a next page |
| `data` | `Object[]` | Feeding information |

##### PetEatingResult.data[] properties

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `recordNo` | `string` | Yes | - | Record No. |
| `devId` | `string` | No | - | Device ID |
| `deviceName` | `string` | No | - | Device name (snapshot) |
| `ownerId` | `string` | Yes | - | Home ID |
| `roomId` | `string` | No | - | Room ID (snapshot) |
| `roomName` | `string` | No | - | Room name (snapshot) |
| `recordTime` | `number` | Yes | - | Record time, unit: milliseconds |
| `isEncrypted` | `0 \| 1` | Yes | - | Whether the file is encrypted: 0 - No, 1 - Yes |
| `videoCoverDisplay` | `string` | Yes | - | Accessible URL for the video cover, valid for 30-60 min |
| `videoDisplay` | `string` | Yes | - | Accessible video URL, valid for 30-60 min |
| `videoDuration` | `number` | Yes | - | Video duration, in seconds |
| `petAction` | `string` | Yes | - | Behavior |
| `pets` | `Object[]` | No | - | Associated pet information |


##### PetEatingResult.data[].pets[] properties

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `petId` | `number` | Yes | - | Pet ID |
| `petName` | `string` | Yes | - | Pet name |


### Referenced Types

##### `type` GetPetEatingList

| Property | Type | Description |
| --- | --- | --- |
| `ownerId` | `string` | Home ID |
| `devId` | `string` | Device ID (query by device UUID) |
| `startTime` | `number` | Query start time, unit: milliseconds |
| `endTime` | `number` | Query end time, unit: milliseconds |
| `pageNo` | `number` | Page number, starting from 1 |
| `pageSize` | `number` | Page size |
| `dataType` | `string` | Business data type |


### Examples

#### Request example

```typescript
import { getPetEatingList } from '@ray-js/ray';

getPetEatingList({
  ownerId: 'xxxx',
  pageNo: 1,
  pageSize: 10,
});
```

#### Response example

```json
{
  "totalCount": 100,
  "pageNo": 1,
  "pageSize": 10,
  "hasNext": true,
  "data": [
    {
      "recordNo": "22",
      "devId": "vdevo123456",
      "ownerId": "xxxx",
      "isEncrypted": 0,
      "videoCoverDisplay": "https://xxxx/xxxx",
      "videoDisplay": "https://xxxx/xxxx",
      "petAction": "eating",
      "pets": [
        {
          "petId": 2,
          "petName": "Fubao"
        }
      ]
    }
  ]
}
```
