# FormMessages

## Introduction

`FormMessages` are the processed and validated input of a [User](/api-reference/users.md) when submitting a [Form](/api-reference/forms/forms.md).

They contain all information which is needed and used when sending the [ForMessage](/api-reference/forms/form-messages.md) to their receivers and are generated from [FormMessageFields](/api-reference/forms/form-message-fields.md) when [sending a Form](/api-reference/forms/forms.md#send).

## Model Definition

**Alias**

`formMessage`

**Relations**

| Relation                                                         | Key                 | Type       | Relation Field(s)                    |
| ---------------------------------------------------------------- | ------------------- | ---------- | ------------------------------------ |
| [User](/api-reference/users.md)                                  | `user`              | Belongs to | `user_id`                            |
| [Department](/api-reference/departments.md)                      | `department`        | Belongs to | `department_id`                      |
| [Form](/api-reference/forms/forms.md)                            | `form`              | Belongs to | `form_id`                            |
| [FormMessageFields](/api-reference/forms/form-message-fields.md) | `formMessageFields` | Has many   | `form_message_field.form_message_id` |

**Computed Properties**

* `hash` - The hashed `id` of the `FormMessage`

## List

Get a list of all `FormMessages`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/forms/messages`

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 4,
    "user_id": 2,
    "group_account_user_id": null,
    "department_id": 1,
    "form_id": 1,
    "recipient": null,
    "subject": "\"Form-1-changed\" wurde von intratool Service (intratool) \u00fcbertragen",
    "body": "<p><strong>Field-1</strong></p><p>https://intratool.de</p><p><br></p><p><strong>Field-2</strong></p><p>accusam et</p><p><br></p>",
    "sent_at": "2019-01-25 14:18:05",
    "created_at": "2019-01-25 14:18:05",
    "updated_at": "2019-01-25 14:18:05",
    "hash": "2w54q7xmvk1drl8ygeo96jrd"
  },
  {
    "id": 5,
    "user_id": 2,
    "group_account_user_id": null,
    "department_id": 1,
    "form_id": 1,
    "recipient": null,
    "subject": "\"Form-1-changed\" wurde von intratool Service (intratool) \u00fcbertragen",
    "body": "<p><strong>Field-1</strong></p><p>https://intratool.de</p><p><br></p><p><strong>Field-2</strong></p><p>congue nihil</p><p><br></p>",
    "sent_at": "2019-01-25 14:19:25",
    "created_at": "2019-01-25 14:19:25",
    "updated_at": "2019-01-25 14:19:25",
    "hash": "r609mj42kn1rm3v58dogz7we"
  }
]
```

## Show

Show a single `FormMessage` by `id`.

***

**Definition**

<mark style="color:green;">`GET`</mark> `/api/forms/messages/{id}`

**Example Request**

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

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

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 4,
  "user_id": 2,
  "group_account_user_id": null,
  "department_id": 1,
  "form_id": 1,
  "recipient": null,
  "subject": "\"Form-1-changed\" wurde von intratool Service (intratool) \u00fcbertragen",
  "body": "<p><strong>Field-1</strong></p><p>https://intratool.de</p><p><br></p><p><strong>Field-2</strong></p><p>accusam et</p><p><br></p>",
  "sent_at": "2019-01-25 14:18:05",
  "created_at": "2019-01-25 14:18:05",
  "updated_at": "2019-01-25 14:18:05",
  "hash": "2w54q7xmvk1drl8ygeo96jrd"
}
```


---

# Agent Instructions: 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:

```
GET https://docs.api.intratool.de/api-reference/forms/form-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
