> ## 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 json

> # Description

Gets a single response full data.

# Body

```json
{
   "projectId": "50c957e3f3e4670e361b5fca",
   "campaignId": "50c957e3f3e4670e361b5fcb",
   "fromDate": "2020-01-01",
   "toDate": "2022-12-31",
   "offset": 0,
   "limit": 100,
   "onlyCount": 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.
- offset: numeric. From what response to export (using for pagination).
- limit: Boolean. How much response to export, the maximun for this value is 100 (using for pagination).
- `onlyCount: when it is set to true, the endpoint only returns the amount of responses available`
    

# Response

## 200 OK

```json
[{
   "answers": {
      "questionId": {
         "na": boolean,
         "values": array|object|null,
         "value": array|number|string|null,
      },
   },
   "timeToComplete": number,
   "id": string,
   "projectId": string,
   "createdAt": string,
   "channel": string,
   "campaignId": string,
   "serverCreationDate": string,
   "requestInfo": object,
   "code": string,
   "conceptTestsDisplayed": {
      "conceptTestId": [
         "conceptId"
      ]
   },
   "headers": object,
   "urlHash": string,
   "isAdmin": boolean,
   "uuid": string,
   "completenessPercent": number,
   "questionsDisplayedCount": number,
   "responsesCount": number
},
...
]

 ```

where:

- `answers`: Object containing the responses of the questions answered by the respondent. The format of each response may vary according to the type of the question.
- `timeToComplete`: Time in seconds that the respondent took to complete the survey.
- `id`: The unique id of the response.
- `projectId`: The id of the project.
- `createdAt`: The timestamp when the response was submitted.
- `channel`: The distribution channel through the survey was sent to the respondent.
- `campaignId`: The id of the campaign.
- `serverCreationDate`: The date in UTC format when the response was submitted.
- `requestInfo`: The location info of the request that was made when the response was submitted.
- `code`: The unique and short code assigned to the response.
- `conceptTestsDisplayed`: The concept tests that were displayed to the respondent.
- `headers`: The headers info of the request that was made when the response was submitted.
- `urlHash`: The public url hash to identify the survey. Used in the public survey link.
- `isAdmin`: A flag to know if the response was submitted with the admin link.
- `uuid`: Unique code generated to avoid duplicates.
- `completenessPercent`: The percentage of completion of the survey. Calculated with `questionsDisplayedCount` and `responsesCount`.
- `questionsDisplayedCount`: The amount of questions displayed to the respondent in the survey.
- `responsesCount`: The amount of questions actually answered by the respondent in the survey.
    

## 401 Unauthorized

> The user doesn't have permissions. 
  

## 500 Internal Server Error

> Error occurred while processing the request.

# Description

Gets a single response full data.

# Body

```json theme={null}
{
   "projectId": "50c957e3f3e4670e361b5fca",
   "campaignId": "50c957e3f3e4670e361b5fcb",
   "fromDate": "2020-01-01",
   "toDate": "2022-12-31",
   "offset": 0,
   "limit": 100,
   "onlyCount": 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.
* offset: numeric. From what response to export (using for pagination).
* limit: Boolean. How much response to export, the maximun for this value is 100 (using for pagination).
* `onlyCount: when it is set to true, the endpoint only returns the amount of responses available`

# Response

## 200 OK

```json theme={null}
[{
   "answers": {
      "questionId": {
         "na": boolean,
         "values": array|object|null,
         "value": array|number|string|null,
      },
   },
   "timeToComplete": number,
   "id": string,
   "projectId": string,
   "createdAt": string,
   "channel": string,
   "campaignId": string,
   "serverCreationDate": string,
   "requestInfo": object,
   "code": string,
   "conceptTestsDisplayed": {
      "conceptTestId": [
         "conceptId"
      ]
   },
   "headers": object,
   "urlHash": string,
   "isAdmin": boolean,
   "uuid": string,
   "completenessPercent": number,
   "questionsDisplayedCount": number,
   "responsesCount": number
},
...
]

```

where:

* `answers`: Object containing the responses of the questions answered by the respondent. The format of each response may vary according to the type of the question.
* `timeToComplete`: Time in seconds that the respondent took to complete the survey.
* `id`: The unique id of the response.
* `projectId`: The id of the project.
* `createdAt`: The timestamp when the response was submitted.
* `channel`: The distribution channel through the survey was sent to the respondent.
* `campaignId`: The id of the campaign.
* `serverCreationDate`: The date in UTC format when the response was submitted.
* `requestInfo`: The location info of the request that was made when the response was submitted.
* `code`: The unique and short code assigned to the response.
* `conceptTestsDisplayed`: The concept tests that were displayed to the respondent.
* `headers`: The headers info of the request that was made when the response was submitted.
* `urlHash`: The public url hash to identify the survey. Used in the public survey link.
* `isAdmin`: A flag to know if the response was submitted with the admin link.
* `uuid`: Unique code generated to avoid duplicates.
* `completenessPercent`: The percentage of completion of the survey. Calculated with `questionsDisplayedCount` and `responsesCount`.
* `questionsDisplayedCount`: The amount of questions displayed to the respondent in the survey.
* `responsesCount`: The amount of questions actually answered by the respondent in the survey.

## 401 Unauthorized

> The user doesn't have permissions.

## 500 Internal Server Error

> Error occurred while processing the request.


## OpenAPI

````yaml POST /api/export/json
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/json:
    post:
      summary: Export responses as json
      description: >-
        # Description


        Gets a single response full data.


        # Body


        ```json

        {
           "projectId": "50c957e3f3e4670e361b5fca",
           "campaignId": "50c957e3f3e4670e361b5fcb",
           "fromDate": "2020-01-01",
           "toDate": "2022-12-31",
           "offset": 0,
           "limit": 100,
           "onlyCount": 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.

        - offset: numeric. From what response to export (using for pagination).

        - limit: Boolean. How much response to export, the maximun for this
        value is 100 (using for pagination).

        - `onlyCount: when it is set to true, the endpoint only returns the
        amount of responses available`
            

        # Response


        ## 200 OK


        ```json

        [{
           "answers": {
              "questionId": {
                 "na": boolean,
                 "values": array|object|null,
                 "value": array|number|string|null,
              },
           },
           "timeToComplete": number,
           "id": string,
           "projectId": string,
           "createdAt": string,
           "channel": string,
           "campaignId": string,
           "serverCreationDate": string,
           "requestInfo": object,
           "code": string,
           "conceptTestsDisplayed": {
              "conceptTestId": [
                 "conceptId"
              ]
           },
           "headers": object,
           "urlHash": string,
           "isAdmin": boolean,
           "uuid": string,
           "completenessPercent": number,
           "questionsDisplayedCount": number,
           "responsesCount": number
        },

        ...

        ]

         ```

        where:


        - `answers`: Object containing the responses of the questions answered
        by the respondent. The format of each response may vary according to the
        type of the question.

        - `timeToComplete`: Time in seconds that the respondent took to complete
        the survey.

        - `id`: The unique id of the response.

        - `projectId`: The id of the project.

        - `createdAt`: The timestamp when the response was submitted.

        - `channel`: The distribution channel through the survey was sent to the
        respondent.

        - `campaignId`: The id of the campaign.

        - `serverCreationDate`: The date in UTC format when the response was
        submitted.

        - `requestInfo`: The location info of the request that was made when the
        response was submitted.

        - `code`: The unique and short code assigned to the response.

        - `conceptTestsDisplayed`: The concept tests that were displayed to the
        respondent.

        - `headers`: The headers info of the request that was made when the
        response was submitted.

        - `urlHash`: The public url hash to identify the survey. Used in the
        public survey link.

        - `isAdmin`: A flag to know if the response was submitted with the admin
        link.

        - `uuid`: Unique code generated to avoid duplicates.

        - `completenessPercent`: The percentage of completion of the survey.
        Calculated with `questionsDisplayedCount` and `responsesCount`.

        - `questionsDisplayedCount`: The amount of questions displayed to the
        respondent in the survey.

        - `responsesCount`: The amount of questions actually answered by the
        respondent in the survey.
            

        ## 401 Unauthorized


        > The user doesn't have permissions. 
          

        ## 500 Internal Server Error


        > Error occurred while processing the request.
      operationId: export-responses-as-json-post-api-export-json
      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'
              offset: 0
              limit: 100
              onlyCount: false
      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.

````