> ## Documentation Index
> Fetch the complete documentation index at: https://docs.braintest.ir/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Test Questions

> Fetch questionnaire content for a test record after profile authentication, returned as structured JSON or HTML.

Use this endpoint to retrieve the questions for a test record. You must authenticate the participant profile first: if `auth_required` is still `true`, this endpoint returns an error.

The response can be returned as structured JSON (sections and questions with option IDs) or as a rendered HTML string. Use the JSON format when you want to build a custom UI, and the HTML format when you want to embed a pre-rendered questionnaire.

## Endpoint

```http theme={"dark"}
GET https://braintest.ir/api/v2/record/{token}/questions/
```

## Headers

| Header    | Value                                 |
| --------- | ------------------------------------- |
| `API-KEY` | Your API key from the organizer panel |

## Path parameters

<ParamField path="token" type="string" required>
  The UUID token of the test record.
</ParamField>

## Response (JSON format)

<ResponseField name="data" type="object">
  <ResponseField name="sections" type="array">
    Array of section objects. Each section contains:

    * `id` (string): Section identifier
    * `title` (string): Section title
    * `questions` (array): Questions in this section
  </ResponseField>
</ResponseField>

Each question object contains:

<ResponseField name="id" type="string">
  Question identifier.
</ResponseField>

<ResponseField name="text" type="string">
  Question text.
</ResponseField>

<ResponseField name="options" type="array">
  Array of option objects. Each option has:

  * `id` (string): The option identifier you submit in answers
  * `label` (string): Human-readable option text
</ResponseField>

## Example request

```bash theme={"dark"}
curl -X GET "https://braintest.ir/api/v2/record/a1b2c3d4-e5f6-7890-abcd-ef1234567890/questions/" \
  -H "API-KEY: YOUR_API_KEY"
```

## Example response (JSON)

```json theme={"dark"}
{
  "data": {
    "sections": [
      {
        "id": "clinical",
        "title": "Clinical Personality Patterns",
        "questions": [
          {
            "id": "q1",
            "text": "I often feel that others do not understand me.",
            "options": [
              { "id": "opt_1", "label": "Strongly disagree" },
              { "id": "opt_2", "label": "Disagree" },
              { "id": "opt_3", "label": "Agree" },
              { "id": "opt_4", "label": "Strongly agree" }
            ]
          }
        ]
      }
    ]
  },
  "successful": true,
  "messages": []
}
```

## Option IDs

Each option in the `options` array has an `id` field. You must submit these exact `id` values when posting answers to `POST /record/{token}/`. The `label` field is for display only and must not be sent as the answer value.

## Response (HTML format)

When the questions endpoint returns HTML, the response shape is:

```json theme={"dark"}
{
  "data": {
    "html": "<html>...</html>"
  },
  "successful": true,
  "messages": []
}
```

You can embed the `html` string directly into an iframe or render it in a WebView for mobile applications.
