How to connect WhatsApp with a human-agent service

Understanding Quickwork Chat. Quickwork provides a no-code, API-based SaaS platform with pre-integrated apps for automation of business workflows and messaging.

Quickwork Chat is powered to interact with customers via various messaging platforms such as WhatsApp, LINE, Facebook Messenger, etc. in integration with Quickwork Journey Builder. The Multichannel feature allows admins and agents to communicate with customers available on any of the above-mentioned messaging platforms and enables them to view all the conversations in real-time on a single dashboard. Messages received through different channels get highlighted with respective channel identifiers. Looking at this, it becomes easy for an agent to identify the point of origin of the customer and what the nature of communication will be. This helps to broaden the customer’s reach by not just getting confined to the website portal.

Communicating with customers on their choice of messaging platforms imposes a good sign of future relations instead of begging the customer to move to a confined chat window for any purpose.

To understand multichannel more in detail, let's take a use-case and build a journey that explains the functionality more precisely.

Use-case

Communicate with a WhatsApp user and make him/her understand the product functioning using Quickwork Chat as a messaging platform.

To implement this use-case, we need to build two journeys with the following two adaptors which will execute in synchronization for the flow of messages in real-time:

  1. Quickwork Chat

  2. WhatsApp by Gupshup

Prerequisite

According to the use-case, the user should have an active Whatsapp Business account with access to Whatsapp Business API. The user can then integrate these platforms with Quickwork Chat by using Quickwork Journey Builder. Here in the example, we'll be using WhatsApp by Gupshup APIs to integrate and communicate. Before integration, a user must have an app registered in his/her Gupshup account. Follow these steps to do so:

  1. Log in to WhatsApp by Gupshup account using Google sign-in. Note: The same WhatsApp by Gupshup account to be used for authorization while configuring the journey in Quickwork Journey Builder.

  2. You'll be redirected to the WhatsApp dashboard.

  3. Click the blue-colored + icon to create a new WhatsApp Messaging App. Then click the Access API button.

  4. Enter the name for the Whatsapp app you are creating, say QuickworkChatMultiChannel. The user will interact with this bot on WhatsApp in the execution phase:

Figure 1: Creating an app/bot in WhatsApp by Gupshup

5. Click the Submit button. You'll be driven through a couple of steps that give an overview of the app created. Simply click on the Next button. Your app has now been created successfully. You can check the phone number allotted to you in the Send messages to desired recipients section.

Gupshup provides a sandbox environment supporting WhatsApp APIs with a static phone number using which testing of an app and configuring a journey could be done easily.

Creating an inbox

Go to Quickwork Chat and create a multichannel inbox named Whatsapp communication. To do this, click on the gear icon (Settings) > Inbox Settings > click the Add New Inbox button > and select the Multichannel option:

Figure 2: Multichannel inbox

Enter the name for the inbox as WhatsApp communication and click Continue. Add any agents if you want and proceed further. Your inbox is ready. Now to monitor the conversations belonging to this specific inbox, click the Conversations icon and select WhatsApp communication. You'll be redirected to its conversation dashboard which is blank as of now:

Figure 3: WhatsApp communication inbox

Creating the first multichannel journey

Let's create a journey that will fetch a new message from a WhatsApp user and forward it to a Quickwork Chat agent

Configuring the trigger

  1. Create a new journey named New message from WhatsApp user.

  2. Under the Trigger section, choose the WhatsApp by Gupshup app from the drop-down menu in the Apps field present right below the New Trigger button.

  3. Select the trigger event, New text message, from the drop-down menu in the Triggers field.

  4. For authorizing and connecting your WhatsApp by GupShup account, select an existing connection from the drop-down or create a new connection. Click here to know how to create a new connection. While creating a new connection, a Connect to WhatsApp by Gupshup dialog box will appear. Fill all the required fields carefully as shown below:

Figure 4: Connection window

5. The input fields will open-up automatically after a successful connection. In the Message field, enter the welcome message for the user. E.g., Hello, welcome to Quickwork Chat multichannel service. How may I help you? and select Yes as an input to Send Welcome Message:

6. As soon as you do this, Journey Builder will return a Callback Webhook URL as shown in the following figure. You need to paste this URL to listen for incoming messages from WhatsApp user:

Figure 5: Webhook URL

7. Copy this URL, go to your app created in Gupshup, and search for the Callback URL / Link your Bot section. Now, toggle ON to enable the Enter your Callback URL field, paste the above callback URL, and click Set:

Figure 6: Specifying the callback URL

8. Your successfully configured trigger will look like this:

Figure 7: WhatsApp by Gupshup trigger

Configuring the action

To do this, follow these steps:

  1. Under the Steps section, click on the SImple Action button.

  2. Choose the Quickwork Chat app from the Apps drop-down menu field.

  3. Select the Forward message to agent action in the Actions field.

  4. Connect the WhatsApp communication inbox to establish the connection. Click the Link an account button and specify the API key and Inbox ID of this inbox. You'll get these in the Toolkits window of the WhatsApp communication inbox. Click the Link account button:

Figure 8: Quickwork Chat connection window

The API key is common for all the inboxes of an account whereas Inbox ID is unique for each inbox.

5. The input fields will open-up automatically after successful connection establishment. Drag the Sender ID and Text data pills from the Data Tree Output and drop it in the Multichannel identifier and Message fields, respectively. Select WhatsApp as the Multichannel type from the drop-down given. Your action should now look as below:

Figure 9: Quickwork Chat-Forward message to agent action

6. The journey is now successfully configured. Click the Save changes button and start the execution by clicking the Start Journey button.

Creating the second multichannel journey

Let's configure the second journey that will allow an agent to reply to user's queries on WhatsApp via the Quickwork Chat portal.

Configuring the trigger

To do so, follow these steps:

  1. Create a new journey named Reply from QC agent to the WhatsApp user.

  2. Under the Trigger section, choose the Quickwork Chat app from the drop-down menu in the Apps field present right below the New Trigger button.

  3. Select the trigger event, New text message from agent, from the drop-down menu present in the Triggers field.

  4. From the drop-down menu of selecting the existing connection, use the same connection that you had created in the previous journey with the inbox named Whatsapp Communication.

  5. In the Event field, mention Message from an agent. The journey builder will return a webhook URL as shown in the following figure:

Figure 10: Webhook URL

7. Now, copy this URL and go to the WhatsApp communication inbox in your Quickwork Chat account. Then, go to the Webhook tab of the inbox and paste this webhook URL in the Agent Response Webhook field:

Figure 11: Pasting the webhook URL

8. Click the Save Changes button. 9. The successfully configured trigger will look like this:

Figure 12: Quickwork Chat trigger

Configuring the action

To do this, follow these steps:

  1. Under the Steps section, click on the Simple Action button and choose the WhatsApp by Gupshup app from the drop-down menu in the Apps field.

  2. Select the action, Send message, from the drop-down menu in the Actions field.

  3. From the drop-down menu, select the existing connection and connect the same WhatsApp by Gupshup account as we had done for the previous journey:

  4. In the Message and Phone number field, pass the Content and MultiChannel Identifier key from the Data Tree Output, respectively:

Figure 13: WhatsApp by Gupshup-Send message action

6. The journey is now successfully configured. Click the Save changes button and start the execution by clicking the Start Journey button.

Both the configured journeys will look like this:

Figure 14: Multichannel journeys

Executing the multichannel functionality

Go to the WhatsApp Dashboard in WhatsApp by Gupshup account and click the Settings icon beside the app named QuickworkChatMultiChannel. Find the Smart mechanisms to get active and opted in users section where you'll get a small procedure to get a user opted in:

Figure 15: Ways to start a whatsapp conversation using Gupshup

As we are working within a sandbox environment, the traditional way will be to save the static number on a device and send a WhatsApp message PROXY QuickworkChatMultiChannel on it. You can also scan the QR code to initiate the conversations on WhatsApp.

This static number is a 12-digit number provided by Gupshup for sandbox apps. It contains a 2-digit extension code (91) with a 10-digit static phone number. Just save the rest of the 10-digit number on your phone. The device will automatically store the number with the given extension.

As soon as you send the above message on this static phone number via WhatsApp, you'll be prompted with a default welcome message confirming that you have opted in. Now let’s send a Hi and check if the agent receives the message on the dashboard or not.

Now to check whether the agent has received the message or not. Let’s get back to the Quickwork Chat dashboard. Click on the conversation icon on the left-hand side and select the inbox named Whatsapp Communication. Now in the filters drop-down which is located exactly beside the inbox name, select the Mine and Resolved filters:

Figure 16: Message from a WhatsApp user reflecting in the inbox

Now, the agent can start sending responses to the user's message from this portal and a user can follow up with the agent directly on Whatsapp:

Figure 17: Agent's response to the user's message

The agent's response gets automatically synced on WhatsApp as per the execution of the journey and the user gets a response for the concern raised. This can be clearly seen in the following screenshot:

Figure 20: Whatsapp conversation between a user and an agent

Hence, this is how a human agent can connect with a user on WhatsApp with the help of Quickwork Chat and Quickwork Journey Builder. The same functionality can also be used to achieve the goal of connecting with customers on messaging platforms like Facebook, Line, etc., the only condition being that the steps for creating a connection with the respective platform and the input fields for sending messages will differ.