> For the complete documentation index, see [llms.txt](https://knowledgebase.flaik.com/flaik-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/class-management/class-surveys-by-date-range.md).

# Class Surveys by Date Range

## Overview

Returns guest **survey responses** captured against classes in a date range — the answers guests gave to in-class survey questions, joined to the class and guest they relate to. Use this to ingest customer experience scores into reporting or NPS systems.

{% hint style="info" %}
**Heads up — two "surveys" endpoints**

Flaik Connect exposes two different survey-related endpoints. They return different things:

* **Class Survey Responses** (this page, `/api/classmanagement/surveys/{startDate}/{endDate}`) — survey **responses** captured against classes. Use this to ingest the answers guests have given.
* [**Survey Definitions**](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/global-settings/surveys-by-season) (`/api/globalsettings/surveys/{seasonId}`) — survey **configuration** for a season (titles, questions, hints). Use this to model the surveys themselves.
  {% endhint %}

{% hint style="warning" %}
**5-day window limit**

The supplied date range must be **5 days or less** (i.e. start and end can be at most 5 days apart). Walk longer windows in 5-day chunks — see the example loop on the [Class Details by Date Range](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/class-management/class-details-by-date-range#walking-a-larger-window) page.
{% endhint %}

## Authentication

Include your access token in the Authorization header:

```http
Authorization: Bearer {access_token}
```

See the [Authentication Guide](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/overview/authentication) for details on obtaining access tokens.

## Endpoint

```http
GET {api-url}/api/classmanagement/surveys/{startDate}/{endDate}
```

**Path Parameters**

| Parameter   | Type | Required | Description                                                                          |
| ----------- | ---- | -------- | ------------------------------------------------------------------------------------ |
| `startDate` | date | Yes      | First day of the range, inclusive (`YYYY-MM-DD`)                                     |
| `endDate`   | date | Yes      | Last day of the range, inclusive (`YYYY-MM-DD`). Must be ≤ 5 days after `startDate`. |

**Query Parameters**

None.

**Example Request**

```http
GET {api-url}/api/classmanagement/surveys/2025-01-15/2025-01-19
Authorization: Bearer {access_token}
```

**Response Format**

```json
[
  {
    "id": 77001,
    "classId": 5012,
    "classGuestId": 88011,
    "guestId": 412,
    "identifierCode": "G412",
    "feedbackText": "Great instructor — Alex really enjoyed the day.",
    "questionResponses": [
      { "guestSurveyQuestionId": 41, "responseValue": 5 },
      { "guestSurveyQuestionId": 42, "responseValue": 4 },
      { "guestSurveyQuestionId": 43, "responseValue": null }
    ]
  }
]
```

**Survey Response Fields**

Each item in the top-level array represents one guest's complete response set against one class.

| Field               | Type    | Description                                                                                   |
| ------------------- | ------- | --------------------------------------------------------------------------------------------- |
| `id`                | integer | Unique survey response identifier                                                             |
| `classId`           | integer | Class the response relates to (matches `id` in [Class Details](#class-details-by-date-range)) |
| `classGuestId`      | integer | Class-guest assignment identifier (matches `classGuests[].id` from Class Details)             |
| `guestId`           | integer | flaik guest identifier                                                                        |
| `identifierCode`    | string  | External guest identifier — empty string if not set                                           |
| `feedbackText`      | string  | Free-text feedback from the guest — empty string if no comment was given                      |
| `questionResponses` | array   | Per-question answers (see fields below)                                                       |

**Question Response Fields (`questionResponses[]`)**

| Field                   | Type    | Description                                                                                                                                                                                                      |
| ----------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `guestSurveyQuestionId` | integer | Question identifier — matches `questions[].questionId` from [Survey Definitions](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/global-settings/surveys-by-season) |
| `responseValue`         | integer | The numeric value the guest selected (e.g. `1`–`5` for a rating scale). `null` if the question was skipped or had no rating-style answer                                                                         |

{% hint style="info" %}
**Tip — joining responses to questions:** The `guestSurveyQuestionId` here corresponds to `questionId` in the [Survey Definitions](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/global-settings/surveys-by-season) response. To label or weight responses, fetch survey definitions once for the season and join client-side.
{% endhint %}

## Error Responses

| HTTP Status | Description                                                         |
| ----------- | ------------------------------------------------------------------- |
| `400`       | `startDate` or `endDate` is missing, malformed, or not a valid date |
| `400`       | The supplied date range exceeds 5 days                              |
| `401`       | Missing or invalid access token                                     |

Need help with survey ingest? Contact <resortsupport@flaik.com>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/class-management/class-surveys-by-date-range.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
