Package com.whatsapp.api.impl
Class WhatsappBusinessManagementApi
java.lang.Object
com.whatsapp.api.impl.WhatsappBusinessManagementApi
The type Whatsapp business management api.
-
Constructor Summary
ConstructorDescriptionInstantiates a new Whatsapp business management api.WhatsappBusinessManagementApi
(String token, ApiVersion apiVersion) Instantiates a new Whatsapp business management api, specifying api version -
Method Summary
Modifier and TypeMethodDescriptioncreateMessageTemplate
(String whatsappBusinessAccountId, MessageTemplate messageTemplate) Use the WhatsApp Business Management API to create new message templates, media message templates, or interactive message templates.deleteMessageTemplate
(String whatsappBusinessAccountId, String name) Delete message template message template success response.getWhatsappCommerceSettings
(String phoneNumberId, String... fields) Get a business phone number's WhatsApp Commerce Settings.requestCode
(String phoneNumberId, RequestCode requestCode) You need to verify the phone number you want to use to send messages to your customers.retrievePhoneNumber
(String phoneNumberId) Retrieve a phone number by IDretrievePhoneNumber
(String phoneNumberId, String... fields) Retrieve phone number.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.retrieveTemplates
(String whatsappBusinessAccountId) When a message template is returned, the response will include all its translations (if any).retrieveTemplates
(String whatsappBusinessAccountId, int limit) Retrieve templates message templates.retrieveTemplates
(String whatsappBusinessAccountId, int limit, String after) Retrieve templates message templates.retrieveTemplates
(String whatsappBusinessAccountId, String templateName) Retrieve templates message templates.updateMessageTemplate
(String whatsappBusinessAccountId, String messageTemplateId, MessageTemplate messageTemplate) Update message template message template id response.updateWhatsappCommerceSettings
(String phoneNumberId, CommerceDataItem commerceDataItem) Update a business WhatsApp Commerce Settings.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.
-
Constructor Details
-
WhatsappBusinessManagementApi
Instantiates a new Whatsapp business management api.- Parameters:
token
- the token
-
WhatsappBusinessManagementApi
Instantiates a new Whatsapp business management api, specifying api version- Parameters:
token
- the tokenapiVersion
- 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 idmessageTemplateId
- the message template idmessageTemplate
- the message template- Returns:
- the message template id response
-
deleteMessageTemplate
Delete message template message template success response.- Parameters:
whatsappBusinessAccountId
- the whatsapp business account idname
- the name- Returns:
- the message template success response
-
retrieveTemplates
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
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
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 objectsafter
- next- Returns:
- message templates
-
retrievePhoneNumber
Retrieve a phone number by ID- Parameters:
phoneNumberId
- the phone number id- Returns:
- the phone number
- See Also:
-
retrievePhoneNumber
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 idfields
- the fields. Available options:- verified_name
- code_verification_status
- display_phone_number
- quality_rating
- name_status
- Returns:
- the phone number
- See Also:
-
retrievePhoneNumbers
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
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 idrequestCode
- the request code- Returns:
- the response
-
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 idverifyCode
- the verify code- Returns:
- the response
-
getWhatsappCommerceSettings
Get a business phone number's WhatsApp Commerce Settings. Returns empty if commerce settings have not been set.- Parameters:
phoneNumberId
- the phone number idfields
- 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 idcommerceDataItem
- the commerce configuration fields- Returns:
- the response
- See Also:
-