> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scanova.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 导出表单响应

> POST /forms/export/

将表单响应下载为 CSV 或 Excel 文件 —— 可以是单个表单的响应，也可以是链接到一组 QR 码的所有表单的响应。

<Note>
  需要具有 `MANAGEMENT_API`（或 `MANAGEMENT_API_SANDBOX`）配额和 `LEAD_GENERATION_ENTRY_CAN_VIEW` 权限的管理 API 密钥，作为原始 `Authorization` 标头值发送 —— 参见[管理 API 概述](/zh/api-reference/management-api/overview)。
</Note>

<ParamField body="form_id" type="string">
  导出单个表单的响应，以其自身的问题架构作为列标题。与 `qr_ids` 互斥。
</ParamField>

<ParamField body="qr_ids" type="array">
  导出链接到这些 QR `qrid` 的每个表单（及已转换的潜在客户列表）的响应 —— 来自多个表单的问题会合并为组合列。与 `form_id` 互斥。
</ParamField>

<ParamField query="file_format" type="string" default="xls">
  `csv`、`xls` 或 `xlsx`。
</ParamField>

<ParamField query="from" type="string">
  仅包含在此日期（含）之后创建的响应（`YYYY-MM-DD`）。
</ParamField>

<ParamField query="to" type="string">
  仅包含在此日期（含）之前创建的响应（`YYYY-MM-DD`）。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.scanova.io/forms/export/?file_format=csv&from=2026-08-01&to=2026-08-31' \
    --header 'Authorization: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{ "form_id": "F8a9b0c1d2e3f4g5h" }' \
    --output responses.csv
  ```
</RequestExample>

响应是文件下载（`Content-Type: text/csv`，或 XLS/XLSX 的 MIME 类型），而非 JSON，带有 `Content-Disposition: attachment`。列包括 `Tracking ID, QR Code, Created, Skip, Source`，每个问题一列，然后是八个追踪结尾列：`Scan Time, Scan Day, Device Type, City, Country Code, Country Name, Postal Code, Region`。

如果同时提供或都未提供 `form_id`/`qr_ids`，则返回 `400`：

```json 400 theme={null}
{ "detail": "form_id and qr_ids are mutually exclusive" }
```

```json 400 theme={null}
{ "detail": "Either form_id or qr_ids is required" }
```

如果 `file_format` 不是 `csv`、`xls` 或 `xlsx`，则返回 `400`：

```json 400 theme={null}
{ "detail": "Unknown file format" }
```

## 相关内容

* [列出表单响应](/zh/api-reference/management-api/forms/responses-list) —— 单个表单的 JSON 等效端点，带有筛选条件。
* [获取表单分析](/zh/api-reference/management-api/forms/analytics) —— 聚合数字而非原始行数据。
* [管理 API 概述](/zh/api-reference/management-api/overview) —— 此端点所属的身份验证方案和配额体系。


## OpenAPI

````yaml api-reference/openapi/management-api.json POST /forms/export/
openapi: 3.1.0
info:
  title: Scanova Management API (v2)
  description: >-
    The complete Scanova Management API — every endpoint available at
    api.scanova.io (QR codes, folders, tags, leads, forms, analytics, plans,
    shared users & roles), plus the token-creation and usage-stats endpoints
    used to authenticate against it. Every path and request/response shape below
    was verified live against a real API key and the actual running backend
    (Phase 7, 2026-08-16) — not guessed from reading urls.py alone.
  version: 2.0.0
servers:
  - url: https://api.scanova.io
    description: Management API — QR/folder/tag/lead/form/analytics/plans endpoints
security:
  - apiKeyAuth: []
paths:
  /forms/export/:
    post:
      summary: Export form responses
      operationId: exportManagedFormResponses
      responses:
        '200':
          description: CSV or XLSX file download.
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Send your Management API key as the raw value of the Authorization
        header — no "Bearer " or "Token " prefix, and no other characters.
        Example: `Authorization: 401f7ac837da42b97f613d789819ff93537bee6a`. A
        header containing more than one space-separated part is rejected
        outright. Requests also require the request's Host header to be the
        management API host (e.g. api.scanova.io) — the same key sent to the
        regular API host will not authenticate.

````