WhatsApp Component

WhatsApp is a messaging app that allows users to send texts, make voice and video calls, and share media.
Component key: whatsapp
Description
WhatsApp is a messaging app that allows users to send texts, make voice and video calls, and share media.
Use the component to send messages and configure webhook subscriptions.
API Documentation:
The component was built using the WhatsApp Business Platform Cloud API.
Connections
WhatsApp Access Token
To get started with WhatsApp, you first need to create a Meta developer account.
- Select Create app.
- In the ‘Add products to your app’ section, select Setup for WhatsApp.
- Once the validation has been made to your account, navigate back to the home page of the App
- From the side menu find the WhatsApp section and select API Setup.
- Select Generate access token and enter the value into the connection configuration of your integration.
- Additionally, this screen will also provide your accounts Test Number, Phone number ID, and Business Account ID.
Input | Notes |
---|---|
Access Token password / Required accessToken | Your WhatsApp Access Token. |
Triggers
Webhook
Receive and validate webhook requests from WhatsApp Business for webhooks you configure. | key: webhook
Input | Notes | Example |
---|---|---|
App Secret password / Required appSecret | The secret that WhatsApp will use to sign your webhook payloads. | 6a321a12a123456789abc54321f12a12 |
Verify Token string / Required verifyToken | The token that WhatsApp will use to verify your webhook. | meatyhamhock |
Data Sources
Select Phone
Select a phone number. | key: selectPhone | type: picklist
Input | Notes | Example |
---|---|---|
Connection connection / Required connection | ||
WhatsApp Business Account ID string / Required whatsappBusinessAccountId | The ID of the WhatsApp Business Account to retrieve phone numbers for. | 12345678901234567 |
Actions
Delete Media
Delete a media file from a phone number. | key: deleteMedia
Input | Notes | Example |
---|---|---|
Connection connection / Required connection | ||
Media ID string / Required mediaId | The ID of the media file to delete. | 1234567890123456 |
{
"data": {
"success": true
}
}
Get Media
Get media from WhatsApp. | key: getMedia
Input | Notes | Example |
---|---|---|
Connection connection / Required connection | ||
Media ID string / Required mediaId | The ID of the media to retrieve. | 1234567890123456 |
Phone Number ID string phoneNumberId | Business phone number ID. The operation will proceed only if it matches the ID used to upload the media. | 912345678912345 |
{
"data": {
"messaging_product": "whatsapp",
"url": "<URL>",
"mime_type": "<MIME_TYPE>",
"sha256": "<HASH>",
"file_size": "<FILE_SIZE>",
"id": "<MEDIA_ID>"
}
}
Get Media from URL
Download media from a URL. | key: getMediafromURL
Input | Notes | Example |
---|---|---|
Connection connection / Required connection | ||
URL string / Required url | A URL returned by the Get Media action to download media from. | https://lookaside.fbsbx.com/whatsapp_business/attachments/?mid=12345... |
{
"data": "<BINARY_DATA>"
}
Raw Request
Send raw HTTP request to WhatsApp Business API. | key: rawRequest
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Data string data | The HTTP body payload to send to the URL. | {"exampleKey": "Example Data"} | |
Debug Request boolean debugRequest | false | Enabling this flag will log out the current request. | |
File Data string Key Value List fileData | File Data to be sent as a multipart form upload. | [{key: "example.txt", value: "My File Contents"}] | |
File Data File Names string Key Value List fileDataFileNames | File names to apply to the file data inputs. Keys must match the file data keys above. | ||
Form Data string Key Value List formData | The Form Data to be sent as a multipart form upload. | [{"key": "Example Key", "value": new Buffer("Hello World")}] | |
Header string Key Value List headers | A list of headers to send with the request. | User-Agent: curl/7.64.1 | |
Max Retry Count string maxRetries | 0 | The maximum number of retries to attempt. Specify 0 for no retries. | |
Method string / Required method | The HTTP method to use. | ||
Query Parameter string Key Value List queryParams | A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2. | ||
Response Type string / Required responseType | json | The type of data you expect in the response. You can request json, text, or binary data. | |
Retry On All Errors boolean retryAllErrors | false | If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors. | |
Retry Delay (ms) string retryDelayMS | 0 | The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled. | |
Timeout string timeout | The maximum time that a client will await a response to its request | 2000 | |
URL string / Required url | Input the path only (/106540352242922/messages), The base URL is already included (https://graph.facebook.com/v21.0). For example, to connect to https://graph.facebook.com/v21.0/106540352242922/messages, only /106540352242922/messages is entered in this field. | /106540352242922/messages | |
Use Exponential Backoff boolean useExponentialBackoff | false | Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored. |
Register Phone Number
Register a phone number for use with WhatsApp. | key: registerPhoneNumber
Input | Notes | Example |
---|---|---|
Connection connection / Required connection | ||
Data Localization Region string dataLocalizationRegion | Enables local storage for the business phone number. Specify the country for data-at-rest storage. | IN |
Phone Number ID string / Required phoneNumberId | The ID of the phone number to register. | 912345678912345 |
PIN string / Required pin | Set this to your 6-digit two-step verification PIN if enabled. If not, set a new 6-digit PIN. | 123456 |
{
"data": {
"success": true
}
}
Request Verification Code
Send a verification code to verify a phone number. | key: requestVerificationCode
Input | Default | Notes | Example |
---|---|---|---|
Code Method string / Required codeMethod | The method to use to send the verification code. | SMS | |
Connection connection / Required connection | |||
Language string / Required language | en | The language's two-character language code code. | |
Phone Number ID to Verify string / Required phoneNumberId | The ID of the phone number to verify. | 912345678912345 |
{
"data": {
"success": true
}
}
Send Message
Send a message to a user. | key: sendMessage
Input | Default | Notes | Example |
---|---|---|---|
Audio code audio | A media object containing audio. Required when type is audio. | ||
Biz Opaque Callback Data string bizOpaqueCallbackData | An arbitrary string, useful for tracking. Maximum 512 characters. | Some arbitrary string | |
Connection connection / Required connection | |||
Contacts code contacts | A contacts object. Required when type is contacts. | ||
Context code contextInput | An object containing the ID of a previous message you are replying to. Required if replying to any message in the conversation. | ||
Document code document | A media object containing a document. Required when type is document. | ||
Image code image | A media object containing an image. Required when type is image. | ||
Interactive code interactive | An interactive object. Required when type is interactive. | ||
Location code location | A location object. Required when type is location. | ||
Phone Number ID string / Required phoneNumberId | Phone number ID of the WhatsApp Business Account you want to use to send the message. | 912345678912345 | |
Preview URL boolean previewUrl | false | Allows for URL previews in text messages. Required when type is text. | |
Reaction code reaction | A reaction object. Required when type is reaction. | ||
Status string status | A message's status. You can use this field to mark a message as read. | read | |
Sticker code sticker | A media object containing a sticker. Required when type is sticker. | ||
Template code template | A template object. Required when type is template. | ||
Text code text | A text object. Required when type is text. | ||
To string / Required to | WhatsApp ID or phone number of the customer you want to send a message to. | 12124567890 | |
Type string type | text | The type of message you want to send. If omitted, defaults to text. | text |
{
"data": {
"messaging_product": "whatsapp",
"contacts": [
{
"input": "16505555555",
"wa_id": "16505555555"
}
],
"messages": [
{
"id": "wamid.HBgLMTY1MDUwNzY1MjAVAgARGBI5QTNDQTVCM0Q0Q0Q2RTY3RTcA"
}
]
}
}
Upload Media
Upload media to WhatsApp. | key: uploadMedia
Input | Notes | Example |
---|---|---|
Connection connection / Required connection | ||
File data / Required file | The file to upload. This should be a file returned from an action that returns a file. | |
Filename string filename | The filename to use for the uploaded file. | example.jpg |
Phone Number ID string / Required phoneNumberId | The ID of the phone number to upload media to. | 912345678912345 |
{
"data": {
"id": "<MEDIA_ID>"
}
}