Class Action

java.lang.Object
com.whatsapp.api.domain.messages.Action

public class Action extends Object
  • button - Required for List Messages - It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters

  • buttons - Required for Reply Buttons - A button object can contain the following parameters:

    • type: only supported type is reply (for Reply Button)

    • title: Button title. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters.

    • id: Unique identifier for your button. This ID is returned in the webhook when the button is clicked by the user. Maximum length: 256 characters.

    You can have up to 3 buttons. You cannot have leading or trailing spaces when setting the ID.

  • catalog_id - Required for Single Product Messages and Multi-Product Messages - Unique identifier of the Facebook catalog linked to your WhatsApp Business Account. This ID can be retrieved via the Meta Commerce Manager.
  • product_retailer_id - Required for Single Product Messages and Multi-Product Messages - Unique identifier of the product in a catalog.

    To get this ID go to Meta Commerce Manager and select your Meta Business account. You will see a list of shops connected to your account. Click the shop you want to use. On the left-side panel, click Catalog > Items, and find the item you want to mention. The ID for that item is displayed under the item's name.

  • sections - Required for List Messages and Multi-Product Messages - Array of section objects. Minimum of 1, maximum of 10. See section object.
  • Constructor Details

    • Action

      public Action()
  • Method Details

    • getCatalogId

      public String getCatalogId()
      Gets catalog id.
      Returns:
      the catalog id
    • setCatalogId

      public Action setCatalogId(String catalogId)
      Sets catalog id.
      Parameters:
      catalogId - Required for Single Product Messages and Multi-Product Messages - Unique identifier of the Facebook catalog linked to your WhatsApp Business Account. This ID can be retrieved via the Meta Commerce Manager.
      Returns:
      the catalog id
    • getProductRetailerId

      public String getProductRetailerId()
      Gets product retailer id.
      Returns:
      the product retailer id
    • setProductRetailerId

      public Action setProductRetailerId(String productRetailerId)
      Sets product retailer id.
      Parameters:
      productRetailerId - the product retailer id
      Returns:
      the product retailer id
    • getButtonText

      public String getButtonText()
      Gets button text.
      Returns:
      the button text
    • setButtonText

      public Action setButtonText(String buttonText)
      Sets button text.
      Parameters:
      buttonText - the button text
      Returns:
      the button text
    • getButtons

      public List<Button> getButtons()
      Gets buttons.
      Returns:
      the buttons
    • setButtons

      public Action setButtons(List<Button> buttons)
      Sets buttons.
      Parameters:
      buttons - the buttons
      Returns:
      the buttons
    • addButton

      public Action addButton(Button button)
      Add button action.
      Parameters:
      button - the type Button
      Returns:
      the action
    • getSections

      public List<Section> getSections()
      Gets sections.
      Returns:
      the sections
    • setSections

      public Action setSections(List<Section> sections)
      Sets sections.
      Parameters:
      sections - List of @Section
      Returns:
      the sections
    • addSection

      public Action addSection(Section section)
      Add section action.
      Parameters:
      section - the section
      Returns:
      the action