The client had a requirement to integrate WhatsApp Account of User to their Salesforce instance. They want to store the personal Chats, Group chats in Salesforce for different business purposes.
Solution / Approach:
We have used Chat API to sync chats of Whatsapp and related details in the Contact Object of Salesforce. Mobile Number field of Contact is used as a Unique Id in Salesforce to store the chat of WhatsApp. The chats which already have the Mobile Number in the Salesforce, will be updated in the Salesforce, or we can create a new contact to store new chats as per the business needs. If users does not want to sync any other chat, then a checkbox is used to prevent syncing of chats in Salesforce.
A User can sync the Chats from WhatsApp to Salesforce by the following ways:
- Clicking on the Specific Button.
- Running the batch at the specific time.
Chat API is used for the Integration, there is a field Description in the Contact Object, we are saving the chats by showing Sender’s Name besides Sender’s message, You and Owner’s chat as shown below:
Stephen Mark: Heyy.
You: Hi. Welcome to Salesforce- WhatsApp Integration.
There is a Instance Number in the Chat API. Chat instance is required that we are fetching via Chat API as shown in the Screenshot below:
We accomplished following functionalities:
- Fetch the chats of a Particular Person from Whatsapp to Contact Object of Salesforce.
- Get the Chat person details in Salesforce line Name, Phone Number etc.
- The Whatsapp Contacts who have Contact records in Salesforce are synced.
- Phone Number is used to initiate identity of Contact and manage duplicates.
- Markup to identify the sender of message.
- Get the Group Chats in Salesforce
The base URI for API resource is: https://app.chat-api.com/instance/xxxxx where app is a instance of whatsapp and xxxxx is the Instance number.