skip to Main Content

WhatsApp

Introduction

Uncanny Automator features the only WhatsApp integration available anywhere that gives you full access to the WhatsApp Cloud API with no added transaction fees.

Unlike the various WhatsApp chat plugins available for WordPress that require users to initiate messages and for you to respond manually to every message, it enables you to send direct, business-initiated messages, message templates, and automatic responses to your users based on actions they take on your site such as making a purchase, joining a group, completing a course, receiving comments on their articles, and much, much more. It even provides tools to handle opt-ins and dynamic variables in message templates!

Setting up WhatsApp on your WordPress site with Uncanny Automator

As this is a very powerful integration that integrates directly with the Cloud API, setup is a bit more involved than a typical integration, so you can expect to spend about 30 minutes on the process.

Here’s an overview of the steps:

  1. Create a Business app on developers.facebook.com
  2. Add the WhatsApp product to your new Business app
  3. Connect Uncanny Automator to your Business app
  4. Add a Webhook to your Business app
  5. Add a phone number to your Business app

These instructions assume that you already have a Facebook account.

1 – Create a Business app on developers.facebook.com

You’ll first need to create a Business app on Meta for access to Facebook services, including WhatsApp.

To create a Business app:

  1. Go to developers.facebook.com. If you’re not already logged in, click Log in in the top right. (Note: You may need to register as a developer if you haven’t already. Don’t worry—it’s free and easy. Simply click Get started in the upper right-hand corner.)
Meta for Developers homepage with icons for Facebook, Instagram, WhatsApp, and a red arrow pointing to the “Get Started” button.
  1. Click My Apps in the top right.
Meta for Developers homepage with a red label over the browser address bar showing "developers.facebook.com" and another over the "My Apps" button.
  1. Click Create app.
Meta Developer dashboard showing the "Apps" section with a highlighted green "Create App" button in the upper right corner. A red arrow points to the button.
  1. You may see a modal appear for developing apps with “use cases”. You can exit this modal. Next, create an “App name”. For example, we have named our app “Automator”. After naming your app, click Next.
Meta developer dashboard showing the "Create an app" screen, with the app name field filled in as "Automator" and highlighted by a red arrow.
  1. Under the Use Cases tab, select Other and click Next.
Meta developer dashboard showing the "Add use cases" step of app creation, with the "Other" option selected at the bottom. A note indicates this option uses the old experience and allows choosing from all available permissions, features, and products.
  1. Choose Business then click Next.
Meta developer dashboard showing the "Select an app type" screen. The "Business" option is selected, allowing the creation or management of assets like Pages, Events, Groups, Ads, Messenger, WhatsApp, and Instagram using business permissions and features.
  1. Fill out the required fields. Leave the Business Account field empty, or select an associated Business Account if desired. Click Create app.
Meta developer dashboard showing the final step of app creation. The app name is set to "Automator," an email contact is provided, and the optional business portfolio dropdown is left unselected.

2 – Add the WhatsApp product to your Business app

Your app can be used to access multiple Meta services.  In this article, we’ll add the WhatsApp product to your new app.

To add the WhatsApp product to your Business app:

  1. In the Add products to your app screen. Select WhatsApp and click Set up.
Meta dashboard showing app product options with WhatsApp integration highlighted.
  1. Create a new Meta Business Account or select an existing account. You will see a Getting started screen with technical details of your app.
WhatsApp Business Platform API setup screen prompting the user to select a business portfolio and agree to Meta’s terms before continuing.

3 – Add a phone number to your Business app

To begin sending messages from WhatsApp, you’ll need to add a phone number.

To set up a phone number:

  1. In the Quickstart screen, click Start using the API.
WhatsApp Business Platform Quickstart screen with a highlighted “Start using the API” button under API Setup, guiding users to begin integrating the Cloud API.
  1. Under the API Setup, use the Test number or click Add phone number.
WhatsApp Business API setup screen showing a test number selection dropdown, with an arrow pointing to the “Add phone number” option for sending and receiving messages.
  1. Create a WhatsApp Business profile then click Next.
Form to create a WhatsApp Business profile showing fields for display name, timezone, category, and an optional business description. The "Next" button is highlighted.
  1. Enter a phone number to use with WhatsApp. You will need to register a number that’s not already associated with a WhatsApp account. If you want to use a number that’s already associated with a WhatsApp account, you will need to migrate the number to your business account (login required). Click Next to verify your number via text or phone call.
Form to add a phone number for WhatsApp business account, showing country code, phone number, and verification method options including ‘Text message” and “Phone call”.
  1. Click Generate access token and follow the prompts in the modal that appears.
The API Setup section under Quickstart on the Meta platform, showing an empty "Access Token" field with a blue "Generate access token" button highlighted by a red arrow. A "Copy" button is also visible next to the input field.

(Note: This access token will be valid for 24 hours only. We will show you how to create a permanent access token.)

4 – Connect Uncanny Automator to your Business app

Uncanny Automator needs some information about your Business app to send messages via WhatsApp.

To connect Uncanny Automator to your Business app:

  1. From your WordPress Admin Dashboard, navigate to Automator > Settings > App Integrations > WhatsApp.
  2. On the Getting started screen of your Business app, copy and paste these three pieces of information into your Uncanny Automator WhatsApp settings:
    • Access token
    • Phone number ID
    • WhatsApp Business Account ID
Quickstart screen for API setup above Automator WhatsApp settings fields, showing copy and paste instructions for placing access token, phone number ID, and WhatsApp Business Account ID.
  1. On your WordPress site, click Connect WhatsApp Account. You should see the message: Your test account “[Account name]” has been connected successfully!
WhatsApp integration settings showing fields for phone number ID, business account ID, webhook URL, and verification token, with the Automator account successfully connected.

5 – Add a webhook to your Business app

A webhook enables Uncanny Automator to receive message confirmations from WhatsApp.  This enables Automator to confirm whether messages were sent successfully, as well as automatically respond when certain conditions are met (e.g. send an opt-in request when a message was not delivered because the user has not opted-in to receive communications from your business).

To set up the webhook:

  1. From your Meta Business app, in the left menu, navigate to WhatsApp > Configuration.
  2. Return to the WhatsApp settings page in Automator.
  3. Copy and paste these two pieces of information into your WhatsApp webhook settings:
    • Callback URL
    • Verify token
WhatsApp webhook configuration screen in Meta's developer dashboard, showing where to paste the Automator webhook URL and verify token for API integration.
  1. Click Verify and save.
  2. Under Webhook fields, scroll down to “messages” and switch the toggle to Subscribed.

That’s it! You will now be able to send and receive messages via Uncanny Automator.

Generating a Permanent Access Token

The steps above are a quick way to get started with WhatsApp on your WordPress site. The temporary access token generated in Step 2 is only valid for 24 hours. When you’re ready to go live, you’ll need to generate a permanent access token.

Meta uses System Users to provide permanent access tokens to their services. So you’ll need to add a System User to your Business Manager account, then use that System User’s access token for permanent access.

To add System Users to your Business Manager account and generate a permanent access token:

  1. Go to Business Settings.
  2. Below Users, click System Users.
  3. Click Add.
Meta Business Settings interface showing how to add a new system user by selecting “System users” from the sidebar and clicking the blue “+ Add” button.
  1. Give a name to the system user and choose Admin. Then click Create System User.
Meta interface for creating a system user, showing input fields for the system user name and role selection.
  1. Click Assign assets. In the modal that appears, select Apps > [App Name] > Full control.
Meta Business Manager interface showing the process of assigning full control permissions to a system user for the "Automator" app.
  1. At the top of the screen, next to the user, click Generate token.
Meta Business Settings interface showing a system user with admin access selected. A red arrow points to the “Generate token” button, which is used to create an access token for the selected system user.
  1. In the modal that appears, select an app, expiration period for the token, and permissions. The permissions must be: “whatsapp_business_management” and “whatsapp_business_messaging”. Click Generate token.
Meta Developer portal showing the "Generate token" step. The user has selected permissions whatsapp_business_messaging and whatsapp_business_management to grant the app access for managing and sending WhatsApp messages.
  1. Copy your token.

Using the permanent access token

To switch to the new access token, you’ll need to disconnect and reconnect with the new token.

  1. From your WordPress Admin Dashboard, navigate to Automator > Settings > App integrations > WhatsApp.
  2. Click Disconnect.
  3. Paste the permanent access token into the Access token field, and enter the same Phone number ID and Whatsapp Business Account ID as before.

Using Uncanny Automator to send WhatsApp messages from your WordPress site

Uncanny Automator can be used to send messages when users complete actions on your site, such as registering, making a purchase, completing a course, joining a group, receiving a private message, receiving a comment on their blog post, and many, many other supported triggers.

Here are the WhatsApp triggers and actions supported by Uncanny Automator:

  • Trigger: A message is received
  • Trigger: A message to a recipient is not delivered because they have not opted in
  • Trigger: A message to a recipient was not delivered
  • Trigger: A message to a recipient is set to a specific status
  • Action: Send a WhatsApp message to a number
  • Action: Send a WhatsApp message template to a number

Meta enforces a very strict policy regarding sending messages to users. It can be summarized as follows:

  • You may only send approved message templates to users who have not opted-in for communications from your business. These message templates can cover many scenarios such as product purchase confirmations, activity updates, marketing messages and more.  These message templates are subject to WhatsApp platform fees (paid directly to WhatsApp).
  • Once a user has opted-in (by responding to a message template), you may send message templates or regular messages over the next 24-hour period.  These messages/message templates are not subject to WhatsApp platform fees.
  • After 24-hours since the last message received from the user, you are again limited to sending only approved message templates to the user, and these messages are subject to WhatsApp platform fees.

Click here for the full policy.

Messages vs. message templates

Given how the WhatsApp business policy is designed, you will typically use the action Send a WhatsApp message template to a number, since non-template messages will be rejected if the user has not opted-in (by responding to a message template).

Message templates are set up directly on the WhatsApp platform and must be approved by WhatsApp before they can be sent.

When you use the Send a message template to a number action, you can populate pre-defined dynamic variables in the message template with Uncanny Automator using tokens. Tokens can include things like product names, private messages, comments, course names, or anything else you want to include in your message based on the action the user took on your site.

Creating WhatsApp message templates goes beyond the scope of this article, but Meta offers their own comprehensive documentation on this feature. Click here to learn how to set up WhatsApp message templates.Once the user has opted-in by responding to a message template, you can use the Send a message to a number action to automatically send any desired response to the user.

Example 1 – Sending a purchase confirmation message

A common use of WhatsApp could be to send an order confirmation and thank you message when a customer makes a purchase through WooCommerce. Here’s an example of how this could be set up:

  1. Create a WhatsApp message template for the purchase confirmation message.  Example: “{First name}, thank you for your purchase of {product name}! Would you like to receive a coupon code valid for 10% off your next order? Reply “10COUPON” now!”
    • Create two recipes:
    • Recipe 1
      • Trigger: A user pays for an order with {a product}
      • Action: Send {thank you for your order} message template to the user
    • Recipe 2:
      • Trigger: A message is received
      • Condition: If the message = “10COUPON” or “10coupon”
      • Action: Send {a message} to {the sender’s number} (that includes the 10% off coupon code)

Example 2 – Forwarding article comments to authors via WhatsApp

Another use could be to send comments to blog post authors in real-time, with a link to view the comment.  Here’s how this automation could be set up:

  1. Create a WhatsApp message template for the comment message. Example: “Your article has received a new comment! Comment: {comment} Tap to view the comment: {comment URL}”
    • Create a recipe:
      • Trigger: A user’s post receives a comment
      • Action: Send {post comment} message template to the user

These examples are really just the tip of the iceberg.  We’re excited to see how users create interactive automated workflows with this powerful integration!

Note: Starting April 1 2023, users on the free tier of WhatsApp Business can only respond to user-initiated conversations. If you want to use business-initiated conversations after April 1 2023, you will need to add a payment method. Learn more about free tier conversations.

Back To Top