# Work with Chat Messages

The following are Apex classes for the Slack `chat` [API methods](https://api.slack.com/methods?filter=chat).

:::tip
Many of these classes enable your Slack app to post a message using the bot token or user token based on the scopes required on the [Slack API methods](https://api.slack.com/methods?filter=chat). See [Bot Token and User Token Scopes](/docs/platform/salesforce-slack-sdk/guide/scopes.md#bot-token-and-user-token-scopes).
:::

## ChatDeleteRequest Class

Sends a request to delete a message.

**Usage**

See Slack’s [chat.delete method](https://api.slack.com/methods/chat.delete).

### ChatDeleteRequest Methods

The following are methods for `ChatDeleteRequest`.

#### builder()

Builds a request object that's used when executing the API call.

**Signature**

```java
public static Slack.ChatDeleteRequest.Builder builder()
```

**Return Value**

Type: Slack.ChatDeleteRequest.Builder

***

## ChatDeleteResponse Class

Deletes a message.

**Usage**

See Slack’s [chat.delete method](https://api.slack.com/methods/chat.delete).

### ChatDeleteResponse Methods

This class contains [standard response methods](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md).

The following are methods for `ChatDeleteResponse`.

#### getChannel()

The channel containing the message to be deleted.

**Signature**

```java
public String getChannel()
```

**Return Type**

Type: String

#### getDeprecatedArgument()

**Signature**

```java
public String getDeprecatedArgument()
```

**Return Value**

Type: String

#### getTs()

Gets the timestamp of the message to be deleted.

**Signature**

```java
public String getTs()
```

**Return Value**

Type: String

#### setChannel(channel)

**Signature**

```java
public void setChannel(String channel)
```

**Parameters**

*channel*

Type: String

The channel containing the message to be deleted.

**Return Value**

Type: void

#### setDeprecatedArgument(deprecatedArgument)

**Signature**

```java
public void setDeprecatedArgument(String deprecatedArgument)
```

**Parameters**

*deprecatedArgument*

Type: String

**Return Value**

Type: void

#### setTs(ts)

**Signature**

```java
public void setTs(String ts)
```

**Parameters**

*ts*

Type: String

**Return Value**

Type: void

***

## ChatDeleteScheduledMessageRequest Class

Sends a request to delete a pending scheduled message from the queue.

**Usage**

See Slack’s [chat.deleteScheduledMessage method](https://api.slack.com/methods/chat.deleteScheduledMessage).

### ChatDeleteScheduledMessageRequest Methods

The following are methods for `ChatDeleteScheduledMessageRequest`.

#### builder()

Builds a request object that's used when executing the API call.

**Signature**

```java
public static Slack.ChatDeleteScheduledMessageRequest.Builder builder()
```

**Return Value**

Type: Slack.ChatDeleteScheduledMessageRequest.Builder

***

## ChatDeleteScheduledMessageRequest.Builder Class

Contains methods to build an instance of the `Slack.ChatDeleteScheduledMessageRequest` class.

A Builder object is obtained by invoking one of the `ChatDeleteScheduledMessageRequest.Builder` methods defined by the `ChatDeleteScheduledMessageRequest` class.

### ChatDeleteScheduledMessageRequest.Builder Methods

The following are methods for `ChatDeleteScheduledMessageRequest.Builder`. These methods are optional unless specified otherwise.

#### build()

Required. Builds an instance of `Slack.ChatDeleteScheduledMessageRequest`.

**Signature**

```java
public Slack.ChatDeleteScheduledMessageRequest build()
```

**Return Value**

Type: Slack.ChatDeleteScheduledMessageRequest

#### channel(channel)

Required. The channel that the scheduled message is posting to.

**Signature**

```java
public Slack.ChatDeleteScheduledMessageRequest.Builder channel(String channel)
```

**Parameters**

*channel*

Type: String

**Return Value**

Type: Slack.ChatDeleteScheduledMessageRequest.Builder

#### scheduledMessageId(scheduledMessageId)

Required. The ID that's returned from a call to [ChatScheduleMessageRequest](#chatschedulemessagerequest-class).

**Signature**

```java
public Slack.ChatDeleteScheduledMessageRequest.Builder scheduledMessageId(String scheduledMessageId)
```

**Parameters**

*scheduledMessageId*

Type: String

**Return Value**

Type: Slack.ChatDeleteScheduledMessageRequest.Builder

***

## ChatDeleteScheduledMessageResponse Class

Deletes a pending scheduled message from the queue.

**Usage**

See Slack’s [chat.deleteScheduledMessage method](https://api.slack.com/methods/chat.deleteScheduledMessage).

### ChatDeleteScheduledMessageResponse Methods

This class contains [standard response methods](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md).

***

## ChatGetPermalinkRequest Class

Sends a request to retrieve a permalink URL.

**Usage**

See Slack’s [chat.getPermalink method](https://api.slack.com/methods/chat.getPermalink).

### ChatGetPermalinkRequest Methods

The following are methods for `ChatGetPermalinkRequest`.

#### builder()

**Signature**

```java
public static Slack.ChatGetPermalinkRequest.Builder builder()
```

**Return Value**

Type: Slack.ChatGetPermalinkRequest.Builder

***

## ChatGetPermalinkRequest.Builder Class

Contains methods to build an instance of the `Slack.ChatGetPermalinkRequest` class.

A Builder object is obtained by invoking one of the `ChatGetPermalinkRequest.Builder` methods defined by the `ChatGetPermalinkRequest` class.

These classes are optional unless specified otherwise.

### ChatGetPermalinkRequest.Builder Methods

The following are methods for `ChatGetPermalinkRequest.Builder`.

#### build()

Required. Builds an instance of `Slack.ChatGetPermalinkRequest`.

**Signature**

```java
public Slack.ChatGetPermalinkRequest build()
```

**Return Value**

Type: Slack.ChatGetPermalinkRequest

#### channel(channel)

Required. The ID of the conversation or channel containing the message.

**Signature**

```java
public Slack.ChatGetPermalinkRequest.Builder channel(String channel)
```

**Parameters**

*channel*

Type: String

**Return Value**

Type: Slack.ChatGetPermalinkRequest.Builder

#### messageTs(messageTs)

Required. The message's timestamp value, uniquely identifying it within a channel.

**Signature**

```java
public Slack.ChatGetPermalinkRequest.Builder messageTs(String messageTs)
```

**Parameters**

*messageTs*

Type: String

**Return Value**

Type: Slack.ChatGetPermalinkRequest.Builder

***

## ChatGetPermalinkResponse Class

Retrieves a permalink URL.

**Usage**

See Slack’s [chat.getPermalink method](https://api.slack.com/methods/chat.getPermalink).

### ChatGetPermalinkResponse Methods

This class contains [standard response methods](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md).

The following are methods for `ChatGetPermalinkResponse`.

#### getChannel()

**Signature**

```java
public String getChannel()
```

**Return Value**

Type: String

#### getPermalink()

**Signature**

```java
public String getPermalink()
```

**Return Value**

Type: String

#### setChannel()

**Signature**

```java
public void setChannel(String channel)
```

**Parameters**

*channel*

Type: String

**Return Value**

Type: void

#### setPermalink()

**Signature**

```java
public void setPermalink(String permalink)
```

**Parameters**

*permalink*

Type: String

**Return Value**

Type: void

***

## ChatMeMessageRequest Class

Sends a request to share a me message into a channel.

**Usage**

See Slack’s [chat.meMessage method](https://api.slack.com/methods/chat.meMessage).

:::note
Consider using `chat:write` scope on the user token only in response to an inciting user action and inform users that a message will be posted on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship).
:::

### ChatMeMessageRequest Methods

The following are methods for `ChatMeMessageRequest`.

#### builder()

Builds a request object that's used when executing the API call.

**Signature**

```java
public static Slack.ChatMeMessageRequest.Builder builder()
```

**Return Value**

Type: Slack.ChatMeMessageRequest.Builder

***

## ChatMeMessageRequest.Builder Class

Contains methods to build an instance of the `Slack.ChatMeMessageRequest` class.

A Builder object is obtained by invoking one of the `ChatMeMessageRequest.Builder` methods defined by the `ChatMeMessageRequest` class.

### ChatMeMessageRequest.Builder Methods

The following are methods for `ChatMeMessageRequest.Builder`.

#### build()

Required. Builds an instance of `Slack.ChatMeMessageRequest`.

**Signature**

```java
public Slack.ChatMeMessageRequest build()
```

**Return Value**

Type: Slack.ChatMeMessageRequest

#### channel(channel)

Required. The ID or name of the channel to send message to, which can be a public channel, private group or IM channel.

**Signature**

```java
public Slack.ChatMeMessageRequest.Builder channel(String channel)
```

**Return Value**

Type: Slack.ChatMeMessageRequest.Builder

#### text(text)

Required. Text of the message to send.

**Signature**

```java
public Slack.ChatMeMessageRequest.Builder text(String text)
```

**Parameters**

*text*

Type: String

**Return Value**

Type: Slack.ChatMeMessageRequest.Builder

***

## ChatMeMessageResponse Class

Shares a me message into a channel.

**Usage**

See Slack’s [chat.meMessage method](https://api.slack.com/methods/chat.meMessage).

### ChatMeMessageResponse Methods

This class contains [standard response methods](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md).

The following are methods for `ChatMeMessageResponse`.

#### getChannel()

The channel ID or name where the me message is shared.

**Signature**

```java
public String getChannel()
```

**Return Value**

Type: String

#### getTs()

Gets the timestamp of the me message.

**Signature**

```java
public String getTs()
```

**Return Value**

Type: String

#### setChannel(channel)

Sets the channel ID or name to send the message to, which can be a public or private group or IM channel.

**Signature**

```java
public void setChannel(String channel)
```

**Return Value**

Type: void

#### setTs(ts)

Sets the timestamp on the me message.

**Signature**

```java
public void setTs(String ts)
```

**Parameters**

*ts*

Type: String

**Return Value**

Type: void

***

## ChatPostEphemeralRequest Class

Sends a request to send an ephemeral message to a user in a channel.

**Usage**

See Slack’s [chat.postEphemeral method](https://api.slack.com/methods/chat.postEphemeral).

:::note
Consider using `chat:write` scope on the user token only in response to an inciting user action inform users that a message will be posted on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship).
:::

### ChatPostEphemeralRequest Methods

The following are methods for `ChatPostEphemeralRequest`.

#### builder()

Builds a request object that's used when executing the API call.

**Signature**

```java
public static Slack.ChatPostEphemeralRequest.Builder builder()
```

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

***

## ChatPostEphemeralRequest.Builder Class

Contains methods to build an instance of the `Slack.ChatPostEphemeralRequest` class.

A Builder object is obtained by invoking one of the `ChatPostEphemeralRequest.Builder` methods defined by the `ChatPostEphemeralRequest` class.

### ChatPostEphemeralRequest.Builder Methods

The following are methods for `ChatPostEphemeralRequest.Builder`. These methods are optional unless specified otherwise.

#### attachmentsAsString(attachmentsAsString)

**Signature**

```java
public Slack.ChatPostEphemeralRequest.Builder
attachmentsAsString(String attachmentsAsString)
```

**Parameters**

*attachmentsAsString*

Type: String

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

#### build()

Required. Builds an instance of `Slack.ChatPostEphemeralRequest`.

**Signature**

```java
public Slack.ChatPostEphemeralRequest build()
```

**Return Value**

Type: Slack.ChatPostEphemeralRequest

#### channel(channel)

Required. The ID or name of the channel, private group, or IM channel to send message to.

**Signature**

```java
public Slack.ChatPostEphemeralRequest.Builder channel(String channel)
```

**Parameters**

*channel*

Type: String

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

#### iconEmoji(iconEmoji)

The emoji to use the icon for this message. Overrides the icon URL. Use an icon emoji with the `chat:write:bot` scope only. Otherwise, this is ignored.

**Signature**

```java
public Slack.ChatPostEphemeralRequest.Builder
iconEmoji(String iconEmoji)
```

**Parameters**

*iconEmoji*

Type: String

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

#### iconUrl(iconUrl)

URL to an image to use as the icon for this message. Use an icon URL with the `chat:write:bot` scope only. Otherwise, this is ignored.

**Signature**

```java
public Slack.ChatPostEphemeralRequest.Builder iconUrl(String iconUrl)
```

**Parameters**

*iconUrl*

Type: String

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

#### linkNames(linkNames)

Find and link channel names and usernames.

**Signature**

```java
public Slack.ChatPostEphemeralRequest.Builder linkNames(Boolean linkNames)
```

**Parameters**

*linkNames*

Type: Boolean

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

#### parse(parse)

Changes how messages are treated. Defaults to `none`. See [Formatting](https://api.slack.com/methods/chat.postEphemeral#formatting).

**Signature**

```java
public Slack.ChatPostEphemeralRequest.Builder parse(String parse)
```

**Parameters**

*parse*

Type: String

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

#### text(text)

Required. Text of the message. See [Using text with blocks or attachments](https://api.slack.com/methods/chat.postEphemeral#text_usage).

**Signature**

```java
public Slack.ChatPostEphemeralRequest.Builder text(String text)
```

**Parameters**

*text*

Type: String

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

#### threadTs(threadTs)

**Signature**

```java
public Slack.ChatPostEphemeralRequest.Builder threadTs(String threadTs)
```

**Parameters**

*threadTs*

Type: String

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

#### user(user)

Required. The ID of the user receiving the ephemeral message. This user belongs in the channel specified by `channel(channel)`.

**Signature**

```java
public Slack.ChatPostEphemeralRequest.Builder user(String user)
```

**Parameters**

*user*

Type: String

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

#### username(username)

The bot’s username. Must be used with the `chat:write:bot` scope.

**Signature**

```java
public Slack.ChatPostEphemeralRequest.Builder username(String username)
```

**Parameters**

*username*

Type: String

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

#### viewReference(viewReference)

**Signature**

```java
public Slack.ChatPostEphemeralRequest.Builder viewReference(Slack.ViewReference viewReference)
```

**Parameters**

*viewReference*

Type: Slack.ViewReference

**Return Value**

Type: Slack.ChatPostEphemeralRequest.Builder

***

## ChatPostEphemeralResponse Class

Sends an ephemeral message to a user in a channel.

**Usage**

See Slack’s [chat.postEphemeral method](https://api.slack.com/methods/chat.postEphemeral).

### ChatPostEphemeralResponse Methods

This class contains [standard response methods](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md).

The following are methods for `ChatPostEphemeralResponse`.

```java
getDeprecatedArgument()
```

**Signature**

```java
public String getDeprecatedArgument()
```

**Return Value**

Type: String

#### getMessageTs()

**Signature**

```java
public String getMessageTs()
```

**Return Value**

Type: String

#### setDeprecatedArgument(deprecatedArgument)

**Signature**

```java
public void setDeprecatedArgument(String deprecatedArgument)
```

**Parameters**

*deprecatedArgument*

Type: String

**Return Value**

Type: void

#### setMessageTs(messageTs)

Sets the timestamp on the message.

**Signature**

```java
public void setMessageTs(String messageTs)
```

**Parameters**

*messageTs*

Type: String

**Return Value**

Type: void

***

## ChatPostMessageRequest Class

Sends a request to post a message to a channel.

**Usage**

See Slack’s [chat.postMessage method](https://api.slack.com/methods/chat.postMessage).

In this example, the `PostMessage` action runs when a user enters your slash command. The `ViewReference` gets the `selection` view to display a select menu. When the value on the select menu changes, it calls an Apex `slackHomeViewSelectChanged` action that's specified on its onchange `definition` key. Finally, the `apphome` view is published with the selected value.

```java
public class PostMessage extends Slack.SlashCommandDispatcher {

    public override Slack.ActionHandler invoke(Slack.SlashCommandParameters parameters, Slack.RequestContext context) {
        return Slack.ActionHandler.ack(new Handler(parameters, context));
    }

    public class Handler implements Slack.RunnableHandler {
        Slack.SlashCommandParameters parameters;
        Slack.RequestContext context;

        public Handler(Slack.SlashCommandParameters parameters, Slack.RequestContext context){
            this.parameters = parameters;
            this.context = context;
        }

        public void run () {
            Slack.App app = Slack.App.MySlackApp.get();
            Slack.BotClient client = app.getBotClientForTeam(context.getTeamId());
            Slack.ViewReference viewReference = Slack.View.selection.get();
            String channel = context.getChannelId();

            Slack.ChatPostMessageRequest req = new Slack.ChatPostMessageRequest.builder()
                .channel(channel)
                .viewReference(viewReference)
                .build();

        Slack.ChatPostMessageResponse response = client.chatPostMessage(req);
        if (response.getError() != null) {
            System.debug(response.getError());
        } else {
            System.debug('success');
        }
      }
    }
}
```

The `selection` view looks like this.

```yaml
description: "Notifier Message"
components:
  - definition: message
    properties:
      title: "Notifier"
    components:
      - definition: input
        name: "input_block"
        properties:
          label: "Select an option"
        components:
          - definition: select
            properties:
              name: "select_options"
              value: "option_1"
              placeholder: "Please select an option."
              options:
                - identifier: "option_1"
                  label: "Option 1"
                - identifier: "option_2"
                  label: "Option 2"
            events:
              onchange:
                definition: "apex__action__slackHomeViewSelectChanged"
```

Changing the value on the select menu calls the `slackHomeViewSelectChanged` Apex action, which extends [ActionDispatcher](/docs/platform/salesforce-slack-sdk/guide/apex_ref_dispatchers.md#actiondispatcher-class).

```java
public class slackHomeViewSelectChanged extends Slack.ActionDispatcher {

      public override Slack.ActionHandler invoke(Map<String, Object> parameters, Slack.RequestContext context) {
        return Slack.ActionHandler.ack(new Handler(parameters, context));
    }

    public class Handler implements Slack.RunnableHandler {

        Map<String, Object> parameters;
        Slack.RequestContext context;

        public Handler (Map<String, Object> parameters, Slack.RequestContext context){
            this.parameters = parameters;
            this.context = context;
        }

        public void run () {
            Slack.App app = Slack.App.MySlackApp.get();
            Slack.BotClient botClient = app.getBotClientForTeam(context.getTeamId());
            Slack.ViewReference viewReference = Slack.View.apphome.get();

            Slack.ActionPayload actionPayload = context.getActionPayload();
            if (actionPayload != null) {
                String name = actionPayload.getName();
                if (name == 'select_options') {
                    Object value = actionPayload.getValue();
                    viewReference.setParameter('selected', value.toString());
                }
            }

            Slack.HomeView homeView = new Slack.HomeView.builder()
                .viewReference(viewReference)
                .build();

            Slack.ViewsPublishRequest req = new Slack.ViewsPublishRequest.builder()
                .userId(context.getUserId())
                .view(homeView)
                .build();

            Slack.ViewsPublishResponse response = botClient.viewsPublish(req);

            if (response.getError() != null) {
                System.debug(response.getError());
            }
        }
    }
}
```

The `apphome` view looks like this.

```yaml
description: "Home page"
schema:
  properties:
    selected:
      type: string
      defaultValue: "no option has been selected"
components:
  - definition: home
    properties:
      title: "Sample Home"
    components:
      - definition: section
        properties:
          text: "This is the App Home page!!!"
      - definition: section
        properties:
          text: "Selected: {!view.properties.selected}"
```

:::note
Consider using `chat:write` scope on the user token only in response to an inciting user action and inform users that a message will be posted on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship).
:::

### ChatPostMessageRequest Methods

The following are methods for `ChatPostMessageRequest`.

#### builder()

**Signature**

```java
public static Slack.ChatPostMessageRequest.Builder builder()
```

**Return Value**

Type: `Slack.ChatPostMessageRequest.Builder`

***

## ChatPostMessageRequest.Builder Class

Contains methods to build an instance of the `Slack.ChatPostMessageRequest` class.

A Builder object is obtained by invoking one of the `ChatPostMessageRequest.Builder` methods defined by the `ChatPostMessageRequest` class.

### ChatPostMessageRequest.Builder Methods

The following are methods for `ChatPostMessageRequest.Builder`. These methods are optional unless specified otherwise.

#### attachmentsAsString(attachmentsAsString)

Required if `text(text)` isn't used. Describes the content of the message. A JSON-based array of structured attachments, presented as a URL-encoded string. If this method is used, `text(text)` is fallback text for notifications only.

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder
attachmentsAsString(String attachmentsAsString)
```

**Parameters**

*attachmentsAsString*

Type: String

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### build()

Required. Builds an instance of `Slack.ChatPostMessageRequest`.

**Signature**

```java
public Slack.ChatPostMessageRequest build()
```

**Return Value**

Type: Slack.ChatPostMessageRequest

#### channel(channel)

Required. The ID or name of the channel, private group, or IM channel to send the message to. See [Slack's channels usage info](https://api.slack.com/methods/chat.postMessage#channels).

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder channel(String channel)
```

**Parameters**

*channel*

Type: String

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### iconEmoji(iconEmoji)

The emoji to use the icon for this message. Overrides the icon URL. Use an icon emoji with the `chat:write:customize` scope only. Otherwise, this is ignored.

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder iconEmoji(String iconEmoji)
```

**Parameters**

*iconEmoji*

Type: String

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### iconUrl(iconUrl)

URL to an image to use as the icon for this message. Use an icon URL with the `chat:write:customize` scope only. Otherwise, this is ignored.

**Parameters**

*iconUrl*

Type: String

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### linkNames(linkNames)

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder linkNames(Boolean linkNames)
```

**Parameters**

*linkNames*

Type: Boolean

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### mrkdwn(mrkdwn)

Specifies whether Slack markup parsing is enabled. Defaults to enabled (true).

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder mrkdwn(Boolean mrkdwn)
```

**Parameters**

*mrkdwn*

Type: Boolean

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### parse(parse)

Changes how messages are treated. See [Formatting messages](https://api.slack.com/methods/chat.postMessage#formatting).

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder parse(String parse)
```

**Parameters**

*parse*

Type: String

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### replyBroadcast(replyBroadcast)

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder
replyBroadcast(Boolean replyBroadcast)
```

**Parameters**

*replyBroadcast*

Type: Boolean

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### text(text)

Required only if `attachmentsAsString()` isn't used. If `attachmentsAsString()` is used, `text(text)` is fallback text for notifications only.

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder text(String text)
```

**Parameters**

*text*

Type: String

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### threadTs(threadTs)

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder
threadTs(String threadTs)
```

**Parameters**

*threadTs*

Type: String

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### unfurlLinks(unfurlLinks)

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder
unfurlLinks(Boolean unfurlLinks)
```

**Parameters**

*unfurlLinks*

Type: Boolean

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### unfurlMedia(unfurlMedia)

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder
unfurlMedia(Boolean unfurlMedia)
```

**Parameters**

*unfurlMedia*

Type: Boolean

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### username(username)

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder
username(String username)
```

**Parameters**

*username*

Type: String

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

#### viewReference(viewReference)

**Signature**

```java
public Slack.ChatPostMessageRequest.Builder
viewReference(Slack.ViewReference viewReference)
```

**Parameters**

*viewReference*

Type: Slack.ViewReference

**Return Value**

Type: Slack.ChatPostMessageRequest.Builder

***

## ChatPostMessageResponse Class

Posts a message to a channel.

**Usage**

See Slack’s [chat.](https://api.slack.com/methods/chat.postMessage)[postMessage method](https://api.slack.com/methods/chat.postMessage).

### ChatPostMessageResponse Methods

This class contains [standard response methods](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md).

The following are methods for `ChatPostMessageResponse`.

#### getChannel()

Gets the ID or name of the channel, private group, or IM channel to send the message to.

**Signature**

```java
public String getChannel()
```

**Return Value**

Type: String

#### getDeprecatedArgument()

**Signature**

```java
public String getDeprecatedArgument()
```

**Return Value**

Type: String

#### getMessage()

**Signature**

```java
public Slack.Message getMessage()
```

**Return Value**

Type: [Slack.Message](/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md)

#### getResponseMetadata()

**Signature**

```java
public Slack.ErrorResponseMetadata getResponseMetadata()
```

**Return Value**

Type: [Slack.ErrorResponseMetadata](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class)

#### getTs()

**Signature**

```java
public String getTs()
```

**Return Value**

Type: String

#### setChannel(channel)

**Signature**

```java
public void setChannel(String channel)
```

**Parameters**

*channel*

Type: String

**Return Value**

Type: void

#### setDeprecatedArgument(deprecatedArgument)

**Signature**

```java
public void setDeprecatedArgument(String deprecatedArgument)
```

**Parameters**

*deprecatedArgument*

Type: String

**Return Value**

Type: void

#### setMessage(message)

**Signature**

```java
public void setMessage(Slack.Message message)
```

**Parameters**

*message*

Type: [Slack.Message](/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md)

**Return Value**

Type: void

#### setResponseMetadata(responseMetadata)

**Signature**

```java
public void setResponseMetadata(Slack.ErrorResponseMetadata responseMetadata)
```

**Parameters**

*responseMetadata*

Type: [Slack.ErrorResponseMetadata](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#errorresponsemetadata-class)

**Return Value**

Type: void

#### setTs(ts)

**Signature**

```java
public void setTs(String ts)
```

**Parameters**

*ts*

Type: String

**Return Value**

Type: void

***

## ChatScheduledMessagesListRequest Class

Sends a request to return a list of scheduled messages.

**Usage**

See Slack’s [chat.scheduleMessages.list method](https://api.slack.com/methods/chat.scheduledMessages.list).

### ChatScheduledMessagesListRequest Methods

The following are methods for `ChatScheduledMessagesListRequest`.

#### builder()

Builds a request object that's used when executing the API call.

**Signature**

```java
public static Slack.ChatScheduledMessagesListRequest.Builder builder()
```

**Return Value**

Type: Slack.ChatScheduledMessagesListRequest.Builder

***

## ChatScheduledMessagesListRequest.Builder Class

Contains methods to build an instance of the `Slack.ChatScheduledMessagesListRequest` class.

A Builder object is obtained by invoking one of the `ChatScheduledMessagesListRequest.Builder` methods defined by the `ChatScheduledMessagesListRequest` class.

### ChatScheduledMessagesListRequest.Builder Methods

The following are methods for `ChatScheduledMessagesListRequest.Builder`. These methods are optional unless specified otherwise.

#### build()

Required. Builds an instance of `Slack.ChatScheduledMessagesListRequest`.

**Signature**

```java
public Slack.ChatScheduledMessagesListRequest build()
```

**Return Value**

Type: Type: Slack.ChatScheduledMessagesListRequest

#### channel(channel)

**Signature**

```java
public Slack.ChatScheduledMessagesListRequest.Builder
channel(String channel)
```

**Parameters**

*channel*

Type: String

**Return Value**

Type: Slack.ChatScheduledMessagesListRequest.Builder

#### cursor(cursor)

**Signature**

```java
public Slack.ChatScheduledMessagesListRequest.Builder
cursor(String cursor)
```

**Parameters**

*cursor*

Type: String

**Return Value**

Type: Slack.ChatScheduledMessagesListRequest.Builder

#### latest(latest)

**Signature**

```java
public Slack.ChatScheduledMessagesListRequest.Builder
latest(String latest)
```

**Parameters**

*latest*

Type: String

**Return Value**

Type: Slack.ChatScheduledMessagesListRequest.Builder

#### limitValue(limitValue)

**Signature**

```java
public Slack.ChatScheduledMessagesListRequest.Builder
limitValue(Integer limitValue)
```

**Parameters**

*limitValue*

Type: Integer

**Return Value**

Type: Slack.ChatScheduledMessagesListRequest.Builder

#### oldest(oldest)

**Signature**

```java
public Slack.ChatScheduledMessagesListRequest.Builder
oldest(String oldest)
```

**Parameters**

*oldest*

Type: String

**Return Value**

Type: Slack.ChatScheduledMessagesListRequest.Builder

#### teamId(teamId)

**Signature**

```java
public Slack.ChatScheduledMessagesListRequest.Builder
teamId(String teamId)
```

**Parameters**

*teamId*

Type: String

**Return Value**

Type: Slack.ChatScheduledMessagesListRequest.Builder

***

## ChatScheduledMessagesListResponse Class

Returns a list of scheduled messages.

### ChatScheduledMessagesListResponse Methods

This class contains [standard response methods](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md).

The following are methods for `ChatScheduledMessagesListResponse`.

#### getResponseMetadata()

**Signature**

```java
public Slack.ResponseMetadata getResponseMetadata()
```

**Return Value**

Type: [Slack.ResponseMetadata](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class)

#### getScheduledMessages()

**Signature**

```java
public List<Slack.ChatScheduledMessagesListResponse.ScheduledMessage> getScheduledMessages()
```

**Return Value**

Type: List\<Slack.ChatScheduledMessagesListResponse.ScheduledMessage>

#### setResponseMetadata(responseMetadata()

**Signature**

```java
public void setResponseMetadata(Slack.ResponseMetadata responseMetadata)
```

**Parameters**

*responseMetadata*

Type: [Slack.ResponseMetadata](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response_metadata.md#responsemetadata-class)

**Return Value**

Type: void

#### setScheduledMessages(scheduledMessages)

**Signature**

```java
public void setScheduledMessages(List<Slack.ChatScheduledMessagesListResponse.ScheduledMessage> scheduledMessages)
```

**Parameters**

*scheduledMessages*

Type: List\<Slack.ChatScheduledMessagesListResponse.ScheduledMessage>

**Return Value**

Type: void

***

## ChatScheduledMessagesListResponse.ScheduledMessage Class

### ChatScheduledMessagesListResponse.ScheduledMessage Methods

The following are methods for `ChatScheduledMessagesListResponse.ScheduledMessage`.

#### getChannelId()

Gets the ID of the channel where the scheduled messages are posted to.

**Signature**

```java
public String getChannelId()
```

**Return Value**

Type: String

#### getDateCreated()

Gets the timestamp of when the scheduled message was created.

**Signature**

```java
public Integer getDateCreated()
```

**Return Value**

Type: Integer

#### getId()

Gets the ID of the scheduled message.

**Signature**

```java
public String getId()
```

**Return Value**

Type: String

#### getPostAt()

Gets the timestamp of when the message is to be posted.

**Signature**

```java
public Integer getPostAt()
```

**Return Value**

Type: Integer

#### getText()

Gets the content of the message.

**Signature**

```java
public String getText()
```

**Return Value**

Type: String

#### setChannelId(channelId)

Sets the ID of the channel for which to post the scheduled message.

**Signature**

```java
public void setChannelId(String channelId)
```

**Parameters**

*channelId*

Type: String

**Return Value**

Type: void

#### setDateCreated(dateCreated)

Sets the timestamp for when the scheduled message was created.

**Signature**

```java
public void setDateCreated(Integer dateCreated)
```

**Parameters**

*dateCreated*

Type: Integer

**Return Value**

Type: void

#### setId(id)

**Signature**

```java
public void setId(String id)
```

**Parameters**

*id*

Type: String

**Return Value**

Type: void

#### setPostAt(postAt)

Sets the timestamp for when the message is scheduled to be posted.

**Signature**

```java
public void setPostAt(Integer postAt)
```

**Parameters**

*postAt*

Type: Integer

**Return Value**

Type: void

#### setText(text)

**Signature**

```java
public void setText(String text)
```

**Parameters**

*text*

Type: String

**Return Value**

Type: void

***

## ChatScheduleMessageRequest Class

Sends a request to schedule a message to be sent to a channel.

**Usage**

See Slack’s [chat.scheduleMessage method](https://api.slack.com/methods/chat.scheduleMessage).

:::note
Consider using `chat:write` scope on the user token only in response to an inciting user action and inform users that a message will be posted on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship).
:::

### ChatScheduleMessageRequest Methods

The following are methods for `ChatScheduleMessageRequest`.

#### builder()

Builds a request object that's used when executing the API call.

**Signature**

```java
public static Slack.ChatScheduleMessageRequest.Builder
builder()
```

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

***

## ChatScheduleMessageRequest.Builder Class

Contains methods to build an instance of the `Slack.ChatScheduleMessageRequest` class.

A Builder object is obtained by invoking one of the `ChatScheduleMessageRequest.Builder` methods defined by the `ChatScheduleMessageRequest` class.

### ChatScheduleMessageRequest.Builder Methods

The following are methods for `ChatScheduleMessageRequest.Builder`. These methods are optional unless specified otherwise.

#### attachmentsAsString(attachmentsAsString)

**Signature**

```java
public Slack.ChatScheduleMessageRequest.Builder
attachmentsAsString(String attachmentsAsString)
```

**Parameters**

*attachmentsAsString*

Type: String

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

#### build()

Required. Builds an instance of `Slack.ChatScheduleMessageRequest`.

**Signature**

```java
public Slack.ChatScheduleMessageRequest build()
```

**Return Value**

Type: Slack.ChatScheduleMessageRequest

#### channel(channel)

Required. The ID or name of the channel, private group, or DM channel to send the message to. See [Slack's channels usage info](https://api.slack.com/methods/chat.scheduleMessage#channels).

**Signature**

```java
public Slack.ChatScheduleMessageRequest.Builder
channel(String channel)
```

**Parameters**

*channel*

Type: String

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

#### linkNames(linkNames)

**Signature**

```java
public Slack.ChatScheduleMessageRequest.Builder
linkNames(Boolean linkNames)
```

**Parameters**

*linkNames*

Type: Boolean

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

#### parse(parse)

Changes how messages are treated. See [chat.postMessage](https://api.slack.com/methods/chat.postMessage#formatting).

**Signature**

```java
public Slack.ChatScheduleMessageRequest.Builder parse(String parse)
```

**Parameters**

*parse*

Type: String

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

#### setPostAt(postAt)

Required. Sets the Unix EPOCH timestamp for when the message is scheduled to be posted.

**Signature**

```java
public Slack.ChatScheduleMessageRequest.Builder setPostAt(Integer postAt)
```

**Parameters**

*postAt*

Type: Integer

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

#### replyBroadcast(replyBroadcast)

**Signature**

```java
public Slack.ChatScheduleMessageRequest.Builder
replyBroadcast(Boolean replyBroadcast)
```

**Parameters**

*replyBroadcast*

Type: Boolean

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

#### text(text)

Required. The text for the message. If you include an optional viewReference to render the message, Slack will use "text" as a fallback string. See [Slack's text usage info](https://api.slack.com/methods/chat.scheduleMessage#arg_text).

**Signature**

```java
public Slack.ChatScheduleMessageRequest.Builder text(String text)
```

**Parameters**

*text*

Type: String

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

#### threadTs(threadTs)

**Signature**

```java
public Slack.ChatScheduleMessageRequest.Builder threadTs(String threadTs)
```

**Parameters**

*threadTs*

Type: String

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

#### unfurlLinks(unfurlLinks)

**Signature**

```java
public Slack.ChatScheduleMessageRequest.Builder unfurlLinks(Boolean unfurlLinks)
```

**Parameters**

*unfurlLinks*

Type: Boolean

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

#### unfurlMedia(unfurlMedia)

**Signature**

```java
public Slack.ChatScheduleMessageRequest.Builder
unfurlMedia(Boolean unfurlMedia)
```

**Parameters**

*unfurlMedia*

Type: Boolean

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

#### viewReference(viewReference)

**Signature**

```java
public Slack.ChatScheduleMessageRequest.Builder
viewReference(Slack.ViewReference viewReference)
```

**Parameters**

*viewReference*

Type: Slack.ViewReference

**Return Value**

Type: Slack.ChatScheduleMessageRequest.Builder

***

## ChatScheduleMessageResponse Class

Schedules a message to be sent to a channel.

**Usage**

See Slack’s [chat.scheduleMessage method](https://api.slack.com/methods/chat.scheduleMessage).

### ChatScheduleMessageResponse Methods

This class contains [standard response methods](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md).

The following are methods for `ChatScheduleMessageResponse`.

#### getChannel()

**Signature**

```java
public String getChannel()
```

**Return Value**

Type: String

#### getMessage()

**Signature**

```java
public Slack.ChatScheduleMessageResponse.ScheduledMessage getMessage()
```

**Return Value**

Type: Slack.ChatScheduleMessageResponse.ScheduledMessage

#### getPostAt()

**Signature**

```java
public Integer getPostAt()
```

**Return Value**

Type: Integer

#### getScheduledMessageId()

**Signature**

```java
public String getScheduledMessageId()
```

**Return Value**

Type: String

#### setChannel(channel)

**Signature**

```java
public void setChannel(String channel)
```

**Parameters**

*channel*

Type: String

**Return Value**

Type: void

#### setMessage(message)

**Signature**

```java
public void setMessage(Slack.ChatScheduleMessageResponse.ScheduledMessage message)
```

**Parameters**

*message*

Type: Slack.ChatScheduleMessageResponse.ScheduledMessage

**Return Value**

Type: void

#### postAt(postAt)

**Signature**

```java
public void postAt(Integer postAt)
```

**Parameters**

*postAt*

Type: Integer

**Return Value**

Type: void

#### setScheduledMessageId(scheduledMessageId)

**Signature**

```java
public void setScheduledMessageId(String scheduledMessageId)
```

**Parameters**

*scheduledMessageId*

Type: String

**Return Value**

Type: void

***

## ChatScheduleMessageResponse.ScheduledMessage Class

### ChatScheduleMessageResponse.ScheduledMessage Methods

The following are methods for `ChatScheduleMessageResponse.ScheduledMessage`.

#### getBotId()

**Signature**

```java
public String getBotId()
```

**Return Value**

Type: String

#### getBotProfile()

**Signature**

```java
public Slack.BotProfile getBotProfile()
```

**Return Value**

Type: [Slack.BotProfile](/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class)

#### getTeam()

**Signature**

```java
public String getTeam()
```

**Return Value**

Type: String

#### getText()

**Signature**

```java
public String getText()
```

**Return Value**

Type: String

#### getType()

**Signature**

```java
public String getType()
```

**Return Value**

Type: String

#### getUser()

**Signature**

```java
public String getUser()
```

**Return Value**

Type: String

#### setBotId(botId)

**Signature**

```java
public void setBotId(String botId)
```

**Parameters**

*botId*

Type: String

**Return Value**

Type: void

#### setBotProfile(botProfile)

**Signature**

```java
public void setBotProfile(Slack.BotProfile botProfile)
```

**Parameters**

*botProfile*

Type: [Slack.BotProfile](/docs/platform/salesforce-slack-sdk/guide/apex_ref_bot.md#botprofile-class)

**Return Value**

Type: void

#### setTeam(team)

**Signature**

```java
public void setTeam(String team)
```

**Parameters**

*team*

Type: String

**Return Value**

Type: void

#### setText(text)

**Signature**

```java
public void setText(String text)
```

**Parameters**

*text*

Type: String

**Return Value**

Type: void

#### setType(type)

**Signature**

```java
public void setType(String type)
```

**Parameters**

*type*

Type: String

**Return Value**

Type: void

#### setUser(user)

**Signature**

```java
public void setUser(String user)
```

**Parameters**

*user*

Type: String

**Return Value**

Type: void

***

## ChatUpdateRequest Class

Sends a request to update a message.

**Usage**

See Slack’s [chat.update method](https://api.slack.com/methods/chat.update).

:::note
Consider using `chat:write` scope on the user token only in response to an inciting user action and give users a heads up that the message will be updated on their behalf. See [Sending messages as other entities](https://api.slack.com/methods/chat.postMessage#authorship).
:::

### ChatUpdateRequest Methods

The following are methods for `ChatUpdateRequest`.

#### builder()

Builds a request object that's used when executing the API call.

**Signature**

```java
public static Slack.ChatUpdateRequest.Builder builder()
```

**Return Value**

Type: Slack.ChatUpdateRequest.Builder

***

## ChatUpdateRequest.Builder Class

Contains methods to build an instance of the `Slack.ChatUpdateRequest` class.

A Builder object is obtained by invoking one of the `ChatUpdateRequest.Builder` methods defined by the `ChatUpdateRequest` class.

### ChatUpdateRequest.Builder Methods

The following are methods for `ChatUpdateRequest.Builder`. These methods are optional unless specified otherwise.

#### attachmentsAsString(attachmentsAsString)

**Signature**

```java
public Slack.ChatUpdateRequest.Builder attachmentsAsString(String attachmentsAsString)
```

**Parameters**

*attachmentsAsString*

Type: String

**Return Value**

Type: Slack.ChatUpdateRequest.Builder

#### build()

Required. Builds an instance of `Slack.ChatUpdateRequest`.

**Signature**

```java
public Slack.ChatUpdateRequest build()
```

**Return Value**

Type: Slack.ChatUpdateRequest

#### channel(channel)

Required. The channel containing the message to be updated.

**Signature**

```java
public Slack.ChatUpdateRequest.Builder channel(String channel)
```

**Parameters**

*channel*

Type: String

**Return Value**

Type: Slack.ChatUpdateRequest.Builder

#### linkNames(linkNames)

**Signature**

```java
public Slack.ChatUpdateRequest.Builder linkNames(Boolean linkNames)
```

**Parameters**

*linkNames*

Type: Boolean

**Return Value**

Type: Slack.ChatUpdateRequest.Builder

#### parse(parse)

**Signature**

```java
public Slack.ChatUpdateRequest.Builder parse(String parse)
```

**Parameters**

*parse*

Type: String

**Return Value**

Type: Slack.ChatUpdateRequest.Builder

#### text(text)

**Signature**

```java
public Slack.ChatUpdateRequest.Builder text(String text)
```

**Parameters**

*text*

Type: String

**Return Value**

Type: Slack.ChatUpdateRequest.Builder

#### ts(ts)

Required. The timestamp of the message to be updated.

**Signature**

```java
public Slack.ChatUpdateRequest.Builder ts(String ts)
```

**Parameters**

*ts*

Type: String

**Return Value**

Type: Slack.ChatUpdateRequest.Builder

#### viewReference(viewReference)

**Signature**

```java
public Slack.ChatUpdateRequest.Builder viewReference(Slack.ViewReference viewReference)
```

**Parameters**

*viewReference*

Type: Slack.ViewReference

**Return Value**

Type: Slack.ChatUpdateRequest.Builder

***

## ChatUpdateResponse Class

Updates a message.

### ChatUpdateResponse Methods

This class contains [standard response methods](/docs/platform/salesforce-slack-sdk/guide/apex_ref_response.md).

The following are methods for `ChatUpdateResponse`.

#### getChannel()

The channel containing the message to be updated.

**Signature**

```java
public String getChannel()
```

**Return Type**

Type: String

#### getDeprecatedArgument()

**Signature**

```java
public String getDeprecatedArgument()
```

**Return Value**

Type: String

#### getMessage()

**Signature**

```java
public Slack.Message getMessage()
```

**Return Value**

Type: [Slack.Message](/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md)

#### getText()

The text of the message.

**Signature**

```java
public string getText()
```

**Return Type**

Type: String

#### getTs()

Gets the timestamp of the message to be updated.

**Signature**

```java
public String getTs()
```

**Return Value**

Type: String

#### setChannel(channel)

**Signature**

```java
public void setChannel(String channel)
```

**Parameters**

*channel*

Type: String

The channel containing the message to be deleted.

**Return Value**

Type: void

#### setDeprecatedArgument(deprecatedArgument)

**Signature**

```java
public void setDeprecatedArgument(String deprecatedArgument)
```

**Parameters**

*deprecatedArgument*

Type: String

**Return Value**

Type: void

#### setMessage(message)

**Signature**

```java
public void setMessage(Slack.Message message)
```

**Parameters**

*message*

Type: [Slack.Message](/docs/platform/salesforce-slack-sdk/guide/apex_ref_messages.md)

**Return Value**

Type: void

#### setTs(ts)

**Signature**

```java
public void setTs(String ts)
```

**Parameters**

*ts*

Type: String

**Return Value**

Type: void
