Topics in this section

WhatsApp Integration

WhatsApp

‘WhatsApp’ – the social app needs no introduction, arguably the most popular channel that enables secure communications. In addition to its growing popularity, the value it brings on board is far more superior compared to other channels. And, the reason is; its low-cost advertising facilities and spam free feature.

WhatsApp now empowers businesses from all walks of life to communicate with their customers like the way they interact with their friends and family. Your business designation within the WhatsApp ecosystem determines how your business appears to end users. FirstHive empowers businesses with the capability to use WhatsApp as a channel to communicate with their customers in a highly secure environment. WhatsApp uses E2E Encryption that is END 2 END ENCRYPTION. In simple words, no one can view or sniff your WhatsApp messages; except you as a sender and receiver.

WhatsApp Configuration in FirstHive

Currently, FirstHive is not managing the WhatsApp. FH is having two types of integration:

If clients already have the GupShup enterprise approach, FH can go ahead configure. These are the following credentials FH wants from them:

Webhooks

A webhook is an HTTPS callback that is triggered by a user-defined event at the originating site. In its simplest form, a webhook is a web service that receives HTTPS POST requests from a source. Webhooks handle incoming messages from people who respond to you on WhatsApp including text, location, and media such as pictures and documents as well as the status of the messages you’ve sent. They are an important channel to deliver, both timely notifications as well as out-of-band errors, and it is thus highly recommended you set one in the application settings.

Inbound messages sent by customers to your WhatsApp Business Phone Number will be sent to your Webhook i.e., customer sends a text message or media attachment on WhatsApp the GupShup platform registers the event and immediately sends a notification (HTTP POST request) to the Webhook specified in your application settings. Some important notes on Webhook:

Message Types Allowed

WhatsApp Configuration Requirements                    

FirstHive is managing the subscriptions. To configure WhatsApp:

  • The user/business must subscribe inside GupShup from the Sender ID.  FH checks whether the user is subscribed for that Sender ID.
  • When users are subscribed by the client site, FH sends the Subscription API. Call the API to get real-time OPT_IN and OPT_OUT data, as users OPT_IN and OPT_OUT at any point of time.
  • They need to mark that particular user as OPT_IN. Then only you will be able send communication.
  • Businesses must clearly state that a person is opting in to receive messages from the business over WhatsApp.
  • WhatsApp mandates that you get voluntary consent from your user to send communication. Every account you want to send WhatsApp communication, you need their consent to do so.
  • Businesses must clearly state the business’ name that a person is opting in to receive messages from.
  • Whether that user is subscribed for that particular Sender ID. We will just check this one.
  • Whenever any user is subscribed by the client site. To get the OPT-IN and OPT-OUT.
  • Once the user marked as OPT_IN, you can send communication to the OPT_IN users only.
NOTE

Ask the client to upload a document from where you can get the data.    

Required Detail

NOTE

Any other new integration apart from Netcore and Solutions Infini will require API Document, User Acceptance Test Information (UAT environment to test to verify/accept), Live Production environment.  

Webhook URL for Responses 

Webhooks are user-defined HTTP callbacks that are triggered by specific events such as an inbound message from a customer i.e., customer sends a text message or media attachment on WhatsApp. Whenever that trigger event occurs, the FH Messaging API registers the event and immediately sends a notification (HTTP GET/POST request) to the Callback URL specified in your account settings indicating when you receive a message.

When an incoming message arrives at your FH WhatsApp Business phone number, FH sends a request to your web application via webhook request. This request contains information about the incoming message, such as its sender and any attached media.

NOTE
1. To get FH to call your Webhook, you need to provide a URL to your application in the statusCallback parameter of each message for which you want the status callbacks.

2. Please reach out to the account manager to set the Callback URL for your account in order to receive inbound message webhook events.

3. It is important that your Webhook returns an HTTPS 200 OK response to notifications. Otherwise, the WhatsApp Business API client considers that notification as failed and tries again after a delay.

Webhook Requests

Webhook requests will be posted to a URL configured by you and in the format application/json. Webhook request method will always be POST. There will be additional parameters that will be appended to the postURL.

You can use these Webhooks in two ways:

If a Webhook event isn’t delivered for any reason (e.g., the client is offline) or if the Webhook request returns a HTTP status code other than 200, we retry the Webhook delivery. We continue retrying delivery with increasing delays up to a certain timeout (typically 24 hours, though this may vary), or until the delivery succeeds.

NOTE

For OPT_IN, immediately create response to know whether it is a success/failure. You need to configure a Webhook URL in client site. That will be the Response API to check whether your API accepted or not.  

Third-party Integration

For third-part integration, clients have to share one API where FH can push all the data such as Sender ID, Email, Phone Number, etc.; from there it’s their job to push it to the actual API.

Whenever any message comes for a particular Sender ID, using that API FirstHive team sends a request. They won’t be changing anything, except the url and configure it. They ask the client for the same. They do not need to create any API; the client will do this instead. There is the option to use the POST and GET method to configure the API, but here they will allow only for the POST method.

They post the application/json format to their API. It will be their responsibility to send the value. What they need is a response base – whether it is a Success or Failure. One Message ID need to be created.

  Step 1: Create a json  

Step 2: Push the API (this will happen from Java side)  

The team has to push the API in one format. Currently it is in SendGrid. In FirstHive’s setting, it will be a POST method only, previously it was GET method. Whenever any status change happens, they will update the FirstHive team.

NOTE

They are just pushing it to the API. Whatever the values, the team will fetch it and push it to the API.  
Figure 1: WhatsApp Integration Flow
NOTE

If clients’ want any additional parameters, they have to put it here.