WhatsApp

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:

#Release Stage

Alpha

#Configuration

The component definition and tasks are defined in the definition.json and tasks.json 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>}.

FieldField IDTypeNote
Token (required)tokenstringFill 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.

InputIDTypeDescription
Task ID (required)taskstringTASK_SEND_TEXT_BASED_TEMPLATE_MESSAGE
Phone Number ID (required)phone-number-idstringPhone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)tostringThe number of the recipient you are sending the message to.
Template Name (required)namestringName of the template.
Language Code (required)language-codestringThe code of the language in which the template is used. Supported languages.
Header Parametersheader-parametersarray[string]Specify the parameters for the header section of the template. Leave this blank if there is no parameter.
Body Parametersbody-parametersarray[string]Specify the parameters for the body section of the template. Leave this blank if there is no parameter.
Button Parametersbutton-parametersarray[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'.
OutputIDTypeDescription
Recipient WhatsApp IDrecipient-wa-idstringThe WhatsApp ID of the recipient. Most likely the same with their phone number.
Message IDmessage-idstringThe ID of the message.
Message Statusmessage-statusstringThe 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.

InputIDTypeDescription
Task ID (required)taskstringTASK_SEND_MEDIA_BASED_TEMPLATE_MESSAGE
Phone Number ID (required)phone-number-idstringPhone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)tostringThe number of the recipient you are sending the message to.
Template Name (required)namestringName of the template.
Language Code (required)language-codestringThe code of the language in which the template is used. Supported languages.
Header Type (required)media-typestringSpecify the header(media) type for the header section of the template.
Enum values
  • image
  • video
  • document
ID or Link (Header Parameter) (required)id-or-linkstringInput either ID or link of the media. If the input has 'http', it will be considered as a link.
Filename (Header Parameter)filenamestringThe 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 Parametersbody-parametersarray[string]Specify the parameters for the body section of the template. Leave this blank if there is no parameter.
Button Parametersbutton-parametersarray[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'.
OutputIDTypeDescription
Recipient WhatsApp IDrecipient-wa-idstringThe WhatsApp ID of the recipient. Most likely the same with their phone number.
Message IDmessage-idstringThe ID of the message.
Message Statusmessage-statusstringThe status of the message.

#Send Location Based Template Message

Send location-based template message. This task support header(location), body and button parameters.

InputIDTypeDescription
Task ID (required)taskstringTASK_SEND_LOCATION_BASED_TEMPLATE_MESSAGE
Phone Number ID (required)phone-number-idstringPhone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)tostringThe number of the recipient you are sending the message to.
Template Name (required)namestringName of the template.
Language Code (required)language-codestringThe code of the language in which the template is used. Supported languages.
Latitude (Header Parameter) (required)latitudenumberLocation latitude.
Longitude (Header Parameter) (required)longitudenumberLocation longitude.
Location Name (Header Parameter) (required)location-namestringName of the location.
Location Address (Header Parameter) (required)addressstringAddress of the location.
Body Parametersbody-parametersarray[string]Specify the parameters for the body section of the template. Leave this blank if there is no parameter.
Button Parametersbutton-parametersarray[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'.
OutputIDTypeDescription
Recipient WhatsApp IDrecipient-wa-idstringThe WhatsApp ID of the recipient. Most likely the same with their phone number.
Message IDmessage-idstringThe ID of the message.
Message Statusmessage-statusstringThe 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.

InputIDTypeDescription
Task ID (required)taskstringTASK_SEND_AUTHENTICATION_TEMPLATE_MESSAGE
Phone Number ID (required)phone-number-idstringPhone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)tostringThe number of the recipient you are sending the message to.
Template Name (required)namestringName of the template.
Language Code (required)language-codestringThe code of the language in which the template is used. Supported languages.
One-Time Password (required)one-time-passwordstringOne-time password to be sent to the recipient. Maximum 15 characters.
OutputIDTypeDescription
Recipient WhatsApp IDrecipient-wa-idstringThe WhatsApp ID of the recipient. Most likely the same with their phone number.
Message IDmessage-idstringThe ID of the message.
Message Statusmessage-statusstringThe 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

InputIDTypeDescription
Task ID (required)taskstringTASK_SEND_TEXT_MESSAGE
Phone Number ID (required)phone-number-idstringPhone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)tostringThe number of the recipient you are sending the message to.
Text (required)bodystringBody of the message.
Preview URL (required)preview-urlstringSpecify whether URL should be previewed or not. This will have no affect if the message does not contain any URL.
Enum values
  • false
  • true
OutputIDTypeDescription
Recipient WhatsApp IDrecipient-wa-idstringThe WhatsApp ID of the recipient. Most likely the same with their phone number.
Message IDmessage-idstringThe 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

InputIDTypeDescription
Task ID (required)taskstringTASK_SEND_MEDIA_MESSAGE
Phone Number ID (required)phone-number-idstringPhone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)tostringThe number of the recipient you are sending the message to.
Media Type (required)media-typestringSpecify what media to send.
Enum values
  • image
  • audio
  • document
  • video
ID or Link (required)id-or-linkstringInput either ID or link of the media. If the input has 'http', it will be considered as a link.
CaptioncaptionstringMedia 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.
FilenamefilenamestringThe 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.
OutputIDTypeDescription
Recipient WhatsApp IDrecipient-wa-idstringThe WhatsApp ID of the recipient. Most likely the same with their phone number.
Message IDmessage-idstringThe 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

InputIDTypeDescription
Task ID (required)taskstringTASK_SEND_LOCATION_MESSAGE
Phone Number ID (required)phone-number-idstringPhone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)tostringThe number of the recipient you are sending the message to.
Latitude (required)latitudenumberLocation latitude.
Longitude (required)longitudenumberLocation longitude.
Location Name (required)location-namestringName of the location.
Location Address (required)addressstringAddress of the location.
OutputIDTypeDescription
Recipient WhatsApp IDrecipient-wa-idstringThe WhatsApp ID of the recipient. Most likely the same with their phone number.
Message IDmessage-idstringThe 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

InputIDTypeDescription
Task ID (required)taskstringTASK_SEND_CONTACT_MESSAGE
Phone Number ID (required)phone-number-idstringPhone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)tostringThe number of the recipient you are sending the message to.
First Name (required)first-namestringFirst name of the contact.
Middle Namemiddle-namestringMiddle name of the contact.
Last Namelast-namestringLast name of the contact.
Phone Numberphone-numberstringPhone number of the contact.
Phone Number Typephone-number-typestringPhone number type of the contact. If there is no phone number, pick none.
Enum values
  • none
  • CELL
  • MAIN
  • PHONE
  • HOME
  • WORK
EmailemailstringEmail of the contact.
Email Typeemail-typestringEmail type of the contact. If there is no email, pick none.
Enum values
  • none
  • HOME
  • WORK
BirthdaybirthdaystringBirthday of the contact. Format is in 'YYYY-MM-DD'.
OutputIDTypeDescription
Recipient WhatsApp IDrecipient-wa-idstringThe WhatsApp ID of the recipient. Most likely the same with their phone number.
Message IDmessage-idstringThe 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.

InputIDTypeDescription
Task ID (required)taskstringTASK_SEND_INTERACTIVE_CALL_TO_ACTION_URL_BUTTON_MESSAGE
Phone Number ID (required)phone-number-idstringPhone Number ID. Obtainable through the app dashboard. Note: This is for sender.
Recipient Phone Number (required)tostringThe number of the recipient you are sending the message to.
Header Textheader-textstringMessage header text.
Body Text (required)body-textstringMessage body text.
Footer Textfooter-textstringMessage footer text.
Button Display Text (required)button-display-textstringThe text displayed on the button.
Button URL (required)button-urlstringURL to load when the user tapped the button.
OutputIDTypeDescription
Recipient WhatsApp IDrecipient-wa-idstringThe WhatsApp ID of the recipient. Most likely the same with their phone number.
Message IDmessage-idstringThe ID of the message.