Class WhatsappBusinessManagementApi

java.lang.Object
com.whatsapp.api.impl.WhatsappBusinessManagementApi

public class WhatsappBusinessManagementApi extends Object
The type Whatsapp business management api.
  • Constructor Details

    • WhatsappBusinessManagementApi

      public WhatsappBusinessManagementApi(String token)
      Instantiates a new Whatsapp business management api.
      Parameters:
      token - the token
    • WhatsappBusinessManagementApi

      public WhatsappBusinessManagementApi(String token, ApiVersion apiVersion)
      Instantiates a new Whatsapp business management api, specifying api version
      Parameters:
      token - the token
      apiVersion - api version
  • Method Details

    • createMessageTemplate

      public Template createMessageTemplate(String whatsappBusinessAccountId, MessageTemplate messageTemplate)
      Use the WhatsApp Business Management API to create new message templates, media message templates, or interactive message templates.
      Parameters:
      whatsappBusinessAccountId - Represents a specific WhatsApp Business Account (WABA). Make the API call to the WABA ID.
      messageTemplate - MessageTemplate object
      Returns:
      Template template
    • updateMessageTemplate

      public Template updateMessageTemplate(String whatsappBusinessAccountId, String messageTemplateId, MessageTemplate messageTemplate)
      Update message template message template id response.
      Parameters:
      whatsappBusinessAccountId - the whatsapp business account id
      messageTemplateId - the message template id
      messageTemplate - the message template
      Returns:
      the message template id response
    • deleteMessageTemplate

      public Response deleteMessageTemplate(String whatsappBusinessAccountId, String name)
      Delete message template message template success response.
      Parameters:
      whatsappBusinessAccountId - the whatsapp business account id
      name - the name
      Returns:
      the message template success response
    • retrieveTemplates

      public MessageTemplates retrieveTemplates(String whatsappBusinessAccountId)
      When a message template is returned, the response will include all its translations (if any). Message templates are grouped by the name field. You can use the limit parameter to define the number of items returned. This limit applies to the maximum number of message template names that may be returned, not the maximum number of objects.
      Parameters:
      whatsappBusinessAccountId - Represents a specific WhatsApp Business Account (WABA). Make the API call to the WABA ID.
      Returns:
      MessageTemplates List of templates
      See Also:
    • retrieveTemplates

      public MessageTemplates retrieveTemplates(String whatsappBusinessAccountId, int limit)
      Retrieve templates message templates.
      Parameters:
      whatsappBusinessAccountId - Represents a specific WhatsApp Business Account (WABA). Make the API call to the WABA ID.
      limit - You can use the limit parameter to define the number of items returned. This limit applies to the maximum number of message template names that may be returned, not the maximum number of objects
      Returns:
      MessageTemplates List of templates
      See Also:
    • retrieveTemplates

      public MessageTemplates retrieveTemplates(String whatsappBusinessAccountId, String templateName)
      Retrieve templates message templates.
      Parameters:
      whatsappBusinessAccountId - Represents a specific WhatsApp Business Account (WABA). Make the API call to the WABA ID.
      templateName - template name.
      Returns:
      MessageTemplates List of templates
      See Also:
    • retrieveTemplates

      public MessageTemplates retrieveTemplates(String whatsappBusinessAccountId, int limit, String after)
      Retrieve templates message templates.
      Parameters:
      whatsappBusinessAccountId - Represents a specific WhatsApp Business Account (WABA). Make the API call to the WABA ID.
      limit - You can use the limit parameter to define the number of items returned. This limit applies to the maximum number of message template names that may be returned, not the maximum number of objects
      after - next
      Returns:
      message templates
    • retrievePhoneNumber

      public PhoneNumber retrievePhoneNumber(String phoneNumberId)
      Retrieve a phone number by ID
      Parameters:
      phoneNumberId - the phone number id
      Returns:
      the phone number
      See Also:
    • retrievePhoneNumber

      public PhoneNumber retrievePhoneNumber(String phoneNumberId, String... fields)
      Retrieve phone number.

      Include fields=name_status as a query string parameter to get the status of a display name associated with a specific phone number. This field is currently in beta and not available to all developers.

      Parameters:
      phoneNumberId - the phone number id
      fields - the fields. Available options:
      • verified_name
      • code_verification_status
      • display_phone_number
      • quality_rating
      • name_status
      Returns:
      the phone number
      See Also:
    • retrievePhoneNumbers

      public PhoneNumbers retrievePhoneNumbers(String whatsappBusinessAccountId)
      Retrieve phone numbers from a Whatsapp Business Account When you query all the phone numbers for a WhatsApp Business Account, each phone number has an id. You can directly query for a phone number using this id.
      Parameters:
      whatsappBusinessAccountId - the whatsapp business account id
      Returns:
      the phone numbers
      See Also:
    • requestCode

      public Response requestCode(String phoneNumberId, RequestCode requestCode)
      You need to verify the phone number you want to use to send messages to your customers. Phone numbers must be verified through SMS/voice call. The verification process can be done through this method.
      Parameters:
      phoneNumberId - the phone number id
      requestCode - the request code
      Returns:
      the response
    • verifyCode

      public Response verifyCode(String phoneNumberId, VerifyCode verifyCode)
      After you received a SMS or Voice request code from Request Verification Code, you need to verify the code that was sent to you. To verify this code, use this method
      Parameters:
      phoneNumberId - the phone number id
      verifyCode - the verify code
      Returns:
      the response
    • getWhatsappCommerceSettings

      public GraphCommerceSettings getWhatsappCommerceSettings(String phoneNumberId, String... fields)
      Get a business phone number's WhatsApp Commerce Settings. Returns empty if commerce settings have not been set.
      Parameters:
      phoneNumberId - the phone number id
      fields - the fields. Available options:
      • id
      • is_cart_enabled
      • is_catalog_visible
      Returns:
      the response
      See Also:
    • updateWhatsappCommerceSettings

      public Response updateWhatsappCommerceSettings(String phoneNumberId, CommerceDataItem commerceDataItem)
      Update a business WhatsApp Commerce Settings.
      Parameters:
      phoneNumberId - the phone number id
      commerceDataItem - the commerce configuration fields
      Returns:
      the response
      See Also: