Introduction

Salesforce is the most widely used CRM globally, and WhatsApp is the most commonly used messaging app globally. The benefits of connecting Salesforce and WhatsApp will undoubtedly be increased. Combining Salesforce with WhatsApp improves customer satisfaction, brand loyalty, and company standing.

Customer service is one of the most important factors in boosting a product or service’s sales and marketing. By offering valuable assistance to customers both before and after their purchase, you establish a strategic approach that fosters customer loyalty and drives business growth.The WhatsApp messaging service is used by over 2 billion users across more than 180 countries. WhatsApp Business allows companies to interact with consumers of the messaging service.

Let's look at how Salesforce can be used with this:-

Utilize your Facebook login information to access

https://developers.facebook.com

After logging in, create an app by going to My Apps on the home page.

blog

Click the next button after selecting the “Business App” type. It will then direct us to the detail area, where we must provide all the required information.

blog

Note: We do not need a confirmed business account to log in to WhatsApp Cloud API.

blog

Once the login procedure is complete, we will be taken to the Meta Dashboard, as shown below:-

WhatsApp is the app we want to integrate right now; if we scroll down, we’ll notice “WhatsApp there”.
blog

When we click on it, it will take us to the WhatsApp business platform API, where we can create or add an existing business account.

blog

After this step, we will be taken to the app dashboard, where all our business information will be listed.

blog

Compared to other APIs, WhatsApp cloud API provides a temporary access token that expires after 23 hours. It is also possible to generate a permanent access token, which will require a slew of new steps.

blog

Select Phone Number: The API now provides a test number to free users. This is simply the Sender’s phone number. We can also use our own or a personalized number, but we must have a premium account. Find out more about pricing.

TO: The recipient’s number is represented by this number.

Note: Only five members are currently permitted, and each must be verified before being added to the list. We can also add more numbers.

After we enter the number, Meta will send us a Facebook confirmation code for the number we entered. This indicates that our phone number has been verified.

blog

After entering all these details, press the “Send Message” button. The test number will be sent us a hello world template message, which will be displayed on the app dashboard.

blog

This template is available by default once the account has been set up.

blog

We can also design our own template.

blog

Proceed by selecting “Create Template”. This action will redirect us to the following page, where we must provide the necessary details for the template type before clicking on “Continue”.

blog
blog

After that, we’ll be redirected to a page where we will need a header, body, and footer, and the ability to insert buttons.

blog

The Meta Team is now reviewing it, and will be made available for use. We have completed the basic configuration of WhatsApp for integration with Salesforce.

blog

Let’s look at this functionality in Salesforce-

For integration, WhatsApp Cloud API makes use of Meta’s Graph API. The message endpoint URL is

https://graph.facebook.com/v14.0/ {PhoneNumberId}/messages

PhoneNumberId is simply the test phone number ID generated during app setup.

To enable all callouts, add https://graph.facebook.com to the remote site settings.

blog
Let us now create an Apex Class to access the WhatsApp messages API.

Apex Class: WhatsAppIntegration.cls

blog

Let us now create a Lightning web component from which we will interact and send messages.

LWC: SendMessageUsingWhatsApp.html

blog

LWC: SendMessageUsingWhatsApp.js

Jana Chat box

LWC:SendMessageUsingWhatsApp.meta-xml

Lightning Components Bundle

Now, create an Action Button on any Object and add a Lightning Web component.

Now, add that button to the Page Layout.

blog

Now type the number and message that we want to send.

blog

Congratulations! With the successful integration of Salesforce and WhatsApp, you can now send messages to your clients. This achievement opens up new avenues for communication and engagement with your customer base.

blog