Class Payload
- java.lang.Object
-
- com.slack.api.webhook.Payload
-
public class Payload extends Object
https://api.slack.com/incoming-webhooksImplementation of Incoming Webhook Payloads
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Payload.PayloadBuilder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Payload.PayloadBuilder
builder()
protected boolean
canEqual(Object other)
boolean
equals(Object o)
List<Attachment>
getAttachments()
An array of legacy secondary attachments.List<LayoutBlock>
getBlocks()
An array oflayout blocks
in the same format as described in the layout block guide.String
getChannel()
Deprecated.String
getIconEmoji()
Deprecated.String
getIconUrl()
Deprecated.Message.Metadata
getMetadata()
https://api.slack.com/metadataString
getText()
The first step is to prepare this message as a key/value pair in JSON.String
getThreadTs()
You can add the thread_ts parameter to your POST request in order to make your message appear as a reply in a thread.Boolean
getUnfurlLinks()
Pass true to enable unfurling of primarily text-based content.Boolean
getUnfurlMedia()
Pass false to disable unfurling of media content.String
getUsername()
Deprecated.int
hashCode()
void
setAttachments(List<Attachment> attachments)
An array of legacy secondary attachments.void
setBlocks(List<LayoutBlock> blocks)
An array oflayout blocks
in the same format as described in the layout block guide.void
setChannel(String channel)
Deprecated.void
setIconEmoji(String iconEmoji)
Deprecated.void
setIconUrl(String iconUrl)
Deprecated.void
setMetadata(Message.Metadata metadata)
https://api.slack.com/metadatavoid
setText(String text)
The first step is to prepare this message as a key/value pair in JSON.void
setThreadTs(String threadTs)
You can add the thread_ts parameter to your POST request in order to make your message appear as a reply in a thread.void
setUnfurlLinks(Boolean unfurlLinks)
Pass true to enable unfurling of primarily text-based content.void
setUnfurlMedia(Boolean unfurlMedia)
Pass false to disable unfurling of media content.void
setUsername(String username)
Deprecated.String
toString()
-
-
-
Method Detail
-
builder
public static Payload.PayloadBuilder builder()
-
getThreadTs
public String getThreadTs()
You can add the thread_ts parameter to your POST request in order to make your message appear as a reply in a thread.
-
getText
public String getText()
The first step is to prepare this message as a key/value pair in JSON. For a simple message, your JSON payload only needs to define a text property, containing the text that will be posted to the channel.
-
getChannel
@Deprecated public String getChannel()
Deprecated.NOTE: No longer works if your webhook is managed in a Slack app while it's still available for the custom integration (https://slack.com/apps/A0F7XDUAZ) in App Directory.Incoming webhooks output to a default channel and can only send messages to a single channel at a time. You can override a custom integration's configured channel by specifying the channel field in your JSON payload.
Specify a Slack channel by name with "channel": "#other-channel", or send a Slackbot message to a specific user with "channel": "@username".
-
getUsername
@Deprecated public String getUsername()
Deprecated.NOTE: No longer works if your webhook is managed in a Slack app while it's still available for the custom integration (https://slack.com/apps/A0F7XDUAZ) in App Directory.Incoming webhooks originate from a default identity you configured when originally creating your webhook. You can override a custom integration's configured name with the username field in your JSON payload.
-
getIconUrl
@Deprecated public String getIconUrl()
Deprecated.NOTE: No longer works if your webhook is managed in a Slack app while it's still available for the custom integration (https://slack.com/apps/A0F7XDUAZ) in App Directory.You can also override the bot icon either with icon_url or icon_emoji.
-
getIconEmoji
@Deprecated public String getIconEmoji()
Deprecated.NOTE: No longer works if your webhook is managed in a Slack app while it's still available for the custom integration (https://slack.com/apps/A0F7XDUAZ) in App Directory.You can also override the bot icon either with icon_url or icon_emoji.
-
getBlocks
public List<LayoutBlock> getBlocks()
An array oflayout blocks
in the same format as described in the layout block guide.
-
getAttachments
public List<Attachment> getAttachments()
An array of legacy secondary attachments. We recommend you useblocks
instead.
-
getUnfurlLinks
public Boolean getUnfurlLinks()
Pass true to enable unfurling of primarily text-based content.
-
getUnfurlMedia
public Boolean getUnfurlMedia()
Pass false to disable unfurling of media content.
-
getMetadata
public Message.Metadata getMetadata()
https://api.slack.com/metadata
-
setThreadTs
public void setThreadTs(String threadTs)
You can add the thread_ts parameter to your POST request in order to make your message appear as a reply in a thread.
-
setText
public void setText(String text)
The first step is to prepare this message as a key/value pair in JSON. For a simple message, your JSON payload only needs to define a text property, containing the text that will be posted to the channel.
-
setChannel
@Deprecated public void setChannel(String channel)
Deprecated.NOTE: No longer works if your webhook is managed in a Slack app while it's still available for the custom integration (https://slack.com/apps/A0F7XDUAZ) in App Directory.Incoming webhooks output to a default channel and can only send messages to a single channel at a time. You can override a custom integration's configured channel by specifying the channel field in your JSON payload.
Specify a Slack channel by name with "channel": "#other-channel", or send a Slackbot message to a specific user with "channel": "@username".
-
setUsername
@Deprecated public void setUsername(String username)
Deprecated.NOTE: No longer works if your webhook is managed in a Slack app while it's still available for the custom integration (https://slack.com/apps/A0F7XDUAZ) in App Directory.Incoming webhooks originate from a default identity you configured when originally creating your webhook. You can override a custom integration's configured name with the username field in your JSON payload.
-
setIconUrl
@Deprecated public void setIconUrl(String iconUrl)
Deprecated.NOTE: No longer works if your webhook is managed in a Slack app while it's still available for the custom integration (https://slack.com/apps/A0F7XDUAZ) in App Directory.You can also override the bot icon either with icon_url or icon_emoji.
-
setIconEmoji
@Deprecated public void setIconEmoji(String iconEmoji)
Deprecated.NOTE: No longer works if your webhook is managed in a Slack app while it's still available for the custom integration (https://slack.com/apps/A0F7XDUAZ) in App Directory.You can also override the bot icon either with icon_url or icon_emoji.
-
setBlocks
public void setBlocks(List<LayoutBlock> blocks)
An array oflayout blocks
in the same format as described in the layout block guide.
-
setAttachments
public void setAttachments(List<Attachment> attachments)
An array of legacy secondary attachments. We recommend you useblocks
instead.
-
setUnfurlLinks
public void setUnfurlLinks(Boolean unfurlLinks)
Pass true to enable unfurling of primarily text-based content.
-
setUnfurlMedia
public void setUnfurlMedia(Boolean unfurlMedia)
Pass false to disable unfurling of media content.
-
setMetadata
public void setMetadata(Message.Metadata metadata)
https://api.slack.com/metadata
-
canEqual
protected boolean canEqual(Object other)
-
-