Class PostbackAction

  • All Implemented Interfaces:
    Action

    public final class PostbackAction
    extends java.lang.Object
    implements Action
    Postback's Action.

    When this action is tapped, a postback event is returned via webhook with the specified string in the data field.

    If you have included the text field, the string in the text field is sent as a message from the user.

    • Constructor Detail

      • PostbackAction

        public PostbackAction​(java.lang.String label,
                              java.lang.String data,
                              java.lang.String displayText,
                              java.lang.String text)
        Create new instance.
        Parameters:
        label - Label for the action. Max: 20 characters.
        data - String returned via webhook in the postback.data property of the postback event. Max: 300 characters.
        displayText - text message (optional) Can not be used at the same time with text.
        text - text message (optional) Can not be used at the same time with displayText.
      • PostbackAction

        public PostbackAction​(java.lang.String label,
                              java.lang.String data,
                              java.lang.String text)
      • PostbackAction

        public PostbackAction​(java.lang.String label,
                              java.lang.String data)
    • Method Detail

      • getLabel

        public java.lang.String getLabel()
        Label for the action.

        Max: 20 characters

        Specified by:
        getLabel in interface Action
      • getData

        public java.lang.String getData()
        String returned via webhook in the postback.data property of the postback event.

        Max: 300 characters

      • getDisplayText

        public java.lang.String getDisplayText()
        Text sent when the action is performed.

        Max: 300 characters

      • getText

        public java.lang.String getText()
        Deprecated. Text sent when the action is performed.

        Max: 300 characters

      • equals

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

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

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