Skip to content

WhatsApp

The WhatsApp integration connects your WordPress site to the WhatsApp Cloud API. Unlike chat plugins, where a visitor starts the conversation and you answer each message by hand, it lets recipes send business-initiated messages and message templates when people act on your site (making a purchase, joining a group, completing a course, receiving a comment on their article) and reply automatically to the messages you receive. This article covers creating the Meta app the integration needs, connecting it to Uncanny Automator, setting up the webhook, going live with a permanent access token, and using WhatsApp in recipes.

If you have Uncanny Automator Lite, you’ll first need to connect your site to a free Uncanny Automator account, which gives you app credits to use with WhatsApp. On a paid plan, app integrations are included.

Setting up WhatsApp with Uncanny Automator

The integration works directly with Meta’s Cloud API, so setup takes more steps than most integrations; allow about 30 minutes. The steps are:

  1. Create a Meta app with the WhatsApp use case.
  2. Get your phone number ID, messaging account ID and an access token.
  3. Connect Uncanny Automator to the app.
  4. Add the webhook to the app.
  5. Go live: your own phone number, a payment method, a published app and a permanent access token.

These instructions assume you already have a Facebook account. Meta changes its developer dashboard often. If a screen no longer matches this article, Meta’s own Cloud API getting started guide has the current steps; the values Automator needs stay the same.

Step 1: Create a Meta app with the WhatsApp use case

  1. Go to developers.facebook.com/apps and log in. If you have not registered as a Meta developer yet, Meta asks you to register first; registration is free.
  2. Click Create App.
  3. On App details, enter an App name and an App contact email, then click Next.
  4. On Use cases, select Connect with customers through WhatsApp and click Next.

The Use cases step of Create an app in the Meta developer dashboard with Connect with customers through WhatsApp selected

  1. On Business, select the business portfolio that will own the app, or click Create a business portfolio. The WhatsApp use case requires one. Click Next.
  2. On Requirements, click Next.
  3. On Overview, check the details and click Create app. The app’s Dashboard opens.

Step 2: Get your phone number ID, messaging account ID and access token

Automator needs three values from the app. All three are on one screen.

  1. On the app’s Dashboard, click Customize the Connect with customers through WhatsApp use case.
  2. In the menu under Basic setup, click Step 1. Try it out. Meta gives the app a test phone number, shown under Test number with its Phone Number ID and Messaging account ID.
  3. Next to Access token, click Generate token. In the window that opens, continue as yourself, choose the WhatsApp accounts the app can access, and click Save. The token appears in the Access token field.

Step 1. Try it out in the Meta developer dashboard showing the test number, its Phone Number ID and Messaging account ID, and the Access token field with the Generate token button

Leave this tab open: you copy the three values in the next step.

Important: This access token is temporary and expires about an hour after you generate it. It is enough to connect and test. Replace it with a permanent access token (Step 5) before you rely on the connection, or your recipes will stop sending when it expires.

Step 3: Connect Uncanny Automator to the app

  1. In your WordPress dashboard, go to Automator > Settings > App integrations > WhatsApp.
  2. Copy the three values from Meta’s Step 1. Try it out screen into Automator:
    • Meta’s Access token goes in Access token.
    • Meta’s Phone Number ID goes in Phone number ID.
    • Meta’s Messaging account ID goes in WhatsApp Business Account ID. Meta calls a WhatsApp Business Account a messaging account; it is the same ID.

The WhatsApp panel under Automator Settings App integrations listing four triggers and two actions, with the setup instructions and the Access token, Phone number ID, and WhatsApp Business Account ID fields filled with placeholder values above the Connect WhatsApp account button

  1. Click Connect WhatsApp account. Automator confirms with a message that your account has been connected successfully.

The connected page keeps the Phone number ID and WhatsApp Business Account ID fields, puts the access token behind an Update access token button, and adds the Webhook URL and Verify token you need in the next step, each with a copy button. The footer shows the name and ID of your Meta app with Disconnect and Save settings.

The connected WhatsApp settings with the Phone number ID and WhatsApp Business Account ID fields, the Update access token button, the Webhook URL and Verify token with copy buttons, Regenerate webhook URL, and the connected app with Disconnect and Save settings

Until WhatsApp is connected, the recipe builder’s picker hides it while its Ready-to-use only switch is on.

If Automator shows an authentication error about missing permissions, generate the token again and make sure the app is given access to your WhatsApp account: the token needs both the whatsapp_business_management and whatsapp_business_messaging permissions.

Step 4: Add the webhook to the app

The webhook lets WhatsApp tell Automator what happens to your messages and when you receive one. Automator uses it to confirm whether a message was delivered, to run the WhatsApp triggers, and to respond automatically, for example by sending an opt-in request when a message was not delivered because the recipient has not opted in. The two actions send messages without it.

  1. In your Meta app, under Basic setup, click Step 2. Production setup and open Configure Webhooks.
  2. In Automator’s WhatsApp settings, copy the Webhook URL into Meta’s Callback URL field, and the Verify token into Meta’s Verify token field.

Configure Webhooks under Step 2. Production setup in the Meta developer dashboard, with the notice that unpublished apps only receive test webhooks, the Callback URL and Verify token fields filled in, and the Verify and save button

  1. Click Verify and save. Meta calls the Webhook URL to check it, so your site must be reachable from the internet over HTTPS; a local or password-protected site fails this check.
  2. In the same screen, open Register your WhatsApp phone number and turn on Subscribe webhooks for your messaging account.

Important: While your Meta app is unpublished, Meta delivers only the test webhooks you send from the app dashboard. Real delivery updates and incoming messages do not reach your site, so the WhatsApp triggers do not run for real conversations until you publish the app (Step 5).

If you click Regenerate webhook URL in Automator later, paste the new URL into Meta’s Callback URL field: WhatsApp triggers stop working until you do.

Step 5: Go live

The setup so far uses Meta’s test number and a temporary token. To message your own customers, finish the remaining tasks in Step 2. Production setup:

  1. Register your WhatsApp phone number: click Add new number and verify the number you want to send from. It must not already belong to a WhatsApp account. A number gets its own Phone Number ID, and its messaging account may differ from the test one, so update Phone number ID and WhatsApp Business Account ID in Automator’s WhatsApp settings and click Save settings.
  2. Add payment to send business-initiated messages: click Add payment method. Meta charges for message templates directly.
  3. Publish the app: in the app’s left menu, click Publish. Meta asks for a privacy policy URL first; add it under App settings > Basic, then return and click Publish.
  4. Replace the temporary token with a permanent one, as described in the next section.

Meta may also ask you to complete Step 3. Business verification; until you do, Meta limits how many phone numbers you can add.

Generating a permanent access token

The access token from Step 2 expires about an hour after you generate it. Meta issues permanent tokens to system users, so you add a system user to your business portfolio, give it access to the app and the WhatsApp account, and generate a token for it.

  1. Go to Business settings and select the business portfolio that owns your app.
  2. Under Users, click System users.
  3. Click Add. Enter a System user name, set System user role to Admin, and click Create system user.
  4. Select the system user and click Assign assets. In the window that opens:
    • Select Apps, tick your app, and turn on Manage app under Full access.
    • Under Messaging accounts, tick your WhatsApp account and turn on Everything under Full access.
    • Click Assign assets.
  5. Click Generate token and follow its steps: select your app, set the expiration, and under Assign permissions select whatsapp_business_management and whatsapp_business_messaging.
  6. Copy the token. Meta shows it only once.

Note: Meta’s dashboard also has a Generate token button under Step 2. Production setup > Send message that Meta describes as generating a permanent access token for your WhatsApp Business account. If you use it, paste that token into Automator the same way.

Using the permanent access token

  1. Go to Automator > Settings > App integrations > WhatsApp.
  2. Click Update access token.
  3. Paste the permanent token into New access token and click Update token.

The Phone number ID and WhatsApp Business Account ID stay as they are.

Sending WhatsApp messages from your site

Once connected, WhatsApp offers these triggers and actions in the recipe builder:

  • Trigger: A message to a recipient was not delivered
  • Trigger: A message to a recipient is not delivered because they have not opted in
  • Trigger: A message is received
  • 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

The triggers start from WhatsApp, not from a visitor logged in to your site, so they work only in recipes of the Everyone type. The actions work in either recipe type, after any trigger: a registration, a purchase, a completed course, a new group member, a comment on the user’s post, and many more.

Meta’s WhatsApp Business Policy controls what you can send:

  • To people who have not opted in to messages from your business, you can send only approved message templates. Templates cover cases such as purchase confirmations, activity updates, and marketing messages, and WhatsApp charges for them directly.
  • Once a person opts in by replying to a message template, you can send templates or regular messages for the next 24 hours, without WhatsApp charges.
  • Twenty-four hours after the person’s last message, you are limited to approved templates again, and the charges apply.

Messages and message templates

Because of that policy, you will usually use Send a WhatsApp message template to a number: a regular message is rejected if the recipient has not opted in by replying to a template.

Important: You create message templates in WhatsApp, and WhatsApp must approve each template before you can send it. Meta’s guide to setting up WhatsApp message templates covers creating them.

In the template action, fill the template’s variables with tokens from the recipe, such as a product name, a course name, or a comment, so each message carries the details of what the person did. Once the person has opted in by replying, use Send a WhatsApp message to a number to send any reply you want.

Example: a purchase confirmation with a coupon reply

Create a message template for the confirmation, such as: “{First name}, thank you for your purchase of {product name}! Would you like a coupon code for 10% off your next order? Reply 10COUPON now!” Then create two recipes:

  • Recipe 1: the WooCommerce trigger A user pays for an order with a product, and the action Send a WhatsApp message template to a number with the thank-you template, sent to the user’s number.
  • Recipe 2 (Everyone): the trigger A message is received, then a Filter block that continues when the message is “10COUPON” or “10coupon” (condition match mode Any). In its Conditions met path, add Send a WhatsApp message to a number to the sender’s number, with the coupon code.

Example: forwarding comments to authors

Create a message template such as: “Your article has received a new comment! Comment: {comment} Tap to view the comment: {comment URL}”. Then create a recipe with the trigger A user’s post receives a comment and the action Send a WhatsApp message template to a number with that template, sent to the author’s number.

Note: Meta sets WhatsApp’s pricing and decides which conversations need a payment method on your WhatsApp Business account. Check Meta’s WhatsApp pricing documentation before you start sending business-initiated messages.

Related: Filter block and conditions, Recipes for Everyone, Managing tokens

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top