Send Whatsapp Messages via Journey Webhooks
WhatsApp has over 2.7 billion world-wide users, making it the most-used mobile messaging app. With OneSignal Journeys, and webhooks, you’re now able to reach these users all automatically in order to improve your bottom line.
Requirements:
- Paid plan that supports both Journeys and Webhooks
- Meta Business App + WhatsApp API Enabled
- WhatsApp recipients
Meta or Twilio APIs Required
While the following guide uses the Facebook/Meta API, Twilio can also be used to Post WhatsApp messages.
Setup
1. Import recipients phone numbers
WhatsApp supporting numbers should be uploaded as a data tag to a User.
Here's an example:
![](https://cdn.statically.io/img/files.readme.io/9d6d60f-Screenshot_2023-12-11_at_4.18.55_PM.png)
Note on Tag Format
Please add numbers in the E.164 format, but without the + sign. The number +16463938787 should be added as 16463938787.
2. Obtain Webhook code
Once you have created your Meta/Facebook Business account and have activated your WhatsApp Module, you’ll be given an API access token.
You'll be able to find this information under WhatsApp -> API Setup
![](https://cdn.statically.io/img/files.readme.io/6accf9b-Screenshot_2023-12-11_at_4.20.11_PM.png)
3. Create a Webhook Template
Within OneSignal, click on: Settings -> Webhooks -> New Webhook
Copy over the credentials. It should look like this:
![](https://cdn.statically.io/img/files.readme.io/d9e43cc-Screenshot_2023-12-11_at_4.20.49_PM.png)
Tag Liquid Syntax
{{user.tags.whatsapp_number}} tag key is added as the “to” number as highlighted above.
4. Create a Journey
You can now create your Journey and add your new WhatsApp Webhook.
![](https://cdn.statically.io/img/files.readme.io/3820472-ezgif-1-f9593fcbbb.gif)
When testing, please make sure of the following:
- The subscription id in which you have added the WhatsApp number has an external id
- The subscription id matches the Journey included segment(s)
Updated 7 months ago