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:

🚧

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

3. Create a Webhook Template

Within OneSignal, click on: Settings -> Webhooks -> New Webhook

Copy over the credentials. It should look like this:

🚧

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.

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)