How to upload a video by file_id in Telegram

Before adding a video using a file_id, you first need to obtain the file_id of your video. To do this, follow these steps:

1. Open the bot settings and enable the option “Don't show error when receiving large files”.

2. Go to the Builder section and create a new screen. This screen must be separate from the main flow: no other screens should lead to it, and it should not lead to any other screens.

3. Add the Message component to the screen.

4. Add a component that accepts files: User Input or Fork.

5. In the Fork or User Input component, change the data type to File and specify the Variable name.

6. Add the Assign a variable component.

7. In the Variable name field, enter the same name as in the file receiving component (User Input or Fork). They must match.

8. In the Assign a variable value field, insert the following template:

{{lastUpdate.update.video.file_id}}

9. Save the changes.

10. Open this screen in Telegram. You can do this using the direct link in the Screen tab. Send your video to the bot and wait until the upload is complete.

11. Go to the “Users” section and open your variables. To do this, click on the row with your data in the list of all bot users.

12. Find the variable name that you specified in the Assign a variable component. Copy its value — this is the file_id.

13. Return to the Builder and create a new screen in the main flow.

14. Add the Video component.

15. In the Video link field, paste the obtained file_id.

16. Save the changes.

Done. Now all users will be able to watch your video.

You can also send a video using a Native request.

Before setting up a Native request, obtain the file_id using the instructions above: set up a screen to receive a file and upload your video to the bot.

Instead of the Video component, add a Native request.

Select the SendVideo method.

Paste the request body:

{
"chat_id": "{{this_user.platform_id}}",
"video": "CAABAbIAAcdBAAOwaR23K3VJX5dYYsOtsBdUE3HfjPIAArqOAAK75fBITm4MXIo-ZA82BA"
}

Replace the value of the "video" parameter with your file_id.

Done. The video sent via the request will also be delivered to all users who reach this screen.

To the beginning ↑