> For the complete documentation index, see [llms.txt](https://docs.api.intratool.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.api.intratool.de/api-reference/surveys/survey-vote-seleted-answer-options.md).

# SurveyVoteSelectedAnswerOptions

## Introduction

`SurveyVoteSelectedAnswerOptions` represent the selected [SurveyAnswerOptions](/api-reference/surveys/survey-answer-options.md) for each [SurveyVote](/api-reference/surveys/survey-votes.md). They allow you to analyze which [SurveyAnswerOptions](/api-reference/surveys/survey-answer-options.md) were chosen by [Users](/api-reference/users.md) for a given [Survey](/api-reference/surveys/surveys.md), and to aggregate results for reporting and statistics. These entities are read-only and are managed automatically when [Users](/api-reference/users.md) vote.

## Model Definition

### Alias

`surveyVoteSelectedAnswerOption`

### Relations

| Key                  | Relation                                                              | Type       | Relation Field(s)         |
| -------------------- | --------------------------------------------------------------------- | ---------- | ------------------------- |
| `surveyVote`         | [SurveyVote](/api-reference/surveys/survey-votes.md)                  | Belongs to | `survey_vote_id`          |
| `surveyAnswerOption` | [SurveyAnswerOption](/api-reference/surveys/survey-answer-options.md) | Belongs to | `survey_answer_option_id` |

## List by Survey

Get a list of all `SurveyVoteSelectedAnswerOptions` for a given [Survey](/api-reference/surveys/surveys.md).

**Definition**

<mark style="color:green;">`GET`</mark> `/api/surveys/{survey}/selected-answer-options`

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/surveys/1/selected-answer-options', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 1,
    "survey_vote_id": 1,
    "survey_answer_option_id": 2,
    "created_at": "2024-07-15 12:00:00",
    "updated_at": "2024-07-15 12:00:00"
  },
  {
    "id": 2,
    "survey_vote_id": 2,
    "survey_answer_option_id": 3,
    "created_at": "2024-07-15 13:00:00",
    "updated_at": "2024-07-15 13:00:00"
  }
]
```

## Summary by Survey

Get a summary (grouped count) of selected [SurveyAnswerOptions](/api-reference/surveys/survey-answer-options.md) for a given [Survey](/api-reference/surveys/surveys.md).

**Definition**

<mark style="color:green;">`GET`</mark> `/api/surveys/{survey}/selected-answer-options/summary`

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/surveys/1/selected-answer-options/summary', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "survey_answer_option_id": 2,
    "count": 5
  },
  {
    "survey_answer_option_id": 3,
    "count": 3
  }
]
```
