Work with Chat Messages

The following are Apex classes for the Slack chat API methods.

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. See Bot Token and User Token Scopes.

ChatDeleteRequest Class

Sends a request to delete a message.

Usage

See Slack’s chat.delete method.

ChatDeleteRequest Methods

The following are methods for ChatDeleteRequest.

builder()

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

Signature

public static Slack.ChatDeleteRequest.Builder builder()

Return Value

Type: Slack.ChatDeleteRequest.Builder


ChatDeleteResponse Class

Deletes a message.

Usage

See Slack’s chat.delete method.

ChatDeleteResponse Methods

This class contains standard response methods.

The following are methods for ChatDeleteResponse.

getChannel()

The channel containing the message to be deleted.

Signature

public String getChannel()

Return Type

Type: String

getDeprecatedArgument()

Signature

public String getDeprecatedArgument()

Return Value

Type: String

getTs()

Gets the timestamp of the message to be deleted.

Signature

public String getTs()

Return Value

Type: String

setChannel(channel)

Signature

public void setChannel(String channel)

Parameters

channel

Type: String

The channel containing the message to be deleted.

Return Value

Type: void

setDeprecatedArgument(deprecatedArgument)

Signature

public void setDeprecatedArgument(String deprecatedArgument)

Parameters

deprecatedArgument

Type: String

Return Value

Type: void

setTs(ts)

Signature

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.

ChatDeleteScheduledMessageRequest Methods

The following are methods for ChatDeleteScheduledMessageRequest.

builder()

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

Signature

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

public Slack.ChatDeleteScheduledMessageRequest build()

Return Value

Type: Slack.ChatDeleteScheduledMessageRequest

channel(channel)

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

Signature

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.

Signature

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.

ChatDeleteScheduledMessageResponse Methods

This class contains standard response methods.


ChatGetPermalinkRequest Class

Sends a request to retrieve a permalink URL.

Usage

See Slack’s chat.getPermalink method.

ChatGetPermalinkRequest Methods

The following are methods for ChatGetPermalinkRequest.

builder()

Signature

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

public Slack.ChatGetPermalinkRequest build()

Return Value

Type: Slack.ChatGetPermalinkRequest

channel(channel)

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

Signature

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

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.

ChatGetPermalinkResponse Methods

This class contains standard response methods.

The following are methods for ChatGetPermalinkResponse.

getChannel()

Signature

public String getChannel()

Return Value

Type: String

getPermalink()

Signature

public String getPermalink()

Return Value

Type: String

setChannel()

Signature

public void setChannel(String channel)

Parameters

channel

Type: String

Return Value

Type: void

setPermalink()

Signature

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.

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.

ChatMeMessageRequest Methods

The following are methods for ChatMeMessageRequest.

builder()

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

Signature

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

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

public Slack.ChatMeMessageRequest.Builder channel(String channel)

Return Value

Type: Slack.ChatMeMessageRequest.Builder

text(text)

Required. Text of the message to send.

Signature

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.

ChatMeMessageResponse Methods

This class contains standard response methods.

The following are methods for ChatMeMessageResponse.

getChannel()

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

Signature

public String getChannel()

Return Value

Type: String

getTs()

Gets the timestamp of the me message.

Signature

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

public void setChannel(String channel)

Return Value

Type: void

setTs(ts)

Sets the timestamp on the me message.

Signature

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.

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.

ChatPostEphemeralRequest Methods

The following are methods for ChatPostEphemeralRequest.

builder()

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

Signature

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

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

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

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

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

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

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.

Signature

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.

Signature

public Slack.ChatPostEphemeralRequest.Builder text(String text)

Parameters

text

Type: String

Return Value

Type: Slack.ChatPostEphemeralRequest.Builder

threadTs(threadTs)

Signature

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

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

public Slack.ChatPostEphemeralRequest.Builder username(String username)

Parameters

username

Type: String

Return Value

Type: Slack.ChatPostEphemeralRequest.Builder

viewReference(viewReference)

Signature

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.

ChatPostEphemeralResponse Methods

This class contains standard response methods.

The following are methods for ChatPostEphemeralResponse.

getDeprecatedArgument()

Signature

public String getDeprecatedArgument()

Return Value

Type: String

getMessageTs()

Signature

public String getMessageTs()

Return Value

Type: String

setDeprecatedArgument(deprecatedArgument)

Signature

public void setDeprecatedArgument(String deprecatedArgument)

Parameters

deprecatedArgument

Type: String

Return Value

Type: void

setMessageTs(messageTs)

Sets the timestamp on the message.

Signature

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.

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.

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.

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.

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.

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.

ChatPostMessageRequest Methods

The following are methods for ChatPostMessageRequest.

builder()

Signature

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

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

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.

Signature

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

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

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

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.

Signature

public Slack.ChatPostMessageRequest.Builder parse(String parse)

Parameters

parse

Type: String

Return Value

Type: Slack.ChatPostMessageRequest.Builder

replyBroadcast(replyBroadcast)

Signature

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

public Slack.ChatPostMessageRequest.Builder text(String text)

Parameters

text

Type: String

Return Value

Type: Slack.ChatPostMessageRequest.Builder

threadTs(threadTs)

Signature

public Slack.ChatPostMessageRequest.Builder
threadTs(String threadTs)

Parameters

threadTs

Type: String

Return Value

Type: Slack.ChatPostMessageRequest.Builder

unfurlLinks(unfurlLinks)

Signature

public Slack.ChatPostMessageRequest.Builder
unfurlLinks(Boolean unfurlLinks)

Parameters

unfurlLinks

Type: Boolean

Return Value

Type: Slack.ChatPostMessageRequest.Builder

unfurlMedia(unfurlMedia)

Signature

public Slack.ChatPostMessageRequest.Builder
unfurlMedia(Boolean unfurlMedia)

Parameters

unfurlMedia

Type: Boolean

Return Value

Type: Slack.ChatPostMessageRequest.Builder

username(username)

Signature

public Slack.ChatPostMessageRequest.Builder
username(String username)

Parameters

username

Type: String

Return Value

Type: Slack.ChatPostMessageRequest.Builder

viewReference(viewReference)

Signature

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.postMessage method.

ChatPostMessageResponse Methods

This class contains standard response methods.

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

public String getChannel()

Return Value

Type: String

getDeprecatedArgument()

Signature

public String getDeprecatedArgument()

Return Value

Type: String

getMessage()

Signature

public Slack.Message getMessage()

Return Value

Type: Slack.Message

getResponseMetadata()

Signature

public Slack.ErrorResponseMetadata getResponseMetadata()

Return Value

Type: Slack.ErrorResponseMetadata

getTs()

Signature

public String getTs()

Return Value

Type: String

setChannel(channel)

Signature

public void setChannel(String channel)

Parameters

channel

Type: String

Return Value

Type: void

setDeprecatedArgument(deprecatedArgument)

Signature

public void setDeprecatedArgument(String deprecatedArgument)

Parameters

deprecatedArgument

Type: String

Return Value

Type: void

setMessage(message)

Signature

public void setMessage(Slack.Message message)

Parameters

message

Type: Slack.Message

Return Value

Type: void

setResponseMetadata(responseMetadata)

Signature

public void setResponseMetadata(Slack.ErrorResponseMetadata responseMetadata)

Parameters

responseMetadata

Type: Slack.ErrorResponseMetadata

Return Value

Type: void

setTs(ts)

Signature

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.

ChatScheduledMessagesListRequest Methods

The following are methods for ChatScheduledMessagesListRequest.

builder()

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

Signature

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

public Slack.ChatScheduledMessagesListRequest build()

Return Value

Type: Type: Slack.ChatScheduledMessagesListRequest

channel(channel)

Signature

public Slack.ChatScheduledMessagesListRequest.Builder
channel(String channel)

Parameters

channel

Type: String

Return Value

Type: Slack.ChatScheduledMessagesListRequest.Builder

cursor(cursor)

Signature

public Slack.ChatScheduledMessagesListRequest.Builder
cursor(String cursor)

Parameters

cursor

Type: String

Return Value

Type: Slack.ChatScheduledMessagesListRequest.Builder

latest(latest)

Signature

public Slack.ChatScheduledMessagesListRequest.Builder
latest(String latest)

Parameters

latest

Type: String

Return Value

Type: Slack.ChatScheduledMessagesListRequest.Builder

limitValue(limitValue)

Signature

public Slack.ChatScheduledMessagesListRequest.Builder
limitValue(Integer limitValue)

Parameters

limitValue

Type: Integer

Return Value

Type: Slack.ChatScheduledMessagesListRequest.Builder

oldest(oldest)

Signature

public Slack.ChatScheduledMessagesListRequest.Builder
oldest(String oldest)

Parameters

oldest

Type: String

Return Value

Type: Slack.ChatScheduledMessagesListRequest.Builder

teamId(teamId)

Signature

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.

The following are methods for ChatScheduledMessagesListResponse.

getResponseMetadata()

Signature

public Slack.ResponseMetadata getResponseMetadata()

Return Value

Type: Slack.ResponseMetadata

getScheduledMessages()

Signature

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

Return Value

Type: List<Slack.ChatScheduledMessagesListResponse.ScheduledMessage>

setResponseMetadata(responseMetadata()

Signature

public void setResponseMetadata(Slack.ResponseMetadata responseMetadata)

Parameters

responseMetadata

Type: Slack.ResponseMetadata

Return Value

Type: void

setScheduledMessages(scheduledMessages)

Signature

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

public String getChannelId()

Return Value

Type: String

getDateCreated()

Gets the timestamp of when the scheduled message was created.

Signature

public Integer getDateCreated()

Return Value

Type: Integer

getId()

Gets the ID of the scheduled message.

Signature

public String getId()

Return Value

Type: String

getPostAt()

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

Signature

public Integer getPostAt()

Return Value

Type: Integer

getText()

Gets the content of the message.

Signature

public String getText()

Return Value

Type: String

setChannelId(channelId)

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

Signature

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

public void setDateCreated(Integer dateCreated)

Parameters

dateCreated

Type: Integer

Return Value

Type: void

setId(id)

Signature

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

public void setPostAt(Integer postAt)

Parameters

postAt

Type: Integer

Return Value

Type: void

setText(text)

Signature

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.

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.

ChatScheduleMessageRequest Methods

The following are methods for ChatScheduleMessageRequest.

builder()

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

Signature

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

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

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.

Signature

public Slack.ChatScheduleMessageRequest.Builder
channel(String channel)

Parameters

channel

Type: String

Return Value

Type: Slack.ChatScheduleMessageRequest.Builder

linkNames(linkNames)

Signature

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.

Signature

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

public Slack.ChatScheduleMessageRequest.Builder setPostAt(Integer postAt)

Parameters

postAt

Type: Integer

Return Value

Type: Slack.ChatScheduleMessageRequest.Builder

replyBroadcast(replyBroadcast)

Signature

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.

Signature

public Slack.ChatScheduleMessageRequest.Builder text(String text)

Parameters

text

Type: String

Return Value

Type: Slack.ChatScheduleMessageRequest.Builder

threadTs(threadTs)

Signature

public Slack.ChatScheduleMessageRequest.Builder threadTs(String threadTs)

Parameters

threadTs

Type: String

Return Value

Type: Slack.ChatScheduleMessageRequest.Builder

unfurlLinks(unfurlLinks)

Signature

public Slack.ChatScheduleMessageRequest.Builder unfurlLinks(Boolean unfurlLinks)

Parameters

unfurlLinks

Type: Boolean

Return Value

Type: Slack.ChatScheduleMessageRequest.Builder

unfurlMedia(unfurlMedia)

Signature

public Slack.ChatScheduleMessageRequest.Builder
unfurlMedia(Boolean unfurlMedia)

Parameters

unfurlMedia

Type: Boolean

Return Value

Type: Slack.ChatScheduleMessageRequest.Builder

viewReference(viewReference)

Signature

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.

ChatScheduleMessageResponse Methods

This class contains standard response methods.

The following are methods for ChatScheduleMessageResponse.

getChannel()

Signature

public String getChannel()

Return Value

Type: String

getMessage()

Signature

public Slack.ChatScheduleMessageResponse.ScheduledMessage getMessage()

Return Value

Type: Slack.ChatScheduleMessageResponse.ScheduledMessage

getPostAt()

Signature

public Integer getPostAt()

Return Value

Type: Integer

getScheduledMessageId()

Signature

public String getScheduledMessageId()

Return Value

Type: String

setChannel(channel)

Signature

public void setChannel(String channel)

Parameters

channel

Type: String

Return Value

Type: void

setMessage(message)

Signature

public void setMessage(Slack.ChatScheduleMessageResponse.ScheduledMessage message)

Parameters

message

Type: Slack.ChatScheduleMessageResponse.ScheduledMessage

Return Value

Type: void

postAt(postAt)

Signature

public void postAt(Integer postAt)

Parameters

postAt

Type: Integer

Return Value

Type: void

setScheduledMessageId(scheduledMessageId)

Signature

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

public String getBotId()

Return Value

Type: String

getBotProfile()

Signature

public Slack.BotProfile getBotProfile()

Return Value

Type: Slack.BotProfile

getTeam()

Signature

public String getTeam()

Return Value

Type: String

getText()

Signature

public String getText()

Return Value

Type: String

getType()

Signature

public String getType()

Return Value

Type: String

getUser()

Signature

public String getUser()

Return Value

Type: String

setBotId(botId)

Signature

public void setBotId(String botId)

Parameters

botId

Type: String

Return Value

Type: void

setBotProfile(botProfile)

Signature

public void setBotProfile(Slack.BotProfile botProfile)

Parameters

botProfile

Type: Slack.BotProfile

Return Value

Type: void

setTeam(team)

Signature

public void setTeam(String team)

Parameters

team

Type: String

Return Value

Type: void

setText(text)

Signature

public void setText(String text)

Parameters

text

Type: String

Return Value

Type: void

setType(type)

Signature

public void setType(String type)

Parameters

type

Type: String

Return Value

Type: void

setUser(user)

Signature

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.

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.

ChatUpdateRequest Methods

The following are methods for ChatUpdateRequest.

builder()

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

Signature

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

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

public Slack.ChatUpdateRequest build()

Return Value

Type: Slack.ChatUpdateRequest

channel(channel)

Required. The channel containing the message to be updated.

Signature

public Slack.ChatUpdateRequest.Builder channel(String channel)

Parameters

channel

Type: String

Return Value

Type: Slack.ChatUpdateRequest.Builder

linkNames(linkNames)

Signature

public Slack.ChatUpdateRequest.Builder linkNames(Boolean linkNames)

Parameters

linkNames

Type: Boolean

Return Value

Type: Slack.ChatUpdateRequest.Builder

parse(parse)

Signature

public Slack.ChatUpdateRequest.Builder parse(String parse)

Parameters

parse

Type: String

Return Value

Type: Slack.ChatUpdateRequest.Builder

text(text)

Signature

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

public Slack.ChatUpdateRequest.Builder ts(String ts)

Parameters

ts

Type: String

Return Value

Type: Slack.ChatUpdateRequest.Builder

viewReference(viewReference)

Signature

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.

The following are methods for ChatUpdateResponse.

getChannel()

The channel containing the message to be updated.

Signature

public String getChannel()

Return Type

Type: String

getDeprecatedArgument()

Signature

public String getDeprecatedArgument()

Return Value

Type: String

getMessage()

Signature

public Slack.Message getMessage()

Return Value

Type: Slack.Message

getText()

The text of the message.

Signature

public string getText()

Return Type

Type: String

getTs()

Gets the timestamp of the message to be updated.

Signature

public String getTs()

Return Value

Type: String

setChannel(channel)

Signature

public void setChannel(String channel)

Parameters

channel

Type: String

The channel containing the message to be deleted.

Return Value

Type: void

setDeprecatedArgument(deprecatedArgument)

Signature

public void setDeprecatedArgument(String deprecatedArgument)

Parameters

deprecatedArgument

Type: String

Return Value

Type: void

setMessage(message)

Signature

public void setMessage(Slack.Message message)

Parameters

message

Type: Slack.Message

Return Value

Type: void

setTs(ts)

Signature

public void setTs(String ts)

Parameters

ts

Type: String

Return Value

Type: void