> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Get File

- Component: `appmixer.telegram.core.GetFile`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.telegram 1.1.2](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.GetFile>

Downloads a file a user sent to the bot and stores it for later steps. Takes the Telegram file ID emitted by the New Message trigger. Telegram only serves files up to 20 MB through this endpoint, and the download link it issues is valid for at least one hour.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Telegram File ID (`telegramFileId`) | text | The _file_id_ of a photo, document or other attachment, as emitted by the New Message trigger. |
| File Name (`fileName`) | text | Override the stored file name. Defaults to the name Telegram reports. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Stored File ID (`fileId`) | string | - |
| File Name (`fileName`) | string | - |
| Telegram File Path (`filePath`) | string | - |
| File Size (Bytes) (`fileSize`) | integer | - |
| Telegram File ID (`telegramFileId`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.telegram.core.GetFile",
  "label": "Get File",
  "description": "Downloads a file a user sent to the bot and stores it for later steps. Takes the Telegram file ID emitted by the New Message trigger. Telegram only serves files up to 20 MB through this endpoint, and the download link it issues is valid for at least one hour.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:telegram"
  },
  "quota": {
    "manager": "appmixer:telegram",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "telegramFileId": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          }
        },
        "required": [
          "telegramFileId"
        ]
      },
      "inspector": {
        "inputs": {
          "telegramFileId": {
            "type": "text",
            "index": 1,
            "label": "Telegram File ID",
            "tooltip": "The <i>file_id</i> of a photo, document or other attachment, as emitted by the New Message trigger."
          },
          "fileName": {
            "type": "text",
            "index": 2,
            "label": "File Name",
            "tooltip": "Override the stored file name. Defaults to the name Telegram reports."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {
          "fileId": {
            "type": "string",
            "title": "Stored File ID",
            "example": "b1a9f0c2-6d1e-4c33-9f7a-2f3d5e6a7b8c"
          },
          "fileName": {
            "type": "string",
            "title": "File Name",
            "example": "report.pdf"
          },
          "filePath": {
            "type": "string",
            "title": "Telegram File Path",
            "example": "documents/file_12.pdf"
          },
          "fileSize": {
            "type": "integer",
            "title": "File Size (Bytes)",
            "example": 24518
          },
          "telegramFileId": {
            "type": "string",
            "title": "Telegram File ID",
            "example": "BQACAgIAAxkBAAIB"
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
