Class Payload

java.lang.Object
com.slack.api.webhook.Payload

public class Payload
extends java.lang.Object
https://api.slack.com/incoming-webhooks

Implementation of Incoming Webhook Payloads

  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  Payload.PayloadBuilder  
  • Method Summary

    Modifier and Type Method Description
    static Payload.PayloadBuilder builder()  
    protected boolean canEqual​(java.lang.Object other)  
    boolean equals​(java.lang.Object o)  
    java.util.List<Attachment> getAttachments()
    An array of legacy secondary attachments.
    java.util.List<LayoutBlock> getBlocks()
    An array of layout blocks in the same format as described in the layout block guide.
    java.lang.String getChannel()
    Deprecated.
    java.lang.String getIconEmoji()
    Deprecated.
    java.lang.String getIconUrl()
    Deprecated.
    java.lang.String getText()
    The first step is to prepare this message as a key/value pair in JSON.
    java.lang.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.
    java.lang.String getUsername()
    Deprecated.
    int hashCode()  
    void setAttachments​(java.util.List<Attachment> attachments)
    An array of legacy secondary attachments.
    void setBlocks​(java.util.List<LayoutBlock> blocks)
    An array of layout blocks in the same format as described in the layout block guide.
    void setChannel​(java.lang.String channel)
    Deprecated.
    void setIconEmoji​(java.lang.String iconEmoji)
    Deprecated.
    void setIconUrl​(java.lang.String iconUrl)
    Deprecated.
    void setText​(java.lang.String text)
    The first step is to prepare this message as a key/value pair in JSON.
    void setThreadTs​(java.lang.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 setUsername​(java.lang.String username)
    Deprecated.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • builder

      public static Payload.PayloadBuilder builder()
    • getThreadTs

      public java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.util.List<LayoutBlock> getBlocks()
      An array of layout blocks in the same format as described in the layout block guide.
    • getAttachments

      public java.util.List<Attachment> getAttachments()
      An array of legacy secondary attachments. We recommend you use blocks instead.
    • setThreadTs

      public void setThreadTs​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.util.List<LayoutBlock> blocks)
      An array of layout blocks in the same format as described in the layout block guide.
    • setAttachments

      public void setAttachments​(java.util.List<Attachment> attachments)
      An array of legacy secondary attachments. We recommend you use blocks instead.
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • canEqual

      protected boolean canEqual​(java.lang.Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object