> For the complete documentation index, see [llms.txt](https://docs.watbot.ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.watbot.ru/rabota-s-api/ssylki-na-mediafaily.md).

# Ссылки на медиафайлы

## Получить прямую ссылку на медиафайл

<mark style="color:green;">`POST`</mark> `https://watbot.ru/api/v1/decodeShortLink`

Этот метод позволяет получить прямую ссылку на фото/видео/аудио, отправленное пользователем в бот, чтобы в дальнейшем можно было переслать данный медиафайл.

**Request Body**

| Name  | Type   | Description                                                            |
| ----- | ------ | ---------------------------------------------------------------------- |
| url\* | string | Короткая ссылка на медиафайл, хранящаяся в пользовательской переменной |

{% tabs %}
{% tab title="200 Запрос успешно обработан." %}

```
{
  "data": {
    "url": "https://storage.watbot.ru/bots/46405/blocks/1471350/3e64a9a8-d7d8-4b9f-8d9d-9a580695a4e4.jpeg?expires_at=1720383587&s=xhogr3O7C5M7V3KmpE5nIL5wqmMBnSDpXw64HgsXEsD7sk5OCl4DWbwZ4dlQ95Ab&sign=cfd42ee3299811ff1a7e3367743d54640aa16490930f9795011c2cceae1f6d04"
  }
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity" %}

```
{
  "message": "The given data was invalid.",
  "errors": {
    "url": [
      "Поле url имеет ошибочный формат URL."
    ]
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.watbot.ru/rabota-s-api/ssylki-na-mediafaily.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.
