# getFileById()

## Syntax

```javascript
getFileById(id: string | number, token?: string)
```

The method gets file information by file ID.

## Parameters

<table><thead><tr><th width="144">Name</th><th width="121">Type</th><th width="108">Required</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string or number</td><td>Yes</td><td>The file id.</td></tr><tr><td>token</td><td>string</td><td>No</td><td>The authentication token response from Eueno API when login. After login, this token was saved in local storage with the name “eueno-token".</td></tr></tbody></table>

## Example

```javascript
import { getFileById } from "@eueno/lib-browser";

const getDetailFile = async (id, token) => {
 try {
   const response = await getFileById(id);
   console.log(response?.data?.data);
 } catch (error) {
   console.log(error);
 }
};
```

Response of example:

```javascript
"data": {
        "id": "216756",
        "name": "2월 하트 월페이퍼_워치_2.jpg",
        "nameNo": 1,
        "url": "https://node1…",
        "backupUrl": "https://node1…",
        "size": "188679",
        "mimeType": "image/jpeg",
        "method": "ENCRYPT",
        "torrentSize": 4,
        "torrentUrl": "https://node1…",
        "backupTorrentUrl": "https://node1…",
        "encryptKey": "71367d669…3a4821",
        "createdAt": "2023-02-28T04:48:54.251Z",
        "updatedAt": "2023-02-28T04:48:57.020Z"
    }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eueno.io/eueno-libraries/eueno-lib-browser/getfilebyid.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
