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

# Frecuency disttribution for question

> # Description

Query frecuency distributions for open text questions of project.

# Payload

```json
{
    "projectId": string,
    "questionId": [string],
    "combination": string,
    "fromDate": string,
    "toDate": string,
    "filter": array,
    "selectedQuestionId": string,
    "selectedOption": [number]
}
```

where:

* `projectId`: unique identifier of the project. __(Required)__.
* `questionId`: unique identifier of the text question. __(Required)__.
* `combination`: determines what combination of lemmatization and stop words are applied. __(Required)__.
* `fromDate`: start date of responses to query. _(Required if `toDate` is present)_.
* `toDate`: end date of responses to query. _(Required if `fromDate` is present)_.
* `filter`: list of questions to filter responses by. (Optional).
* `selectedQuestionId`: unique identifier of the text question selected for comparison. _(Required if `selectedOption` is present)_.
* `selectedOption`: single element array containing which option is selected for comparison. _(Required if `selectedQuestionId` is present)_.

# Responses

## 200 OK

```json
{
    "combination": "string",
    "frequencies": {
        "adjectives": {
            "adjective1": "integer",
            "adjectiveN": "integer"
        },
        "nouns": {
            "noun1": "integer",
            "nounN": "integer"
        },
        "verbs": {
            "verb1": "integer",
            "verbN": "integer"
        },
        "others": {
            "other1": "integer",
            "otherN": "integer"
        }
    },
    "sentiments": {
        "neu": "integer",
        "pos": "integer",
        "neg": "integer",
        "vpos": "integer",
        "vneg": "integer"
    }
}
```
where:

* `combination`: determines what combination of lemmatization and stop words are applied.
* `frequencies`: object containing:
  - `adjectives`: object containing adjectives mapped to frequencies.
  - `nouns`: object containing nouns mapped to frequencies.
  - `others`: object containing other words mapped to frequencies.
  - `verbs`: object containing verbs mapped to frequencies.
* `sentiments`: object containing:
    - `neu`: number of neutral words.
    - `pos`: number of positive words.
    - `neg`: number of negative words.
    - `vpos`: number of very positive words.
    - `vneg`: number of very negative words.

## 400 Bad Request
> Missing or invalid required fields.

## 401 Unauthorized
> Invalid authorization.

## 500 Internal Server Error
> Error occurred in freq-dist-api microservice.

# Description

Query frecuency distributions for open text questions of project.

# Payload

```json theme={null}
{
    "projectId": string,
    "questionId": [string],
    "combination": string,
    "fromDate": string,
    "toDate": string,
    "filter": array,
    "selectedQuestionId": string,
    "selectedOption": [number]
}
```

where:

* `projectId`: unique identifier of the project. **(Required)**.
* `questionId`: unique identifier of the text question. **(Required)**.
* `combination`: determines what combination of lemmatization and stop words are applied. **(Required)**.
* `fromDate`: start date of responses to query. *(Required if `toDate` is present)*.
* `toDate`: end date of responses to query. *(Required if `fromDate` is present)*.
* `filter`: list of questions to filter responses by. (Optional).
* `selectedQuestionId`: unique identifier of the text question selected for comparison. *(Required if `selectedOption` is present)*.
* `selectedOption`: single element array containing which option is selected for comparison. *(Required if `selectedQuestionId` is present)*.

# Responses

## 200 OK

```json theme={null}
{
    "combination": "string",
    "frequencies": {
        "adjectives": {
            "adjective1": "integer",
            "adjectiveN": "integer"
        },
        "nouns": {
            "noun1": "integer",
            "nounN": "integer"
        },
        "verbs": {
            "verb1": "integer",
            "verbN": "integer"
        },
        "others": {
            "other1": "integer",
            "otherN": "integer"
        }
    },
    "sentiments": {
        "neu": "integer",
        "pos": "integer",
        "neg": "integer",
        "vpos": "integer",
        "vneg": "integer"
    }
}
```

where:

* `combination`: determines what combination of lemmatization and stop words are applied.
* `frequencies`: object containing:
  * `adjectives`: object containing adjectives mapped to frequencies.
  * `nouns`: object containing nouns mapped to frequencies.
  * `others`: object containing other words mapped to frequencies.
  * `verbs`: object containing verbs mapped to frequencies.
* `sentiments`: object containing:
  * `neu`: number of neutral words.
  * `pos`: number of positive words.
  * `neg`: number of negative words.
  * `vpos`: number of very positive words.
  * `vneg`: number of very negative words.

## 400 Bad Request

> Missing or invalid required fields.

## 401 Unauthorized

> Invalid authorization.

## 500 Internal Server Error

> Error occurred in freq-dist-api microservice.


## OpenAPI

````yaml POST /api/freq-dist
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/freq-dist:
    post:
      summary: Frecuency disttribution for question
      description: >-
        # Description


        Query frecuency distributions for open text questions of project.


        # Payload


        ```json

        {
            "projectId": string,
            "questionId": [string],
            "combination": string,
            "fromDate": string,
            "toDate": string,
            "filter": array,
            "selectedQuestionId": string,
            "selectedOption": [number]
        }

        ```


        where:


        * `projectId`: unique identifier of the project. __(Required)__.

        * `questionId`: unique identifier of the text question. __(Required)__.

        * `combination`: determines what combination of lemmatization and stop
        words are applied. __(Required)__.

        * `fromDate`: start date of responses to query. _(Required if `toDate`
        is present)_.

        * `toDate`: end date of responses to query. _(Required if `fromDate` is
        present)_.

        * `filter`: list of questions to filter responses by. (Optional).

        * `selectedQuestionId`: unique identifier of the text question selected
        for comparison. _(Required if `selectedOption` is present)_.

        * `selectedOption`: single element array containing which option is
        selected for comparison. _(Required if `selectedQuestionId` is
        present)_.


        # Responses


        ## 200 OK


        ```json

        {
            "combination": "string",
            "frequencies": {
                "adjectives": {
                    "adjective1": "integer",
                    "adjectiveN": "integer"
                },
                "nouns": {
                    "noun1": "integer",
                    "nounN": "integer"
                },
                "verbs": {
                    "verb1": "integer",
                    "verbN": "integer"
                },
                "others": {
                    "other1": "integer",
                    "otherN": "integer"
                }
            },
            "sentiments": {
                "neu": "integer",
                "pos": "integer",
                "neg": "integer",
                "vpos": "integer",
                "vneg": "integer"
            }
        }

        ```

        where:


        * `combination`: determines what combination of lemmatization and stop
        words are applied.

        * `frequencies`: object containing:
          - `adjectives`: object containing adjectives mapped to frequencies.
          - `nouns`: object containing nouns mapped to frequencies.
          - `others`: object containing other words mapped to frequencies.
          - `verbs`: object containing verbs mapped to frequencies.
        * `sentiments`: object containing:
            - `neu`: number of neutral words.
            - `pos`: number of positive words.
            - `neg`: number of negative words.
            - `vpos`: number of very positive words.
            - `vneg`: number of very negative words.

        ## 400 Bad Request

        > Missing or invalid required fields.


        ## 401 Unauthorized

        > Invalid authorization.


        ## 500 Internal Server Error

        > Error occurred in freq-dist-api microservice.
      operationId: frecuency-disttribution-for-question-post-api-freq-dist
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              projectId: '{{projectId}}'
              questionId:
                - qQuestionId
              combination: stopWordsAndLemmaApplied
              fromDate: '2020-01-01'
              toDate: '2022-12-31'
              filter:
                - - type: QUESTION
                    operator: IN
                    values:
                      - 1
                    subtype: CATEGORICAL
      responses:
        '200':
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      servers:
        - url: https://freq-dist.sightx.io
components:
  securitySchemes:
    AuthorizationHeader:
      type: apiKey
      in: header
      name: Authorization
      description: Access token obtained from the m2m-token endpoint.

````