AiApps.Pro
How to get the official WhatsApp Business API via Gupshup and integrate with Bitrix24
A Step-by-Step Guide
WhatsApp Business API
In this step-by-step guide, we will describe in detail how to get the WhatsApp Business API through the official Facebook partner - the Gupshup service and integrate with the Bitrix24 CRM Open Channels.
Features of the Gupshup service
Gupshup service
  • You can connect any of your existing phone numbers (mobile, local, virtual). The number of connected phone numbers is not limited and does not affect the cost. That is, you can create an unlimited number of communication channels.
  • No monthly fees or connection fees. Within a 24-hour session window, only session incoming and outgoing messages are paid for at a price of $ 0.001 per message. Replenishment of the balance of the service from $ 10 with any bank card. The time for using funds on the balance is not limited. There is no limit on the number of dialogs and clients.
  • To be able to write to the user after 24 hours from the moment of the last message from him, you can prepare special templates and get their approval from WhatsApp. The total cost of sending a template message will be $ 0.001 + the cost of a message at WhatsApp rates.
  • When registering in the Gupshup, $ 1 is credited to the balance for free. This money can be spent on the full use of the service at the beginning of work. If, for example, send and receive only session messages, then enough for 1000 messages. The time of using the trial balance is not limited.
1. Creating an account in Gupshup
Create a Gupshup account by following this guide: https://docs.gupshup.io/docs/overview

Create an app in the Gupshup dashboard by following this guide: https://docs.gupshup.io/docs/quickstart-create-and-configure-access-api

Connect a phone number by following this guide: https://docs.gupshup.io/docs/onboarding-guide

In order for the Go-Live process to work, add our Partner ID 117 (ANWEB) to your Gupshup app and then start the Go-Live process.
2. Connecting WhatsApp Business API Gupshup to Bitrix24
To start receiving and sending messages through your connected phone number to the WhatsApp Business API Gupshup, you need to connect your Gupshup account to your Bitrix24.

In Bitrix24, install the WhatsApp Business API Gupshup app from the marketplace, to do this, follow the link https://www.bitrix24.com/apps/?app=aiappspro.whatsapp_business_api_gupshup and click on the green "INSTALL" button.
Click on the "INSTALL" button
If you have not yet logged into the Bitrix24 marketplace, a pop-up window with the "LOGIN" button will open. Click it to log in with your Bitrix24 account.
Click on the "LOGIN" button or follow the link "CREATE YOUR BITRIX24 NOW"
If you don't have Bitrix24 yet, then click on the "CREATE YOUR BITRIX24 NOW" link in the same pop-up window and register Bitrix24 to your email address or using one of your proposed social network accounts.
Registration Bitrix24
After successfully entering the Bitrix24 marketplace, in the same pop-up window that appeared after clicking the green "INSTALL" button, select your Bitrix24 portal from the list.

Your Bitrix24 will open in a new tab of your browser with a proposal to install the WhatsApp Business API Gupshup app. Press the blue "INSTALL" button.
Click on the "INSTALL" button
Read the license agreement and privacy policy by clicking on the links and tick the boxes if you agree to the terms. Click the green "INSTALL" button.
Check the boxes and click on the "INSTALL" button
After successful installation, a 24/7 app support chat will be automatically created in your Bitrix24, in which you can write at any time if you have any questions about working with the app.
After successful installation, a support chat will be automatically created in your Bitrix24
Chat 24/7 app support
So the app is installed, let's proceed to the activation of the connector for WhatsApp Business API in the Bitrix24 Contact Center.

Close the app installation slide, go to the Bitrix24 Contact Center and click on the installed "WhatsApp Business API Gupshup" connector.
Click on the installed "WhatsApp Business API Gupshup" connector
In the opened connector settings slider, click on the "CONNECT" button.
Click on the "CONNECT" button
If several Open Lines have been created in your Bitrix24, then below you will need to select the required Open Line to which you want to connect WhatsApp, and after selecting, click the "CONNECT" button.
Select the required Open Channel from the list
The same slider will open the connector settings interface.
Connector settings interface
In a new browser tab, go to your Gupshup Dashboard using the link https://www.gupshup.io/whatsapp/dashboard, click on your profile icon and copy the API Key in the pop-up window.
Copy the API Key
Return to the connector settings window in Bitrix24 and in the "Gupshup API key" field enter the API Key copied in your Gupshup account.
Enter Gupshup API key
In a new browser tab, go back to your Gupshup Dashboard using the link https://www.gupshup.io/whatsapp/dashboard and copy the phone number for the "Gupshup sender" field by clicking on the "Settings" link in the list of apps in your Gupshup account.
Follow the link "Settings"
This will open the app settings interface in Gupshup, scroll down to the "Check API Access and Set Callback URL" section and copy the phone number from the "Sender" field. If your own phone number is still pending, this field will contain a test phone number from Gupshup, which you can use to test the app for now.
Copy the phone number from the "Sender" field
Do not close this app settings window in Gupshup for now, it will come in handy below. Return to the connector settings window in Bitrix24 and enter the copied sender's phone number in the "Gupshup sender" field.
Enter the copied phone number in the "Gupshup sender" field
Click the "To plug" button. After successful connection, the messages "Connector connected successfully" and "Copy callback URL and enter it in Gupshup settings" will appear. Copy the "Gupshup callback URL" by clicking the "Copy" button.
Click on the "Copy" button
Go back to our open app settings window in Gupshup, click on the "Callback URL / Link to your bot" tab, toggle the slider to "ON".
Toggle the slider to the "ON" position
Check the boxes below in the "Select which message status events you want to receive via the callback URL". In the "Enter the callback URL" field, enter the "Gupshup callback URL" copied in the connector settings in Bitrix24 and press the "Set" button to apply the settings.
Enter the "Gupshup callback URL" copied in the connector settings in Bitrix24 and click the "Set" button
The WhatsApp Business API Gupshup Connector is ready to go!

If you're still awaiting approval for your phone number and want to test the connector through a test phone number from Gupshup for now, then scroll up the app settings page in Gupshup to the "Smart Mechanisms for Signing Up and Involving Users" section and click on the "Click on Link" icon. A button will open in a new tab to confirm consent to receive test messages. Check the "I agree ..." checkbox and click the "Send Message" button. The WhatsApp application will open to send the preset message "PROXY ..." from your personal WhatsApp number. Please send this message unchanged to the Gupshup test number. The answer will be "Welcome! You're now chatting with…". Now you can send test messages that will be sent to the Bitrix24 Open Channel.

Below are examples of sending and receiving messages through a work phone number.

Send a message, for example from your personal WhatsApp number, to your Gupshup approved WhatsApp Business API phone number.
Send a message to WhatsApp
Accept the message in the Open Channel of your Bitrix24 and write a response.
Accept the message in the Bitrix24 Open Channel
All types of messages are supported: text messages, images, videos, voice messages, files, location coordinates. Messages are processed in accordance with the settings of the Open Channel.
3. Creating templates for outgoing messages
To be able to write to the user after 24 hours from the moment of the last message from him, it is necessary to prepare special templates and get their approval from WhatsApp. The message should not be promotional in nature - WhatsApp only approves service and transaction templates. Templates must comply with the following guidelines: WhatsApp Business Policy, WhatsApp Trade Policy.

The templates need to be created in your Gupshup account. To do this, go to the Gupshup Dashboard at https://www.gupshup.io/whatsapp/dashboard, follow the Settings link in the Gupshup application list.
Follow the link "Settings"
Scroll down the settings page that opens to the "Check API Access and Set Callback URL" section and then click the "View Templates" link.
Follow the link "View templates"
The Template List page opens in a new browser tab. The list that opens will contain only templates for sending via the Gupshup test number marked "Allowed for use on the test server". You won't be able to use them for your number, you will need to create your own templates.

To add your own template, click on the "Add more" button.
Click on the "Add more" button
In the interface that opens, fill in all the required fields and click the "Preview and Send" button. Below is an example of filling in the fields for our approved template.
Fill in all the required fields and click the "Preview and Submit" button
Check all the details and click the "Submit" button.
Check all the details and click the "Submit" button
After sending, we expect 1-2 business days for the template to be approved by WhatsApp. At the same time, no letters come, you need to check the status change of the sent templates yourself in your Gupshup account. In the filter, select "Approved" and a list of all your approved templates will open.
In the filter, select "Approved" and a list of all your approved templates will open
Below in the screenshot is an example of sending a template message from Bitrix24.
An example of sending a template message from Bitrix24
4. Sending automatic messages to WhatsApp from Bitrix24
During the installation in Bitrix24, the "WhatsApp Business API Gupshup" app automatically creates a new SMS provider "[WhatsApp Business API Gupshup]", only this does not send SMS, but messages to WhatsApp.

Sending is carried out both manually and automatically from anywhere in the CRM: from robots, business processes, SMS and Messenger mailings from the CRM marketing section, timeline Leads, Deals, Contacts and Companies.

We give examples of sending such messages below in the screenshots.
Sending a message from the deal timeline
Sending a message from the workflow
Sending a message from the Automation Rules
List of sent messages in the transaction history
Sending a message from an SMS Campaign (CRM Marketing)
Sending a message from the Messengers (CRM Marketing)
Summary
We have completely set up the popular and demanded WhatsApp channel from scratch through the official WhatsApp Business API.

Compared to unofficial APIs, the main advantages of an official connection are:

  • high stability and safety;
  • independence from physical equipment (there is no need to keep a mobile phone connected to the Internet on all the time);
  • independence from the web interface of messages (no need to scan a QR code and transfer it to third-party applications);
  • ample opportunities for integration with external systems to automate message processing.

Also, connecting the WhatsApp Business API through the official Facebook partner - the Gupshup service allows you to reduce the cost of this channel several times compared to other providers of the official WhatsApp Business API. And even often it turns out to be more profitable compared to the costs of non-official connection schemes. For example, many of these services only offer packages of messages or dialogs with a monthly fee. And one more great advantage, you can connect an unlimited number of your phone numbers for the WhatsApp Business API via Gupshup, and this does not affect the cost.