Configuring WhatsApp

How it works

WhatsApp integration enables your agents to reply to WhatsApp messages directly from 3CX. WhatsApp messages are delivered into the same chat panel as live chat, SMS, and Facebook messages enabling you to reply to multiple channels easily and with the same team.

Step 1: Check the Requirements

  • You must have a WhatsApp Business Platform account set up with a phone number added. This number should not be registered to any other existing WhatsApp account, whether it be virtually or on a device. If you want to use a number that is already set up on WhatsApp, you have to delete the account first. Read more here.
  • WhatsApp integration is intended to answer inbound messages only. You cannot initiate a conversation with a WhatsApp user. The WhatsApp user must send you a message first. You will then have 24 hours to respond to the message.

Step 2: Create a WhatsApp application

  1. Navigate to https://developers.facebook.com and click Log In on the top right
  2. Navigate to ‘My Apps’, click on Create App, select Other and click Next.
  3. Select Business for the app type and then click Next.
  4. Give your application a display name and use the drop-down list to select your business account. Click Create app.
  5. Re-enter your password and click Submit.
  6. In the next screen you can add products to your app. Scroll down to WhatsApp and click Set up.
  7. In the “Welcome to the WhatsApp Business Platform” section click Start Using the API.

Setting Up Your WhatsApp application Choose Your Phone Number

  1. Use the drop-down menu to choose the correct phone number - the one you will use to send and receive messages. Copy your ‘Phone number ID’ and save it for a later stage.

Step 3: Set up an Admin role

Setting Up Admin Role in Meta

  1. From the top left-hand side click on the menu icon and select Business settings.
  2. Navigate to Users > System Users and click Add. Accept the non-discrimination policy and click Done.
  3. Set a system user name, i.e. ‘3CX’, and set the user role to Admin.

Manage Permissions: Assigning Asset Access and Roles

  1. Click Add Assets. In the pop-up box, select Apps > “Choose your App” and enable the Manage app option. Click Save Changes.
  2. On the left-hand menu navigate to Accounts > WhatsApp accounts, select your WhatsApp Business account and click Add people.

Setting Access: Configuring WhatsApp Account Permissions

  1. Select the system user you created, allow full control then click Assign.

Step 4: Generate a new token

  1. From the left-hand menu navigate to Users > System users and click on Generate new token.
  2. In the pop-up options, select your app from the drop-down list.
  3. Check the boxes for “whatsapp_business_messaging” and “whatsapp_business_management”. Click Generate Token.
  4. Copy your access token from the pop-up box and save it as it will not be available again. This is a permanent token which does not expire unless you click on the “revoke token” button.

Step 5: Configure 3CX

  1. Log into your Web Client, navigate to Admin > Voice & chat and then click on + Add WhatsApp.
  2. Edit the default name to your preferred name.
  3. Enter your WhatsApp account phone number in an international format (e.g +447732456789).
  4. Copy the Webhook URL to a notepad.
  5. Paste the “Access token” obtained in step 3.
  6. Enter the “Phone number ID” obtained in step 1.
  7. If you are a ‘System Owner’ or a ‘System Admin’, you can make the integration available system wide or just for the group.
  8. Click Save.

Step 6: Configure your webhook in WhatsApp

  1. Go back to your Meta for Developers portal and find your app.

Setting Webhook in WhatsApp from Meta for Developers Portal

  1. Go to WhatsApp > Configuration and click on Edit under the ‘Webhook’ section.
  2. Paste the webhook you copied from the Web Client into the Callback URL field.
  3. To verify the token, enter a random string of letters and numbers. This will not be needed again so there is no need to save your string for a later date. Click Verify and save.
  4. Click on Manage in the ‘Webhook fields’ beneath the Edit button.

Webhook Configuration: Selecting Fields for Subscription and Testing

  1. Check the Subscribe box for the ‘messages’ field and click Done.
  2. You can now proceed to test your configuration by sending a WhatsApp message to your WhatsApp business number.

See also

Last Updated

This document was last updated on 28 February 2024

https://www.3cx.com/docs/manual/whatsapp/ 

Discuss this article