WhatsApp for Business Connector
The WhatsApp for Business connector lets you send templated messages to WhatsApp accounts in your PingOne DaVinci flow using the WhatsApp Business Platform Cloud API.
The connector sends template-based messages, such as welcome messages, purchase confirmations, and promotional reminders, and takes care of all API requests and variable formatting for you. It also receives webhook notifications when a message is received or a message status changes.
Setup
Resources
You can find more information and setup help in the following:
-
WhatsApp documentation:
-
PingOne DaVinci documentation:
Requirements
To use the connector, you’ll need:
-
A WhatsApp Business Platform account with an access token generated from a system user or through Facebook login.
-
The current Graph API version.
-
A valid and approved message template.
-
The WhatsApp phone number of the message recipient and the from phone number ID of the sending device.
Configuring the WhatsApp for Business connector
Add the connector in PingOne DaVinci as shown in Adding a connector, then configure it as follows.
Connector configuration
| Setting | Description |
|---|---|
Access Token |
Your permanent WhatsApp access token. |
Version |
The WhatsApp Graph API version used for requests. The default is v13.0. Update the version if necessary. |
App Secret |
The app secret for your WhatsApp application. It’s used to verify the signatures of incoming webhook requests. |
Webhook Verify Token |
The Meta webhook verify token used when Meta verifies your webhook endpoint. When Meta sends a verification request, the token must match the value that you set in your Meta app configuration. |
PingOne DaVinci Redirect Webhook URI |
The PingOne DaVinci webhook URL for this connector. This value is provided automatically as a read-only field and should be copied into your Meta app configuration as the webhook callback URL. |
Using the connector in a flow
Sending templated messages
You can use the connector to send templated WhatsApp messages in a flow, such as an automated welcome message, a purchase confirmation, or a reminder about current or upcoming promotions. All messages rely on the message templates you’ve created and had approved in your Meta WhatsApp account.
At a high level:
-
A trigger node in your flow, such as an HTML form, starts the message delivery. The connector only sends messages after a trigger node runs.
-
The Send Message Template capability sends the message using the recipient’s WhatsApp phone number and the from phone number ID of the sending device.
-
In the Message Type dropdown, you select the template type to send:
-
Text message template sends a template that uses only text variables in the message body. Compatible with templates that use body variables only.
-
Media message template sends a template that uses an image URL in the message header and text variables in the body. Compatible with templates that use an image header and body variables.
-
Interactive message template sends a template with interactive buttons, such as a visit-website or call-phone-number button, and reads the end user’s input on those buttons. The buttons are handled during template creation, so they require no configuration in the connector.
-
-
You provide the approved template name and, for media templates, the header image URL. The message language code defaults to en_US.
-
In Template Variables, you add each variable that the template expects, including the variable name, value, and data type.
-
The Make Custom API Call capability calls a WhatsApp Business API endpoint that isn’t available as a connector capability, using the endpoint, method, query parameters, headers, and request body you provide.
Test the flow by clicking Save, Deploy, and Try Flow.
Receiving message webhooks
You can use the connector’s webhook capability in your flow to respond to messages that WhatsApp users send to your business.
At a high level:
-
The WhatsApp Message Webhook capability receives webhook notifications when a message is received or a message status changes.
-
When Meta verifies your webhook endpoint, the capability responds with the challenge using the webhook verify token that you configured.
-
For incoming messages, the capability verifies the webhook payload signature using your app secret and outputs message details, such as the sender’s phone number, profile name, WhatsApp ID, and message text.
Test the flow by clicking Save, Deploy, and Try Flow.
Capabilities
Send Message Template
Sends a WhatsApp message template to a phone number.
Show details
-
Properties
-
Input Schema
-
Output Schema
- Recipient textField required
-
Recipient of the WhatsApp message.
- From Phone Number ID textField required
-
WhatsApp from phone number ID.
- Message Type dropDown required
-
WhatsApp message type
-
Text message template
-
Media message template
-
Interactive message template
-
- Text Message Template Name textField
-
WhatsApp text message template name (from WhatsApp dashboard)
- Media Message Template Name textField
-
WhatsApp media template name (from WhatsApp dashboard)
- Media Message URL textField
-
Media URL for the image being sent.
- Interactive Message Template Name textField
-
WhatsApp interactive template name (from WhatsApp dashboard)
- Language Code textField
-
Define the language code of the messsage
Default:
en_US - Template Variables variableInputList
-
Variables for WhatsApp message template.
-
default object
-
properties object
-
to array required
Recipient of the WhatsApp message.
-
messageType string required
List of acceptable message types.
-
textMessageTemplateName string
Name of the WhatsApp text message template being used.
-
mediaMessageTemplateName string
Name of the WhatsApp media message template being used.
-
mediaMessageUrl string
Renders and sends the user selected image.
-
messageLanguageCode string
Define the language code of the messsage.
-
message string required
Sends a WhatsApp message to a phone number.
-
fromId array required
WhatsApp from phone number ID.
-
-
Input Example
{
"properties": {
"to": "13035555555",
"messageType": "Text message",
"message": "Hello, how are you?",
"languageCode": "en_US",
"fromId": "19704444444"
}
}
-
output object
-
rawResponse object
-
statusCode number
-
headers object
-
challenge string
-
Make Custom API Call
Define a custom API call to WhatsApp Business.
Show details
-
Properties
-
Input Schema
-
Output Schema
- Endpoint textField required
-
The WhatsApp Business API endpoint, such as "/messages/register/deregister/media/request_code".
- From Phone Number ID textField required
-
WhatsApp from phone number ID.
- Method dropDown required
-
The HTTP Method.
-
GET
-
POST
-
PUT
-
DELETE
-
PATCH
-
- Query Parameters keyValueList
-
Add query parameters and provide their values.
- Headers keyValueList
-
Add HTTP headers and provide their values.
- Body codeEditor
-
The raw formatted JSON body.
-
default object
-
properties object
-
fromId string
FromId
-
endpoint string required
Endpoint
-
method string required
Method
-
queryParameters array
Query Parameters
-
headers array
Headers
-
body object
Body
-
-
-
output object
-
rawResponse object
-
statusCode number
-
headers object
-