whatsapp.business
Module whatsapp.business
API
Definitions
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_whatsapp.business_1.4.0.png)
ballerinax/whatsapp.business Ballerina library
Overview
This is a generated connector for WhatsApp Business v2.21.4 OpenAPI Specification.
WhatsApp Business API provides the capability to communicate with customers all over the world, so you can connect with them on WhatsApp in a simple, secure, and reliable way.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create WhatsApp Business account
- Install WhatsApp Business API client - Follow this guide
Clients![](/images/permalink.svg)
whatsapp.business: Client![](/images/permalink.svg)
This is a generated connector for WhatsApp Business v2.21.4 OpenAPI Specification. WhatsApp Business connector supports to communicate with customers all over the world via WhatsApp.
Constructor![](/images/permalink.svg)
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create WhatsApp Business account and install client by following this guide.
init (ConnectionConfig config, string serviceUrl)
- config ConnectionConfig - The configurations to be used when initializing the
connector
- serviceUrl string - URL of the target service
requestCode![](/images/permalink.svg)
function requestCode(RequestCodeRequestBody payload) returns RequestCodeResponse|error?
Request-Code
Parameters
- payload RequestCodeRequestBody - Required parameters
Return Type
- RequestCodeResponse|error? - Created: the account already exists. You are already registered, so you do not need to do anything else
setShards![](/images/permalink.svg)
function setShards(SetShardsRequestBody payload) returns Response|error
Set-Shards
Parameters
- payload SetShardsRequestBody - Required parameters
registerAccount![](/images/permalink.svg)
function registerAccount(RegisterAccountRequestBody payload) returns Response|error
Register-Account
Parameters
- payload RegisterAccountRequestBody - Required parameters
uploadCertificate![](/images/permalink.svg)
Upload-Certificate
Parameters
- payload byte[] - Certificate
downloadCaCertificate![](/images/permalink.svg)
Download-CA-Certificate
downloadWebhookCaCertificate![](/images/permalink.svg)
Download Webhook CA Certificate
uploadWebhookCaCertificate![](/images/permalink.svg)
Upload Webhook CA Certificate
Parameters
- payload byte[] - Certificate
checkContact![](/images/permalink.svg)
function checkContact(CheckContactRequestBody payload) returns CheckContactResponse|error
Check-Contact
Parameters
- payload CheckContactRequestBody - Required parameters
Return Type
- CheckContactResponse|error - Response or an error
getAllGroups![](/images/permalink.svg)
function getAllGroups() returns GroupsResponse|error
Get-All-Groups
Return Type
- GroupsResponse|error - Response or an error
createGroup![](/images/permalink.svg)
function createGroup(CreateGroupRequestBody payload) returns GroupsResponse|error
Create-Group
Parameters
- payload CreateGroupRequestBody - Required parameters
Return Type
- GroupsResponse|error - Response or an error
getGroupInfo![](/images/permalink.svg)
function getGroupInfo(string groupId) returns GroupResponse|error
Get-Group-Info
Parameters
- groupId string - Group ID
Return Type
- GroupResponse|error - Response or an error
updateGroupInfo![](/images/permalink.svg)
function updateGroupInfo(string groupId, UpdateGroupInfoRequestBody payload) returns Response|error
Update-Group-Info
demoteGroupAdmin![](/images/permalink.svg)
Demote-Group-Admin
Parameters
- groupId string - Group ID
promoteToGroupAdmin![](/images/permalink.svg)
function promoteToGroupAdmin(string groupId, GroupAdminRequestBody payload) returns Response|error
Promote-To-Group-Admin
getGroupIconBinary![](/images/permalink.svg)
Get-Group-Icon-Binary
Parameters
- groupId string - Group ID
getGroupInvite![](/images/permalink.svg)
function getGroupInvite(string groupId) returns GroupInviteResponse|error
Get-Group-Invite
Parameters
- groupId string - Group ID
Return Type
- GroupInviteResponse|error - Response or an error
removeGroupParticipant![](/images/permalink.svg)
Remove-Group-Participant
Parameters
- groupId string - Group ID
checkHealth![](/images/permalink.svg)
Check-Health
downloadMedia![](/images/permalink.svg)
Download-Media
Parameters
- mediaId string - Media ID
Return Type
- json|error - JSON or else an error
sendMessage![](/images/permalink.svg)
function sendMessage(SendMessageRequestBody payload) returns MessageResponse|error
Send-Message
Parameters
- payload SendMessageRequestBody - Required parameters
Return Type
- MessageResponse|error -
Message-Response
or else an error
markMessageAsRead![](/images/permalink.svg)
function markMessageAsRead(string messageID, MarkMessageAsReadRequestBody payload) returns Response|error
Mark-Message-As-Read
Parameters
- messageID string - Message ID from Webhook
- payload MarkMessageAsReadRequestBody - Required parameters
getMetrics![](/images/permalink.svg)
Get-Metrics (since v2.21.3)
Parameters
- format string? (default ()) - Required format
Return Type
- json|error - JSON response or an error
enableTwoStep![](/images/permalink.svg)
function enableTwoStep(EnableTwoStepRequestBody payload) returns Response|error
Enable-Two-Step
Parameters
- payload EnableTwoStepRequestBody - Required parameters
getApplicationSettings![](/images/permalink.svg)
function getApplicationSettings() returns ApplicationSettings|error
Get-Application-Settings
Return Type
- ApplicationSettings|error -
Application-Settings
or else an error
updateApplicationSettings![](/images/permalink.svg)
function updateApplicationSettings(ApplicationSettings payload) returns Response|error
Update-Application-Settings
Parameters
- payload ApplicationSettings -
Application-Settings
or else an error
backupSettings![](/images/permalink.svg)
function backupSettings(BackupSettingsRequestBody payload) returns BackupSettingsResponse|error
Backup-Settings
Parameters
- payload BackupSettingsRequestBody - Required parameters
Return Type
- BackupSettingsResponse|error -
Backup-Settings-Response
or else an error
getBusinessProfile![](/images/permalink.svg)
function getBusinessProfile() returns GetBusinessProfileResponse|error
Get-Business-Profile
Return Type
- GetBusinessProfileResponse|error -
Get-Business-Profile-Response
or else an error
updateBusinessProfile![](/images/permalink.svg)
function updateBusinessProfile(BusinessProfile payload) returns Response|error
Update-Business-Profile
Parameters
- payload BusinessProfile -
Business-Profile
or else an error
getProfileAbout![](/images/permalink.svg)
function getProfileAbout() returns GetProfileAboutResponse|error
Get-Profile-About
Return Type
- GetProfileAboutResponse|error -
Get-Profile-About-Response
or else an error
updateProfileAbout![](/images/permalink.svg)
function updateProfileAbout(ProfileAbout payload) returns Response|error
Update-Profile-About
Parameters
- payload ProfileAbout - Required parameters
getProfilePhoto![](/images/permalink.svg)
function getProfilePhoto(string? format) returns GetProfilePhotoResponse|error
Get-Profile-Photo
Parameters
- format string? (default ()) - Required format
Return Type
- GetProfilePhotoResponse|error -
Get-Profile-Photo-Response
or an error
restoreSettings![](/images/permalink.svg)
function restoreSettings(RestoreSettingsRequestBody payload) returns Response|error
Restore-Settings
Parameters
- payload RestoreSettingsRequestBody - Required parameters
getAppStats![](/images/permalink.svg)
Get-App-Stats
Parameters
- format string? (default ()) - Required format
Return Type
- json|error - JSON response or an error
getDbStats![](/images/permalink.svg)
Get-DB-Stats
Parameters
- format string? (default ()) - Required format
Return Type
- json|error - JSON response or an error
getSupportInfo![](/images/permalink.svg)
function getSupportInfo() returns json|error
Get-Support-Info
Return Type
- json|error - JSON response or an error
createUser![](/images/permalink.svg)
function createUser(CreateUserRequestBody payload) returns UserResponse|error
Create-User
Parameters
- payload CreateUserRequestBody - Required parameters
Return Type
- UserResponse|error -
User-Response
or an error
loginUser![](/images/permalink.svg)
function loginUser(LoginAdminRequestBody payload) returns UserLoginResponse|error
Login-User
Parameters
- payload LoginAdminRequestBody - Required parameters
Return Type
- UserLoginResponse|error -
User-Login-Response
or an error
getUser![](/images/permalink.svg)
function getUser(string userUsername) returns DetailedUserResponse|error
Get-User
Parameters
- userUsername string - User's username
Return Type
- DetailedUserResponse|error -
Detailed-User-Response
or an error
updateUser![](/images/permalink.svg)
function updateUser(string userUsername, UpdateUserRequestBody payload) returns UserResponse|error
Update-User
Return Type
- UserResponse|error -
User-Response
or an error
Records![](/images/permalink.svg)
whatsapp.business: Address![](/images/permalink.svg)
Represents address
Fields
- city string - City name
- country string - Full country name
- country_code string - Two-letter country abbreviation
- state string - State abbreviation
- street string - Street number and name
- 'type string - Standard Values: HOME, WORK
- zip string - ZIP code
whatsapp.business: ApplicationSettings![](/images/permalink.svg)
Represents application settings.
Fields
- callback_backoff_delay_ms string? - Backoff delay for a failed callback in milliseconds This setting is used to configure the amount of time the backoff delays before retrying a failed callback. The backoff delay increases linearly by this value each time a callback fails to get a HTTPS 200 OK response. The backoff delay is capped by the max_callback_backoff_delay_ms setting.
- callback_persist boolean? - Stores callbacks on disk until they are successfully acknowledged by the Webhook or not. Restart required.
- heartbeat_interval int? - Multiconnect: Interval of the Master node monitoring of Coreapp nodes in seconds
- max_callback_backoff_delay_ms string? - Maximum delay for a failed callback in milliseconds
- media Media? - Represents media.
- on_call_pager string? - Set to valid WhatsApp Group with users who wish to see alerts for critical errors and messages.
- pass_through boolean? - When true, removes messages from the local database after they are delivered to or read by the recipient. When false, saves all messages on local storage until they are explicitly deleted. When messages are sent, they are stored in a local database. This database is used as the application's history. Since the business keeps its own history, you can specify whether you want message pass_through or not. Restart required.
- sent_status boolean? - Receive a notification that a message is sent to server. When true, you will receive a message indicating that a message has been sent. If false (default), you will not receive notification.
- unhealthy_interval int? - Multiconnect: Maximum amount of seconds a Master node waits for a Coreapp node to respond to a heartbeat before considering it unhealthy and starting the failover process.
- webhooks Webhooks? - Webhooks
whatsapp.business: AudioById![](/images/permalink.svg)
Audio by ID
Fields
- id string - Audio ID
whatsapp.business: AudioByProvider![](/images/permalink.svg)
Audio by ID.
Fields
- link string - Video link
- provider Provider - Represents provider.
whatsapp.business: BackupSettings![](/images/permalink.svg)
Represents backup settings
Fields
- data string? - The data that has been backed up, encrypted for security.
whatsapp.business: BackupSettingsRequestBody![](/images/permalink.svg)
Represents backup setting body
Fields
- password string - Used to encrypt backup data for security
whatsapp.business: BackupSettingsResponse![](/images/permalink.svg)
Save the data value as that will be used along with your password to restore the information.
Fields
- settings BackupSettings? - Represents backup settings
whatsapp.business: BusinessProfile![](/images/permalink.svg)
Represents business profile
Fields
- address string - Address of the business Maximum of 256 characters
- description string - Description of the business Maximum of 256 characters
- email string - Email address to contact the business Maximum of 128 characters
- vertical string - Industry of the business Maximum of 128 characters
- websites string[] - URLs associated with business (e.g., website, Facebook page, Instagram) Maximum of 2 websites with a maximum of 256 characters each
whatsapp.business: BusinessSettings![](/images/permalink.svg)
Represents business settings
Fields
- business BusinessSettingsBusiness? - Represents business settings
whatsapp.business: BusinessSettingsBusiness![](/images/permalink.svg)
Represents business settings
Fields
- profile BusinessProfile? - Represents business profile
whatsapp.business: CheckContact![](/images/permalink.svg)
Check contact
Fields
- input string? - The value you sent in the contacts field of the JSON request.
- status string? - Status of the user.
- wa_id string? - WhatsApp user identifier that can be used in other API calls. Only returned if the status is valid.
whatsapp.business: CheckContactRequestBody![](/images/permalink.svg)
Parameters required to check contact.
Fields
- blocking string(default "no_wait") - Blocking determines whether the request should wait for the processing to complete (synchronous) or not (asynchronous).
- contacts string[] - Array of contact phone numbers. The numbers can be in any standard telephone number format.
whatsapp.business: CheckContactResponse![](/images/permalink.svg)
Check contact response
Fields
- Fields Included from *Response
- contacts CheckContact[]? - Contact list
whatsapp.business: ClientHttp1Settings![](/images/permalink.svg)
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy ProxyConfig? - Proxy server related options
whatsapp.business: ConnectionConfig![](/images/permalink.svg)
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth BearerTokenConfig|CredentialsConfig - Configurations related to client authentication
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings? - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings? - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- poolConfig PoolConfiguration? - Configurations associated with request pooling
- cache CacheConfig? - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig? - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig? - Configurations associated with retrying
- responseLimits ResponseLimitConfigs? - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket? - SSL/TLS-related options
- proxy ProxyConfig? - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
whatsapp.business: Contact![](/images/permalink.svg)
Contact
Fields
- addresses Address[]? - Full contact address(es)
- birthday string? - YYYY-MM-DD formatted string
- emails Email[]? - Contact email address(es)
- name Name? - Full contact name
- org Org? - Contact organization information
- phones Phone[]? - Contact phone number(s)
- urls Url[]? - Contact URL(s)
whatsapp.business: CreateGroupRequestBody![](/images/permalink.svg)
Create group request body.
Fields
- subject string - Subject
whatsapp.business: CreateUserRequestBody![](/images/permalink.svg)
Create user request body.
Fields
- password string - username
- username string - password
whatsapp.business: Currency![](/images/permalink.svg)
Represents currency.
Fields
- amount_1000 int - Amount
- currency_code string - Currency code
whatsapp.business: DateTimeComponent![](/images/permalink.svg)
Date/time by component.
Fields
- day_of_month int? - The day of month
- day_of_week int? - Both strings and numbers are accepted. If different from the value derived from the date (if specified), use the derived value.
- hour int? - The hour
- minute int? - The minute
- month int? - The month
- year int? - The year
whatsapp.business: DateTimeObject![](/images/permalink.svg)
The Whatsapp Business API Client will attempt to format the date/time based on a specified localization.
Fields
- component DateTimeComponent? - Date/time by component.
- unix_epoch DateTimeUnixEpoch? - Date/time by Unix epoch.
whatsapp.business: DateTimeUnixEpoch![](/images/permalink.svg)
Date/time by Unix epoch.
Fields
- timestamp int? - Epoch timestamp in seconds
whatsapp.business: DetailedUserResponse![](/images/permalink.svg)
Represents detailed user response.
Fields
- Fields Included from *Response
- users DetailedUserResponseItem[]? - Detailed user response item list
whatsapp.business: DetailedUserResponseItem![](/images/permalink.svg)
Represents detailed user response item
Fields
- ROLES UserRole? - Represents user role
- username string? - Username
whatsapp.business: DocumentById![](/images/permalink.svg)
Document by ID.
Fields
- caption string - Caption
- filename string - File name
- id string - ID
whatsapp.business: DocumentByProvider![](/images/permalink.svg)
Document by provider.
Fields
- caption string - Caption
- filename string - File name
- link string - Link
- provider Provider - Represents provider.
whatsapp.business: Email![](/images/permalink.svg)
Represents email.
Fields
- email string - Email
- 'type string - Type
whatsapp.business: EnableTwoStepRequestBody![](/images/permalink.svg)
Enable two step request body
Fields
- pin string - Pin
whatsapp.business: Error![](/images/permalink.svg)
Represents error.
Fields
- code int? - See the https://developers.facebook.com/docs/whatsapp/api/errors for more information.
- details string? - error detail
- href string? - location for error detail
- title string? - error title
whatsapp.business: GetBusinessProfileResponse![](/images/permalink.svg)
Represents get business profile response
Fields
- Fields Included from *Response
- settings BusinessSettings? - Represents business settings
whatsapp.business: GetProfileAboutResponse![](/images/permalink.svg)
Represents get about profile response.
Fields
- settings ProfileAboutSettings? - Represents profile about settings
whatsapp.business: GetProfilePhotoResponse![](/images/permalink.svg)
Represents get profile photo response
Fields
- settings ProfilePhotoSettings? - Represents profile photo settings
whatsapp.business: Group![](/images/permalink.svg)
Represents group
Fields
- creation_time int? - timestamp
- id string? - Group ID
whatsapp.business: GroupAdminRequestBody![](/images/permalink.svg)
Group admin request body.
Fields
- wa_ids string[] - The WhatsApp IDs of the people to be added or removed as group admins
whatsapp.business: GroupInfo![](/images/permalink.svg)
Represents group information.
Fields
- admins string[]? - Group administrators Lists IDs of the creator of the group and any administrators added
- creation_time int? - Group creation time
- creator string? - ID of the creator of this group
- participants string[]? - Participants of the group This is an array of all the IDs of the participants in the group. Initially, this will be the creator of the group.
- subject string? - Subject of the group
whatsapp.business: GroupInvite![](/images/permalink.svg)
Represents group invite.
Fields
- link string? - Group invite link
whatsapp.business: GroupInviteResponse![](/images/permalink.svg)
Represents group invite response
Fields
- Fields Included from *Response
- groups GroupInvite[]? - Group invite list
whatsapp.business: GroupResponse![](/images/permalink.svg)
Represents group response
Fields
- Fields Included from *Response
- groups GroupInfo[]? - Group information list
whatsapp.business: GroupsResponse![](/images/permalink.svg)
Represents groups response
Fields
- Fields Included from *Response
- groups Group[]? - Group list
whatsapp.business: Hsm![](/images/permalink.svg)
The containing element for the message content — Indicates that the message is highly structured. Parameters contained within provide the structure.
Fields
- element_name string - The element name that indicates which template to use within the namespace
- language Language - Language
- localizable_params LocalizableParam[] - This field is an array of values to apply to variables in the template
- namespace string - The namespace that will be used
whatsapp.business: ImageById![](/images/permalink.svg)
Image by ID
Fields
- caption string - Caption
- id string - ID
whatsapp.business: ImageByProvider![](/images/permalink.svg)
Image by provider
Fields
- caption string - Caption
- link string - Link
- provider Provider - Represents provider.
whatsapp.business: Language![](/images/permalink.svg)
Language
Fields
- code string - The code of the language or locale to use — Accepts both language and language_locale formats (e.g., en and en_US).
- policy string - The language policy the message should follow
whatsapp.business: LocalizableParam![](/images/permalink.svg)
Localisable parameters.
Fields
- currency Currency? - Represents currency.
- date_time DateTimeObject? - The Whatsapp Business API Client will attempt to format the date/time based on a specified localization.
- default string - Default text if localization fails
whatsapp.business: Location![](/images/permalink.svg)
Represents location.
Fields
- address string - Address of the location. Only displayed if name is present.
- latitude string - Latitude of the location
- longitude string - Longitude of the location
- name string - Name of the location
whatsapp.business: LoginAdminRequestBody![](/images/permalink.svg)
Represents login admin request body.
Fields
- new_password string - New password
whatsapp.business: MarkMessageAsReadRequestBody![](/images/permalink.svg)
Represents mark message as read request body.
Fields
- status string - Status
whatsapp.business: Media![](/images/permalink.svg)
Represents media.
Fields
- auto_download string[] - An array specifying which types of media to automatically download.
whatsapp.business: Message![](/images/permalink.svg)
Represents message.
Fields
- id string? - Message ID
whatsapp.business: MessageContext![](/images/permalink.svg)
Represents message context.
Fields
- 'from string? - Sender Whatsapp id of context-message
- group_id string? - GroupId of context message
- id string? - message id
- mentions string[]? - Whats app ids
whatsapp.business: MessageResponse![](/images/permalink.svg)
Represents message response
Fields
- Fields Included from *Response
- messages Message[]? - Message list
whatsapp.business: Meta![](/images/permalink.svg)
Contains generic information such as WhatsApp Business API Client version.
Fields
- api_status string? - API status
- 'version string? - Version
whatsapp.business: Name![](/images/permalink.svg)
Full contact name
Fields
- first_name string? - First name
- formatted_name string - Full name as it normally appears
- last_name string? - Last name
- prefix string? - Name preffix
- suffix string? - Name suffix
whatsapp.business: Org![](/images/permalink.svg)
Contact organization information
Fields
- company string - Name of the contact's company
- department string? - Name of the contact's department
- title string? - Contact's business title
whatsapp.business: Phone![](/images/permalink.svg)
Phone
Fields
- phone string? - Phone number
- 'type string? - Standard Values: CELL, MAIN, IPHONE, HOME, WORK
- wa_id string? - WhatsApp ID
whatsapp.business: ProfileAbout![](/images/permalink.svg)
Profile about
Fields
- text string - Text to display in your profile's About section The max length for the string is 139 characters.
whatsapp.business: ProfileAboutSettings![](/images/permalink.svg)
Represents profile about settings
Fields
- profile ProfileAboutSettingsProfile? - Represents about in profile settings
whatsapp.business: ProfileAboutSettingsProfile![](/images/permalink.svg)
Represents about in profile settings
Fields
- about ProfileAbout? - Profile about
whatsapp.business: ProfilePhotoSettings![](/images/permalink.svg)
Represents profile photo settings
Fields
- profile ProfilephotosettingsProfile? - Represents profile
whatsapp.business: ProfilephotosettingsProfile![](/images/permalink.svg)
Represents profile
Fields
- photo ProfilephotosettingsProfilePhoto? - Represents photo
whatsapp.business: ProfilephotosettingsProfilePhoto![](/images/permalink.svg)
Represents photo
Fields
- link string? - Photo link
whatsapp.business: Provider![](/images/permalink.svg)
Represents provider.
Fields
- name string - Name
whatsapp.business: ProxyConfig![](/images/permalink.svg)
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
whatsapp.business: RegisterAccountRequestBody![](/images/permalink.svg)
Represents register account request body.
Fields
- code string - Code
whatsapp.business: RemoveGroupParticipantRequestBody![](/images/permalink.svg)
Fields
- wa_ids string[] - Represents remove group participant request body
whatsapp.business: RequestCodeAccount![](/images/permalink.svg)
Request code account
Fields
- vname string? - Decoded name from cert
whatsapp.business: RequestCodeRequestBody![](/images/permalink.svg)
Represents required parameters to request code
Fields
- cc string - Numerical country code for the phone number you are registering
- cert string - Base64-encoded Verified Name certificate
- method string - Method of receiving your registration code
- phone_number string - Phone number you are registering, without the country code or plus symbol (+)
- pin string? - Existing 6-digit PIN — This is only required when two-factor verification is enabled on this account.
whatsapp.business: RequestCodeResponse![](/images/permalink.svg)
Request code response
Fields
- account RequestCodeAccount[]? - RequestCodeAccount list
whatsapp.business: Response![](/images/permalink.svg)
Response
Fields
- errors Error[]? - Only returned with a failed request. Contains an array of error objects that are present when there is an error.
- meta Meta? - Contains generic information such as WhatsApp Business API Client version.
whatsapp.business: RestoreSettingsRequestBody![](/images/permalink.svg)
Restore settings request body
Fields
- data string - The data that was returned by the /v1/settings/backup API call
- password string - The password you used in the /v1/settings/backup API call to encrypt the backup data
whatsapp.business: SendMessageRequestBody![](/images/permalink.svg)
Send message request body
Fields
- audio Audio? - The media object containing audio
- contacts Contact[]? - Contacts list
- document Document? - The media object containing a document.
- hsm Hsm? - The containing element for the message content — Indicates that the message is highly structured. Parameters contained within provide the structure.
- image Image? - The media object containing an image.
- location Location? - Represents location.
- preview_url boolean? - Specifying preview_url in the request is optional when not including a URL in your message. To include a URL preview, set preview_url to true in the message body and make sure the URL begins with http:// or https://. For more information, see the Sending URLs in Text Messages section.
- recipient_type string(default "individual") - Determines whether the recipient is an individual or a group Specifying recipient_type in the request is optional when the value is individual. However, recipient_type is required when using group. If sending a text message to a group, see the Sending Group Messages documentation.
- text Text? - Text
- to string - When recipient_type is individual, this field is the WhatsApp ID (phone number) returned from contacts endpoint. When recipient_type is group, this field is the WhatsApp group ID.
- ttl record {}? - TTL
- 'type MessageType? - type of the message
- video Video? - The media object containing a video
whatsapp.business: SetShardsRequestBody![](/images/permalink.svg)
Set shards request body
Fields
- cc string - CC
- phone_number string - Phone number
- pin string - Pin
- shards int - Shards
whatsapp.business: Text![](/images/permalink.svg)
Text
Fields
- body string - Body
whatsapp.business: UpdateGroupInfoRequestBody![](/images/permalink.svg)
Represents update group info request body.
Fields
- subject string - Subject
whatsapp.business: UpdateUserRequestBody![](/images/permalink.svg)
Update user request body.
Fields
- password string - Password
whatsapp.business: UploadMedia![](/images/permalink.svg)
Represents upload media
Fields
- id string? - Media ID
whatsapp.business: Url![](/images/permalink.svg)
Standard Values: HOME, WORK
Fields
- 'type string? - Standard Values: HOME, WORK
- url string? - URL
whatsapp.business: UserLoginResponse![](/images/permalink.svg)
Represents user login response
Fields
- Fields Included from *Response
- users UserLoginResponseItem[]? - User login response item list
whatsapp.business: UserLoginResponseItem![](/images/permalink.svg)
Represents user login response item
Fields
- expires_after string? - Token expiration timestamp. By default, this is 7 days.
- token string? - Authentication token to be used for all other WhatsApp Business API calls. The token must be sent in the authorization header in the format: Authorization: Bearer <authentication-token>
whatsapp.business: UserResponse![](/images/permalink.svg)
Represents user response
Fields
- Fields Included from *Response
- users UserResponseItem[]? - User response item list
whatsapp.business: UserResponseItem![](/images/permalink.svg)
Represents user response item
Fields
- username string? - Username
whatsapp.business: VideoById![](/images/permalink.svg)
Video by ID
Fields
- caption string - Caption
- id string - Video ID
whatsapp.business: VideoByProvider![](/images/permalink.svg)
Video by provider
Fields
- caption string - Caption
- link string - Link
- provider Provider - Represents provider.
whatsapp.business: WebhookAudio![](/images/permalink.svg)
Webhook audio
Fields
- caption string? - Optional. Only present if specified.
- file string? - Absolute filename and location on media volume. This parameter is deprecated.
- filename string? - Filename on the sender's device. This will only be present in audio and document media messages.
- id string? - ID of the media. Can be used to delete the media if stored locally on the client.
- link string? - Media link
- mime_type string? - Mime type of media
- sha256 string? - Checksum
whatsapp.business: WebhookContact![](/images/permalink.svg)
Webhook contact
Fields
- profile WebhookContactProfile? - Webhook contact profile
- wa_id string? - The WhatsApp ID of the contact
whatsapp.business: WebhookContactProfile![](/images/permalink.svg)
Webhook contact profile
Fields
- name string? - Optional. As of v2.21.4, contains the sender's profile name.
whatsapp.business: WebhookDocument![](/images/permalink.svg)
Webhook document
Fields
- caption string? - Optional. Only present if specified.
- file string? - Absolute filename and location on media volume. This parameter is deprecated.
- filename string? - Filename on the sender's device. This will only be present in audio and document media messages.
- id string? - ID of the media. Can be used to delete the media if stored locally on the client.
- link string? - Link of the media.
- mime_type string? - Mime type of media
- sha256 string? - Checksum
whatsapp.business: WebhookEvent![](/images/permalink.svg)
Webhook event
Fields
- contacts WebhookContact[]? - Webhook contact
- errors Error[]? - Error list
- messages WebhookMessage[]? - Webhook message list
- statuses WebhookStatus[]? - Webhook status list
whatsapp.business: WebhookImage![](/images/permalink.svg)
Webhook image
Fields
- caption string? - Optional. Only present if specified.
- file string? - Absolute filename and location on media volume. This parameter is deprecated.
- id string? - ID of the media. Can be used to delete the media if stored locally on the client.
- link string? - Media link
- mime_type string? - Mime type of media
- sha256 string? - Checksum
whatsapp.business: WebhookLocation![](/images/permalink.svg)
Webhook location
Fields
- address string? - Address of the location
- latitude decimal? - Latitude of location being sent
- longitude decimal? - Longitude of location being sent
- name string? - Name of the location
- url string? - URL for the website where the user downloaded the location information
whatsapp.business: WebhookMessage![](/images/permalink.svg)
Webhook message
Fields
- audio WebhookAudio? - Webhook audio
- contacts Contact[]? - Contact list
- context MessageContext? - Represents message context.
- document WebhookDocument? - Webhook document
- errors Error[]? - Error list
- 'from string? - WhatsApp ID of the sender
- group_id string? - Optional. WhatsApp group ID
- id string? - Message ID
- image WebhookImage? - Webhook image
- location WebhookLocation? - Webhook location
- system WebhookSystem? - Webhook system
- text WebhookText? - Webhook text
- timestamp string? - Message received timestamp
- 'type MessageType? - type of the message
- video WebhookVideo? - Webhook video
- voice WebhookVoice? - Webhook voice
whatsapp.business: Webhooks![](/images/permalink.svg)
Webhooks
Fields
- max_concurrent_requests int? - Configures the maximum number of inflight callback requests that are sent out. Can be set to 6 (default), 12, 18, or 24.
- url string? - Inbound and outbound notifications are routed to this URL. A HTTPS-based endpoint is required; HTTP will not work.
whatsapp.business: WebhookStatus![](/images/permalink.svg)
Webhook status
Fields
- errors Error[]? - Error list
- id string? - Message ID
- recipient_id string? - WhatsApp ID of recipient
- status string? - Status of message
- timestamp string? - Timestamp of the status message
whatsapp.business: WebhookSystem![](/images/permalink.svg)
Webhook system
Fields
- body string? - Body
- 'type string? - Status
whatsapp.business: WebhookText![](/images/permalink.svg)
Webhook text
Fields
- body string? - Message text
whatsapp.business: WebhookVideo![](/images/permalink.svg)
Webhook video
Fields
- caption string? - Optional. Only present if specified
- file string? - Absolute filename and location on media volume. This parameter is deprecated
- id string? - ID of the media. Can be used to delete the media if stored locally on the client
- link string? - Link of the media
- mime_type string? - Mime type of media
- sha256 string? - Checksum
whatsapp.business: WebhookVoice![](/images/permalink.svg)
Webhook voice
Fields
- caption string? - Optional. Only present if specified.
- file string? - Absolute filename and location on media volume. This parameter is deprecated.
- id string? - ID of the media. Can be used to delete the media if stored locally on the client.
- link string? - Media link
- mime_type string? - Mime type of media
- sha256 string? - Checksum
Union types![](/images/permalink.svg)
whatsapp.business: Audio![](/images/permalink.svg)
Audio
The media object containing audio
whatsapp.business: Document![](/images/permalink.svg)
Document
The media object containing a document.
whatsapp.business: Image![](/images/permalink.svg)
Image
The media object containing an image.
whatsapp.business: Video![](/images/permalink.svg)
Video
The media object containing a video
String types![](/images/permalink.svg)
Import
import ballerinax/whatsapp.business;
Metadata
Released date: almost 2 years ago
Version: 1.4.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.2.1
GraalVM compatible: Yes
Pull count
Total: 11
Current verison: 7
Weekly downloads
Keywords
Communication/Call & SMS
Cost/Freemium
Contributors
Dependencies