D
D
DmitryLife2022-03-14 20:55:35
PHP
DmitryLife, 2022-03-14 20:55:35

Why is the video not being sent by file_id?

Good afternoon.

The task is to send a Video Note (round video). To do this, there is an API method sendVideoNote

To get the file_id, I send my file to the bot, it returns JSON to me, where in json.message.video.file_id, the required ID lies.

Now I send a request like ' https://api.telegram.org/bot ' .'TOKEN' . '/sendVideoNote' + parameters ['chat_id'=>num,'video_note' => file_id]

But silence in response. Error 400.
Sent both through the server and through Postman. All requests go away, this one doesn't. Moreover, if video_note is specified as a simple link to an mp4 video, it is displayed as a regular video (but I need a round one, so I think it needs to be through file_id)

Where could I be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DmitryLife, 2022-03-16
@DmitryLife

Regarding the file_id Telegram, inspected that files are sent only if it was uploaded to this particular chat bot. (That is, you need to send documents / photos / videos to the bot to which you want to send these files later, return the file_id of this dock, and then you can use it)
For some reason, it did not work to load by URL. Writes an incorrect sending format.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question