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 configuration is defined and maintained here.

#Setup

FieldField IDTypeNote
Token (required)tokenstringFill in your WhatsApp access token. Go here for more information: https://developers.facebook.com/docs/whatsapp/cloud-api/get-started

#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: https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#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: https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages
Header Type (required)media-typestringSpecify the header(media) type for the header section of the template.
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: https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#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: https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#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: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows

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.
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: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows

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.
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: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows

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: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows

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.
EmailemailstringEmail of the contact
Email Typeemail-typestringEmail type of the contact. If there is no email, pick none.
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: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows

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