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

# Get overall responses stats of a project

> # Description

Retrieves stats data of all responses that correspond to the specified campaign and date range.

# Response

## 200 OK

```json
{
   "channelData": [{
      "_id": string,
      "count": number
   }],
   "dailyResponsesData":[{
      "_id": { "date": string },
      "count": number
   }],
   "listsResponsesData": [],
   "globalResponsesData":[{
      "_id": string,
      "timeToCompleteSum": number,
      "responsesCount": number
    }]
}
```

where:

- `channelData`: Array of responses count for each distribution channel, eg. Email, Sms, Admin Link, etc.
- `dailyResponsesData`: Array of responses count per day (within the specified date range in the dashboard filter).
- `globalResponsesData`: Array of global metrics of the desired responses.

## 400 Bad Request

> ProjectId, fromDate and/or toDate are missing.

## 401 Unauthorized

> The user doesn't have permissions.

## 500 Internal Server Error

> Error occurred while processing the request.

# Description

Retrieves stats data of all responses that correspond to the specified campaign and date range.

# Response

## 200 OK

```json theme={null}
{
   "channelData": [{
      "_id": string,
      "count": number
   }],
   "dailyResponsesData":[{
      "_id": { "date": string },
      "count": number
   }],
   "listsResponsesData": [],
   "globalResponsesData":[{
      "_id": string,
      "timeToCompleteSum": number,
      "responsesCount": number
    }]
}
```

where:

* `channelData`: Array of responses count for each distribution channel, eg. Email, Sms, Admin Link, etc.
* `dailyResponsesData`: Array of responses count per day (within the specified date range in the dashboard filter).
* `globalResponsesData`: Array of global metrics of the desired responses.

## 400 Bad Request

> ProjectId, fromDate and/or toDate are missing.

## 401 Unauthorized

> The user doesn't have permissions.

## 500 Internal Server Error

> Error occurred while processing the request.

##### Query Parameters

| Parameter   | Description | Required | Example                   |
| ----------- | ----------- | -------- | ------------------------- |
| `projectId` | —           | No       | —                         |
| `fromDate`  | —           | No       | `2020-01-01`              |
| `toDate`    | —           | No       | `2022-12-31T23:59:59.999` |


## OpenAPI

````yaml GET /responses-capture-service/v1/responses/stats
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:
  /responses-capture-service/v1/responses/stats:
    get:
      summary: Get overall responses stats of a project
      description: >-
        # Description


        Retrieves stats data of all responses that correspond to the specified
        campaign and date range.


        # Response


        ## 200 OK


        ```json

        {
           "channelData": [{
              "_id": string,
              "count": number
           }],
           "dailyResponsesData":[{
              "_id": { "date": string },
              "count": number
           }],
           "listsResponsesData": [],
           "globalResponsesData":[{
              "_id": string,
              "timeToCompleteSum": number,
              "responsesCount": number
            }]
        }

        ```


        where:


        - `channelData`: Array of responses count for each distribution channel,
        eg. Email, Sms, Admin Link, etc.

        - `dailyResponsesData`: Array of responses count per day (within the
        specified date range in the dashboard filter).

        - `globalResponsesData`: Array of global metrics of the desired
        responses.


        ## 400 Bad Request


        > ProjectId, fromDate and/or toDate are missing.


        ## 401 Unauthorized


        > The user doesn't have permissions.


        ## 500 Internal Server Error


        > Error occurred while processing the request.
      operationId: >-
        get-overall-responses-stats-of-a-project-get-responses-capture-service-v1-responses-stats
      parameters:
        - name: Authorization
          in: header
          required: true
          description: Authorization token
          schema:
            type: string
        - name: projectId
          in: query
          required: false
          schema:
            type: string
        - name: fromDate
          in: query
          required: false
          schema:
            type: string
          example: '2020-01-01'
        - name: toDate
          in: query
          required: false
          schema:
            type: string
          example: '2022-12-31T23:59:59.999'
      responses:
        '200':
          description: Get overall responses stats of a project
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              example:
                channelData:
                  - _id: public
                    count: 8
                dailyResponsesData:
                  - _id:
                      date: '2021-07-01'
                    count: 8
                listsResponsesData: []
                globalResponsesData:
                  - _id: all
                    timeToCompleteSum: 4601
                    responsesCount: 8
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      servers:
        - url: https://responses.sightx.io
components:
  securitySchemes:
    AuthorizationHeader:
      type: apiKey
      in: header
      name: Authorization
      description: Access token obtained from the m2m-token endpoint.

````