# MessageThread

CRUD functionality as well as additional methods for Message threads. Messages thread groups together a set of related messages and/or attachments.

Salaxy API v03, **Finland only**. 10 operations. Interactive version: [REST API reference](https://code.salaxy.com/reference/rest-api.md). Machine-readable: [OpenAPI document](https://code.salaxy.com/openapi/salaxy-03.json).

**The reference wins:**
These pages are generated from the OpenAPI document. If a guide and this reference disagree about a field, follow the reference. Error responses are not in the document — see [Errors](https://code.salaxy.com/reference/errors.md).

## `GET /v03/api/messages`

**Performs an OData query to the search index.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `$search` | query | string |  |  |
| `$filter` | query | string |  | Specifies the logic to pull back a subset of records. |
| `$orderby` | query | string |  | Specifies the values used to sort the collection of entries. |
| `$select` | query | string |  | The $select system query option allows the clients to requests a limited set of properties for each entry. |
| `$top` | query | number |  | Specifies the subset of entries by count. |
| `$skip` | query | number |  | Specifies the count of entries to skip. |
| `$count` | query | boolean |  | Indicates whether or not to include a total entry count. |

Response: `PageResultOfMessageListItem`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/messagethread/GET/v03/api/messages)

## `POST /v03/api/messages`

**Updates or creates a new object**

Request body: `MessageThread` (required)

Response: `MessageThread`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/messagethread/POST/v03/api/messages)

## `GET /v03/api/messages/{id}`

**Gets a single object based on identier**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Unique identifier for the object |

Response: `MessageThread`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/messagethread/GET/v03/api/messages/{id})

## `DELETE /v03/api/messages/{id}`

**Deletes an object from the storage**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Unique identifier for the object. |

Response: `string`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/messagethread/DELETE/v03/api/messages/{id})

## `GET /v03/api/messages/new`

**Factory method that creates a new object**

Response: `MessageThread`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/messagethread/GET/v03/api/messages/new)

## `POST /v03/api/messages/{id}/messages`

**Adds or modifies a message to the thread.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Identifier of the thread |

Request body: `Message` (required)

Response: `MessageThread`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/messagethread/POST/v03/api/messages/{id}/messages)

## `POST /v03/api/messages/{id}/files`

**Saves an attachment file as a message to the thread.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Message thread identifier |

Response: `MessageThread`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/messagethread/POST/v03/api/messages/{id}/files)

## `POST /v03/api/messages/{id}/messages/blobFileMessage`

**Saves an attachment file as a message to the thread.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Message thread identifier |

Response: `MessageThread`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/messagethread/POST/v03/api/messages/{id}/messages/blobFileMessage)

## `POST /v03/api/messages/{id}/read-by/{readBy}`

**Marks all messages as read by a given party**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Identifier of the thread |
| `readBy` | path | MessageFrom | yes | The party for which the messages are marked as read. |

Response: `MessageThread`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/messagethread/POST/v03/api/messages/{id}/read-by/{readBy})

## `POST /v03/api/messages/{id}/notifications`

**Sends an email notification to the owner of the message.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Message thread identifier. |
| `subject` | query | string |  | Subject for the notification. |

Request body: `string` (required)

Response: `MessageThread`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api.md#tag/messagethread/POST/v03/api/messages/{id}/notifications)
