# `Twilio.Chat.V2.Service.Channel.MessageService`
[🔗](https://github.com/jeffhuen/twilio_elixir/blob/main/lib/twilio/chat/v2/service/channel/message_service.ex#L2)

Individual chat messages

Operations: `list`, `create`, `fetch`, `update`, `delete`

# `create`

```elixir
@spec create(Twilio.Client.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Chat.V2.Service.Channel.Message.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Operation: `CreateMessage` | Tags: ChatV2Message

## Optional Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `Attributes` | string | A valid JSON string that contains application-specific data. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Body` | string | The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `DateCreated` | string (date-time) | The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `DateUpdated` | string (date-time) | The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `From` | string | The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `LastUpdatedBy` | string | The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `MediaSid` | string | The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. |

# `delete`

```elixir
@spec delete(Twilio.Client.t(), String.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:ok, map(), map()} | :ok | {:error, Twilio.Error.t()}
```

Operation: `DeleteMessage` | Tags: ChatV2Message

# `fetch`

```elixir
@spec fetch(Twilio.Client.t(), String.t(), String.t(), String.t(), keyword()) ::
  {:ok, Twilio.Resources.Chat.V2.Service.Channel.Message.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Operation: `FetchMessage` | Tags: ChatV2Message

# `list`

```elixir
@spec list(Twilio.Client.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Page.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Operation: `ListMessage` | Tags: ChatV2Message

## Query Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Order` | string | The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. |

# `stream`

```elixir
@spec stream(Twilio.Client.t(), String.t(), String.t(), map(), keyword()) ::
  Enumerable.t()
```

Stream:  (lazy auto-pagination).

# `update`

```elixir
@spec update(Twilio.Client.t(), String.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Chat.V2.Service.Channel.Message.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Operation: `UpdateMessage` | Tags: ChatV2Message

## Optional Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `Attributes` | string | A valid JSON string that contains application-specific data. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Body` | string | The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `DateCreated` | string (date-time) | The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `DateUpdated` | string (date-time) | The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. |
| `From` | string | The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `LastUpdatedBy` | string | The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. |

---

*Consult [api-reference.md](api-reference.md) for complete listing*
