# Экспорт данных

## Экспорт данных

API поддерживает экспорт обработанных данных в различные форматы для удобного использования.

### Поддерживаемые форматы экспорта

* **TXT** - Простой текстовый формат
* **DOCX** - Документ Microsoft Word

### Доступные продукты для экспорта

Следующие продукты поддерживают экспорт в TXT и DOCX форматы:

* `transcript` - Расшифровка речи
* `timecodes` - Временные метки
* `summary` - Краткое изложение
* `quiz` - Тесты и вопросы

### Как использовать экспорт

Для экспорта добавьте параметр `format` к URL любого из поддерживаемых эндпоинтов:

**Экспорт в TXT:**

```bash
GET /jobs/{job_id}/transcript/?format=txt
GET /jobs/{job_id}/timecodes/?format=txt  
GET /jobs/{job_id}/summary/?format=txt
GET /jobs/{job_id}/quiz/?format=txt
```

**Экспорт в DOCX:**

```bash
GET /jobs/{job_id}/transcript/?format=docx
GET /jobs/{job_id}/timecodes/?format=docx
GET /jobs/{job_id}/summary/?format=docx  
GET /jobs/{job_id}/quiz/?format=docx
```

### Примеры запросов экспорта

#### Экспорт расшифровки в DOCX

```bash
curl -X GET "https://your-domain.com/jobs/123e4567-e89b-12d3-a456-426614174000/transcript/?format=docx" \
  -H "x-api-key: your-api-key" \
  -o transcript.docx
```

#### Экспорт временных меток в TXT

```bash
curl -X GET "https://your-domain.com/jobs/123e4567-e89b-12d3-a456-426614174000/timecodes/?format=txt" \
  -H "x-api-key: your-api-key" \
  -o timecodes.txt
```

#### Экспорт краткого изложения в DOCX

```bash
curl -X GET "https://your-domain.com/jobs/123e4567-e89b-12d3-a456-426614174000/summary/?format=docx" \
  -H "x-api-key: your-api-key" \
  -o summary.docx
```

#### Экспорт квиза в TXT

```bash
curl -X GET "https://your-domain.com/jobs/123e4567-e89b-12d3-a456-426614174000/quiz/?format=txt" \
  -H "x-api-key: your-api-key" \
  -o quiz.txt
```

### Ответ при экспорте

При использовании параметра `format`, API возвращает файл для скачивания вместо JSON ответа:

* **Content-Type**:
  * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (для DOCX)
  * `text/plain; charset=utf-8` (для TXT)
* **Content-Disposition**: `attachment; filename="название_файла.расширение"`


---

# 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://visaver.gitbook.io/visaver-api/dokumentaciya/eksport-dannykh.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.
