Экспорт и PDF
Экспорт CSV / JSON и ссылки для печати ответов.
- POST /exports считает подходящие ответы (до 10 000; больше — сузьте даты) и возвращает одноразовый download_url на 15 минут.
- Сам экспорт хранится 24 часа; GET /exports/{id} выдаёт новую ссылку, пока он существует.
- Ячейки CSV защищены от внедрения формул. Персональные данные включаются только с responses:pii.
- POST /responses/{id}/print_link возвращает ссылку на 10 минут на страницу для печати (сохраните как PDF); функция тарифа pdfExport.
post/responses/{response_id}/print_link
Create a printable (PDF) link for a response createPrintLink
Scope: responses:read · Тариф: Pro и выше · Инструмент MCP: get_print_pdf_url · поддерживает Idempotency-Key
A signed URL to the print view, valid 10 minutes, bound to this response and to the personal-data level of the key. Open it and save as PDF. Plan feature `pdfExport`. 30 per hour.
Параметры
| Имя | Где | Тип | Обязательный | Описание |
|---|---|---|---|---|
response_id | path | rsp_… id | да |
curl -X POST https://mform.md/api/public/v1/responses/rsp_7Tn3Wq1Lz5B/print_link \
-H "Authorization: Bearer $MFORM_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"Ответ 201
{
"object": "print_link",
"response_id": "rsp_7Tn3Wq1Lz5B",
"url": "https://example.com/webhooks/mform",
"personal_data_included": false,
"expires_at": "2026-11-27T10:15:00Z"
}post/exports
Export the responses of a form (CSV or JSON) createExport
Scope: responses:read · Тариф: Free и выше · Инструмент MCP: export_responses · поддерживает Idempotency-Key
Counts the matching responses (up to 10,000; above that narrow the dates) and returns a single-use `download_url` valid 15 minutes; the file is built when the link is opened. CSV cells are protected against formula injection. Personal data is included only if the key has `responses:pii`. 10 per hour per workspace.
Параметры
| Имя | Где | Тип | Обязательный | Описание |
|---|---|---|---|---|
Idempotency-Key | header | string | нет | Any unique string (a UUID). The first result is kept 24 hours and replayed for the same key and body (`Idempotent-Replayed: true`); a different body returns `409 idempotency_key_reused`. |
Тело (JSON)
| Имя | Тип | Обязательный | Описание |
|---|---|---|---|
form_id | form_… id | да | |
format | "csv" | "json" | нет | |
status | "completed" | "in_progress" | "abandoned" | "all" | нет | |
created_after | string (date-time) | нет | |
created_before | string (date-time) | нет |
curl -X POST https://mform.md/api/public/v1/exports \
-H "Authorization: Bearer $MFORM_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"form_id":"form_8Hq2LmZ71cX"}'Ответ 201
{
"id": "exp_8Hq2LmZ71cXa4Rt9Pq7W",
"object": "export",
"form_id": "form_8Hq2LmZ71cX",
"format": "csv",
"status": "ready",
"rows": 1,
"personal_data_included": false,
"download_url": "https://mform.md/api/public/v1/…?t=…",
"download_url_expires_at": "2026-11-27T10:15:00Z",
"expires_at": "2026-11-27T10:15:00Z",
"created_at": "2026-11-27T10:15:00Z"
}get/exports/{export_id}
Retrieve an export getExport
Scope: responses:read · Тариф: Free и выше · Инструмент MCP: не доступна через MCP
Exports are kept 24 hours. The download link is single-use; this call issues a fresh one while the export exists.
Параметры
| Имя | Где | Тип | Обязательный | Описание |
|---|---|---|---|---|
export_id | path | exp_… id | да |
curl https://mform.md/api/public/v1/exports/exp_8Hq2LmZ71cXa4Rt9Pq7W \
-H "Authorization: Bearer $MFORM_API_KEY"Ответ 200
{
"id": "exp_8Hq2LmZ71cXa4Rt9Pq7W",
"object": "export",
"form_id": "form_8Hq2LmZ71cX",
"format": "csv",
"status": "ready",
"rows": 1,
"personal_data_included": false,
"download_url": "https://mform.md/api/public/v1/…?t=…",
"download_url_expires_at": "2026-11-27T10:15:00Z",
"expires_at": "2026-11-27T10:15:00Z",
"created_at": "2026-11-27T10:15:00Z"
}