The WhatsApp component is an application component that allows users to use WhatsApp Business Platform API to send template and messages.
It can carry out the following tasks:
The component definition and tasks are defined in the definition.yaml and tasks.yaml files respectively.
Setup
In order to communicate with WhatsApp, the following connection details need to be
provided. You may specify them directly in a pipeline recipe as key-value pairs
within the component's setup block, or you can create a Connection from
the Integration Settings
page and reference the whole setup as setup: ${connection.<my-connection-id>}.
Field
Field ID
Type
Note
Token (required)
token
string
Fill in your WhatsApp access token. Go here for more information.
Supported Tasks
Send Text Based Template Message
Send text-based template message. This task support header(text), body and button parameters.
Input
Field ID
Type
Description
Task ID (required)
task
string
TASK_SEND_TEXT_BASED_TEMPLATE_MESSAGE
Phone Number ID (required)
phone-number-id
string
Phone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)
to
string
The number of the recipient you are sending the message to.
Template Name (required)
name
string
Name of the template.
Language Code (required)
language-code
string
The code of the language in which the template is used. Supported languages.
Header Parameters
header-parameters
array[string]
Specify the parameters for the header section of the template. Leave this blank if there is no parameter.
Body Parameters
body-parameters
array[string]
Specify the parameters for the body section of the template. Leave this blank if there is no parameter.
Button Parameters
button-parameters
array[string]
Specify the parameters for button(s). Leave this blank if there is no parameter. Follow this format or it won't work: button_index;button_type;value_of_the_parameter. The seperator is a semicolon. button_index starts at 0. Example: 0;quick_reply;randomvalue. Note: This button parameter only support three types 'quick_reply', 'url' and 'copy_code'.
Output
Field ID
Type
Description
Recipient WhatsApp ID
recipient-wa-id
string
The WhatsApp ID of the recipient. Most likely the same with their phone number.
Message ID
message-id
string
The ID of the message.
Message Status
message-status
string
The status of the message.
Send Media Based Template Message
Send media-based template message. This task support header(image, document & video), body and button parameters.
Input
Field ID
Type
Description
Task ID (required)
task
string
TASK_SEND_MEDIA_BASED_TEMPLATE_MESSAGE
Phone Number ID (required)
phone-number-id
string
Phone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)
to
string
The number of the recipient you are sending the message to.
Template Name (required)
name
string
Name of the template.
Language Code (required)
language-code
string
The code of the language in which the template is used. Supported languages.
Header Type (required)
media-type
string
Specify the header(media) type for the header section of the template. Enum values
image
video
document
ID or Link (Header Parameter) (required)
id-or-link
string
Input either ID or link of the media. If the input has 'http', it will be considered as a link.
Filename (Header Parameter)
filename
string
The filename of the document. Only document can use this property. This property will specify what format the document is displayed as in WhatsApp. If other media type tried to use this property, it will be ignored.
Body Parameters
body-parameters
array[string]
Specify the parameters for the body section of the template. Leave this blank if there is no parameter.
Button Parameters
button-parameters
array[string]
Specify the parameters for button(s). Leave this blank if there is no parameter. Follow this format or it won't work: button_index;button_type;value_of_the_parameter. The seperator is a semicolon. button_index starts at 0. Example: 0;quick_reply;randomvalue. Note: This button parameter only support three types 'quick_reply', 'url' and 'copy_code'.
Output
Field ID
Type
Description
Recipient WhatsApp ID
recipient-wa-id
string
The WhatsApp ID of the recipient. Most likely the same with their phone number.
Message ID
message-id
string
The ID of the message.
Message Status
message-status
string
The status of the message.
Send Location Based Template Message
Send location-based template message. This task support header(location), body and button parameters.
Input
Field ID
Type
Description
Task ID (required)
task
string
TASK_SEND_LOCATION_BASED_TEMPLATE_MESSAGE
Phone Number ID (required)
phone-number-id
string
Phone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)
to
string
The number of the recipient you are sending the message to.
Template Name (required)
name
string
Name of the template.
Language Code (required)
language-code
string
The code of the language in which the template is used. Supported languages.
Latitude (Header Parameter) (required)
latitude
number
Location latitude.
Longitude (Header Parameter) (required)
longitude
number
Location longitude.
Location Name (Header Parameter) (required)
location-name
string
Name of the location.
Location Address (Header Parameter) (required)
address
string
Address of the location.
Body Parameters
body-parameters
array[string]
Specify the parameters for the body section of the template. Leave this blank if there is no parameter.
Button Parameters
button-parameters
array[string]
Specify the parameters for button(s). Leave this blank if there is no parameter. Follow this format or it won't work: button_index;button_type;value_of_the_parameter. The seperator is a semicolon. button_index starts at 0. Example: 0;quick_reply;randomvalue. Note: This button parameter only support three types 'quick_reply', 'url' and 'copy_code'.
Output
Field ID
Type
Description
Recipient WhatsApp ID
recipient-wa-id
string
The WhatsApp ID of the recipient. Most likely the same with their phone number.
Message ID
message-id
string
The ID of the message.
Message Status
message-status
string
The status of the message.
Send Authentication Template Message
Send authentication template message with one-time password button (The button is used to copy the password to clipboard). Authentication template has no header parameters.
Input
Field ID
Type
Description
Task ID (required)
task
string
TASK_SEND_AUTHENTICATION_TEMPLATE_MESSAGE
Phone Number ID (required)
phone-number-id
string
Phone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)
to
string
The number of the recipient you are sending the message to.
Template Name (required)
name
string
Name of the template.
Language Code (required)
language-code
string
The code of the language in which the template is used. Supported languages.
One-Time Password (required)
one-time-password
string
One-time password to be sent to the recipient. Maximum 15 characters.
Output
Field ID
Type
Description
Recipient WhatsApp ID
recipient-wa-id
string
The WhatsApp ID of the recipient. Most likely the same with their phone number.
Message ID
message-id
string
The ID of the message.
Message Status
message-status
string
The status of the message.
Send Text Message
Send text message. Note: Message can only be sent when the 24-hour customer service window is open. For more information, please visit here
Input
Field ID
Type
Description
Task ID (required)
task
string
TASK_SEND_TEXT_MESSAGE
Phone Number ID (required)
phone-number-id
string
Phone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)
to
string
The number of the recipient you are sending the message to.
Text (required)
body
string
Body of the message.
Preview URL (required)
preview-url
string
Specify whether URL should be previewed or not. This will have no affect if the message does not contain any URL. Enum values
false
true
Output
Field ID
Type
Description
Recipient WhatsApp ID
recipient-wa-id
string
The WhatsApp ID of the recipient. Most likely the same with their phone number.
Message ID
message-id
string
The ID of the message.
Send Media Message
Send media message. Media supported: video, audio, document, image. Note: Message can only be sent when the 24-hour customer service window is open. For more information, please visit here
Input
Field ID
Type
Description
Task ID (required)
task
string
TASK_SEND_MEDIA_MESSAGE
Phone Number ID (required)
phone-number-id
string
Phone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)
to
string
The number of the recipient you are sending the message to.
Media Type (required)
media-type
string
Specify what media to send. Enum values
image
audio
document
video
ID or Link (required)
id-or-link
string
Input either ID or link of the media. If the input has 'http', it will be considered as a link.
Caption
caption
string
Media asset caption. Description of the media. This property cannot be used when the media type is audio. If audio tried to use this property, it will be ignored.
Filename
filename
string
The filename of the document. Only document can use this property. This property will specify what format the document is displayed as in WhatsApp. If other media type tried to use this property, it will be ignored.
Output
Field ID
Type
Description
Recipient WhatsApp ID
recipient-wa-id
string
The WhatsApp ID of the recipient. Most likely the same with their phone number.
Message ID
message-id
string
The ID of the message.
Send Location Message
Send location message. Note: Message can only be sent when the 24-hour customer service window is open. For more information, please visit here
Input
Field ID
Type
Description
Task ID (required)
task
string
TASK_SEND_LOCATION_MESSAGE
Phone Number ID (required)
phone-number-id
string
Phone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)
to
string
The number of the recipient you are sending the message to.
Latitude (required)
latitude
number
Location latitude.
Longitude (required)
longitude
number
Location longitude.
Location Name (required)
location-name
string
Name of the location.
Location Address (required)
address
string
Address of the location.
Output
Field ID
Type
Description
Recipient WhatsApp ID
recipient-wa-id
string
The WhatsApp ID of the recipient. Most likely the same with their phone number.
Message ID
message-id
string
The ID of the message.
Send Contact Message
Send contact message. Note: Message can only be sent when the 24-hour customer service window is open. For more information, please visit here
Input
Field ID
Type
Description
Task ID (required)
task
string
TASK_SEND_CONTACT_MESSAGE
Phone Number ID (required)
phone-number-id
string
Phone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)
to
string
The number of the recipient you are sending the message to.
First Name (required)
first-name
string
First name of the contact.
Middle Name
middle-name
string
Middle name of the contact.
Last Name
last-name
string
Last name of the contact.
Phone Number
phone-number
string
Phone number of the contact.
Phone Number Type
phone-number-type
string
Phone number type of the contact. If there is no phone number, pick none. Enum values
none
CELL
MAIN
PHONE
HOME
WORK
Email
email
string
Email of the contact.
Email Type
email-type
string
Email type of the contact. If there is no email, pick none. Enum values
none
HOME
WORK
Birthday
birthday
string
Birthday of the contact. Format is in 'YYYY-MM-DD'.
Output
Field ID
Type
Description
Recipient WhatsApp ID
recipient-wa-id
string
The WhatsApp ID of the recipient. Most likely the same with their phone number.
Message ID
message-id
string
The ID of the message.
Send Interactive Call to Action URL Button Message
Send interactive Call-To-Action URL button message. Note: Message can only be sent when the 24-hour customer service window is open. For more information, please visit here.