> ## 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`، يُرسَل كقيمة خام لترويسة `Authorization` — راجع [نظرة عامة على واجهة برمجة التطبيقات للإدارة](/ar/api-reference/management-api/overview).
</Note>

<ParamField body="form_id" type="string">
  يصدّر استجابات نموذج واحد، مع مخطط أسئلته الخاص كعناوين للأعمدة. يستبعد `qr_ids` بشكل متبادل.
</ParamField>

<ParamField body="qr_ids" type="array">
  يصدّر الاستجابات عبر كل نموذج (وقائمة عملاء محتملين محوَّلة) مرتبط بمعرّفات `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`، أو نوع MIME الخاص بـ XLS/XLSX)، وليست 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`.

يُعاد `400` إذا قُدِّم كل من `form_id` و`qr_ids`، أو لم يُقدَّم أي منهما:

```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" }
```

يُعاد `400` إذا لم يكن `file_format` واحدًا من `csv` أو `xls` أو `xlsx`:

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

## ذو صلة

* [سرد استجابات النموذج](/ar/api-reference/management-api/forms/responses-list) — المكافئ بصيغة JSON لنموذج واحد، مع الفلاتر.
* [الحصول على تحليلات النموذج](/ar/api-reference/management-api/forms/analytics) — أرقام مجمَّعة بدلاً من صفوف خام.
* [نظرة عامة على واجهة برمجة التطبيقات للإدارة](/ar/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: YOUR_API_KEY`. 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.

````