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

# Export responses as Excel file

> # Description

Download an Excel file with the responses of the specified project/campaign

# Body

```json
{
   "projectId": "50c957e3f3e4670e361b5fca",
   "campaignId": "50c957e3f3e4670e361b5fcb",
   "fromDate": "2020-01-01",
   "toDate": "2022-12-31",
   "exportLabels": false,
   "expanded": false,
   "loopExpanded": false,
   "exportProjectVariables": true,
   "exportAudienceVariables": true,
   "exportPanelVariables": true
}

 ```

where:

- `projectId`: The id of the project.
- `campaignId`: The id of the campaign. Don't send this field to get responses from all campaigns.
- `fromDate`: The initial date of the responses data desired.
- `toDate`: The final date of the responses data desired.
- `exportLabels`: Boolean. Specify if labels should be exported instead of numeric values for question options.
- `expanded`: Boolean. For questions with discrete variables, this option allows you to expand the export file to show each option in its own column.
- `loopExpanded`
- `exportProjectVariables`
- `exportAudienceVariables`
- `exportPanelVariables`
    

# Response

`HTTP 200`

Excel File.

# Description

Download an Excel file with the responses of the specified project/campaign

# Body

```json theme={null}
{
   "projectId": "50c957e3f3e4670e361b5fca",
   "campaignId": "50c957e3f3e4670e361b5fcb",
   "fromDate": "2020-01-01",
   "toDate": "2022-12-31",
   "exportLabels": false,
   "expanded": false,
   "loopExpanded": false,
   "exportProjectVariables": true,
   "exportAudienceVariables": true,
   "exportPanelVariables": true
}

```

where:

* `projectId`: The id of the project.
* `campaignId`: The id of the campaign. Don't send this field to get responses from all campaigns.
* `fromDate`: The initial date of the responses data desired.
* `toDate`: The final date of the responses data desired.
* `exportLabels`: Boolean. Specify if labels should be exported instead of numeric values for question options.
* `expanded`: Boolean. For questions with discrete variables, this option allows you to expand the export file to show each option in its own column.
* `loopExpanded`
* `exportProjectVariables`
* `exportAudienceVariables`
* `exportPanelVariables`

# Response

`HTTP 200`

Excel File.


## OpenAPI

````yaml POST /api/export
openapi: 3.0.3
info:
  title: SightX API
  version: 1.0.0
  description: >-
    SightX REST API documentation. Most responses are JSON; some export
    endpoints return files. API access is a paid add-on — contact
    sales@sightx.io for details.
servers:
  - url: https://auth.admin.sightx.io
    description: Authentication (Production)
  - url: https://auth.staging-admin.sightx.io
    description: Authentication (Staging)
security:
  - AuthorizationHeader: []
paths:
  /api/export:
    post:
      summary: Export responses as Excel file
      description: >-
        # Description


        Download an Excel file with the responses of the specified
        project/campaign


        # Body


        ```json

        {
           "projectId": "50c957e3f3e4670e361b5fca",
           "campaignId": "50c957e3f3e4670e361b5fcb",
           "fromDate": "2020-01-01",
           "toDate": "2022-12-31",
           "exportLabels": false,
           "expanded": false,
           "loopExpanded": false,
           "exportProjectVariables": true,
           "exportAudienceVariables": true,
           "exportPanelVariables": true
        }

         ```

        where:


        - `projectId`: The id of the project.

        - `campaignId`: The id of the campaign. Don't send this field to get
        responses from all campaigns.

        - `fromDate`: The initial date of the responses data desired.

        - `toDate`: The final date of the responses data desired.

        - `exportLabels`: Boolean. Specify if labels should be exported instead
        of numeric values for question options.

        - `expanded`: Boolean. For questions with discrete variables, this
        option allows you to expand the export file to show each option in its
        own column.

        - `loopExpanded`

        - `exportProjectVariables`

        - `exportAudienceVariables`

        - `exportPanelVariables`
            

        # Response


        `HTTP 200`


        Excel File.
      operationId: export-responses-as-excel-file-post-api-export
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
        - name: Accept
          in: header
          required: false
          schema:
            type: string
          example: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              projectId: 50c957e3f3e4670e361b5fca
              campaignId: 50c957e3f3e4670e361b5fcb
              fromDate: '2020-01-01'
              toDate: '2022-12-31'
              filter: {}
              exportLabels: false
              expanded: false
              loopExpanded: false
              exportProjectVariables: true
              exportAudienceVariables: true
              exportPanelVariables: true
      responses:
        '200':
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      servers:
        - url: https://responses-export-import.sightx.io
components:
  securitySchemes:
    AuthorizationHeader:
      type: apiKey
      in: header
      name: Authorization
      description: Access token obtained from the m2m-token endpoint.

````