---
name: "getTranslateRecords"
mode: "kit"
versionRequirements:
  - { name: "AIKit", version: "0.0.1" }
  - { name: "@ray-js/ray", version: "1.6.29" }
platform:
  - "iOS"
  - "Android"
async: true
title: "getTranslateRecords"
---

## getTranslateRecords

> [VERSION] AIKit >= 0.0.1 | @ray-js/ray >= 1.6.29

> [PLATFORM] iOS, Android

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

### Description

Get AI translation record list

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `deviceId` | `string` | No | - | `0.0.1` | Device ID; omit to fetch all devices |
| `lastId` | `number` | No | - | `0.0.1` | ID of the last record; omit or set to 0 for no limit |
| `pageSize` | `number` | No | - | `0.0.1` | Page size; omit or set to 0 for no pagination (all) |
| `complete` | `() => void` | No | - | - | Completion callback (executed on both success and failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `list` | `TranslateRecord[]` | `0.0.1` | List |

#### 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` | Error extension code |
| `errorMsg` | `string` | Error extension message |


### Referenced Types

##### `interface` TranslateRecord

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `translateId` | `number` | `0.0.1` | Translation record ID |
| `deviceId` | `string` | `0.0.1` | Device ID |
| `originalLanguage` | `string` | `0.0.1` | Source language |
| `targetLanguage` | `string` | `0.0.1` | Target language |
| `recordId` | `string` | `0.0.1` | Real-time transcription record ID |
| `agentId` | `string` | `0.0.1` | Real-time transcription agent ID |
| `name` | `string` | `0.0.1` | File name |
| `beginAt` | `number` | `0.0.1` | Recording start time, timestamp in seconds |
| `endAt` | `number` | `0.0.1` | End-of-recording duration (ms) |
| `duration` | `number` | `0.0.2` | Recording duration |
| `visit` | `boolean` | `0.0.1` | Whether already clicked |
| `remove` | `boolean` | `0.0.1` | Whether removed (moved to trash) |
| `wavFilePath` | `string` | `0.0.1` | Recording WAV file path |
| `summaryStatus` | `number` | `0.0.1` | Summary status: 0 Not summarized, 1 In progress, 2 Completed, 3 Failed |


### Examples

#### Basic usage

```tsx
import { ai } from '@ray-js/ray'

const { getTranslateRecords } = ai;

getTranslateRecords({
  success: (result) => {
    console.log('getTranslateRecords success', result);
  },
  fail: (error) => {
    console.log('getTranslateRecords fail', error.errorMsg);
  },
});
```
