Introduction
This document provides a comprehensive guide on integrating Autom Mate with WhatsApp, allowing users to automate processes and interactions within the WhatsApp Business application. It outlines the process of defining and managing credentials within the Autom Mate Vault for secure authentication.
WhatsApp Business is a dedicated application designed for businesses to communicate with their customers via WhatsApp. Businesses can utilize features such as automated replies, predefined messages, chatbots, and dashboards to enhance customer interactions and streamline customer service tasks.
What is WhatsApp Business?
An overview of WhatsApp Business, emphasizing its role in facilitating business-to-customer communication and the features it offers.
Overview of WhatsApp Business: WhatsApp Business is an application tailored for businesses, enabling them to communicate with customers via WhatsApp. It provides tools such as automatic replies, predefined messages, chatbots, and dashboards to enhance customer engagement and support.
Key Features:
Automatic Replies
Predefined Messages
Chatbots
Dashboards
Autom Mate Integration with WhatsApp
Description of how Autom Mate seamlessly integrates with WhatsApp Business, offering actions to automate messaging, list creation, button responses, and media sharing.
Overview of Integration: Autom Mate enables users to perform various operations within the WhatsApp app. It provides actions such as creating structured lists, sending text messages, sharing media, and setting up interactive buttons for quick responses.
Prerequisites
WhatsApp Business Account: You must have a WhatsApp Business Account. This is necessary for any integration with the WhatsApp Business API.
Facebook Business Manager: Since 360 Dialog is an official WhatsApp Business API provider, you will need to have a Facebook Business Manager account that is verified. This is important for linking your WhatsApp number to the API.
Phone Number: A dedicated phone number that hasn’t been used with WhatsApp Business API before. This number will be registered with your WhatsApp Business API profile.
API Access: You need to apply for API access through 360 Dialog, which involves agreeing to specific terms of service and potentially undergoing a review process.
Technical Setup: Understanding of API integration is crucial. You should be comfortable with concepts like webhooks, JSON formats, and HTTPS requests.
Security Compliance: Ensure that your systems comply with WhatsApp’s and 360 Dialog’s security and data protection guidelines. This might involve implementing secure storage for authentication tokens and message content.
Using the Integration
Credential Management
Steps to define and manage credentials within the Autom Mate Vault for secure authentication in WhatsApp operations.
Usage:
Navigate to the Autom Mate Vault section.
Click on "Add New Credential" to define a new credential.
Fill in the required fields:
Credential Name: Unique identifier for the credential.
Authentication Type: Method used for authentication (e.g., API Key, OAuth).
WhatsApp Business API Token: Token provided by WhatsApp Business API.
Additional Fields as required.
Save the credential in the Autom Mate Vault for secure storage.
Credential Usage
Instructions on how to utilize credentials from the Autom Mate Vault in WhatsApp operations.
Usage:
When setting up Autom Mate WhatsApp actions:
Select the option to use Vault-managed credentials.
Choose the desired credential from the Autom Mate Vault.
Authenticate securely using the selected credential.
Execute the WhatsApp operation with enhanced security and access control.
How To Use Actions
List Scope
Description: Allows creation of a structured list within a chat for organized information display.
Purpose: Organize information in an easily navigable format for users.
Usage:
Select the "List Scope" action in Autom Mate.
Choose to use Vault-managed credentials for authentication.
Define the label, header, body, footer, and button text for the list.
Add list items to populate the list with relevant information.
Inputs:
Label
Header
Body
Footer
Button Text
List Item
Description: Individual items within the list scope with specific details and actions.
Purpose: Provide detailed information and actions for each item in the list.
Usage:
Select the "List Item" action in Autom Mate within a List Scope.
Specify the label, title, description, and response for the list item.
Inputs:
Label
Title
Description
Response
Dynamic List
Description: A dynamically populated list from a data source.
Purpose: Fetch data from a source to create a list dynamically.
Usage:
Select the "Dynamic List" action in Autom Mate.
Choose to use Vault-managed credentials for authentication.
Define the label, request URI, response title path, response description path, authentication method, HTTP method, header, and query params.
Inputs:
Label
Request URI
Response Title Path
Response Description Path
Authentication
Method
Header
Query Params
Button Scope
Description: Create a set of interactive buttons within a chat for quick replies or actions.
Purpose: Enable users to interact with predefined actions or responses.
Usage:
Select the "Button Scope" action in Autom Mate.
Choose to use Vault-managed credentials for authentication.
Define the label, header, body, and footer for the button scope.
Add button items to create interactive options for users.
Inputs:
Label
Header
Body
Footer
Button Item
Description: Individual buttons within the button scope with specific actions.
Purpose: Provide selectable options with defined responses or actions.
Usage:
Select the "Button Item" action in Autom Mate within a Button Scope.
Specify the label, title, and response for the button item.
Inputs:
Label
Title
Response
Text
Description: Send plain text messages within the chat.
Purpose: Share information or responses in text format.
Usage:
Select the "Text" action in Autom Mate.
Choose to use Vault-managed credentials for authentication.
Enter the label and message text to send.
Inputs:
Label
Message Text
Send Media
Description: Send media such as images or videos within the chat.
Purpose: Share multimedia content with users.
Usage:
Select the "Send Media" action in Autom Mate.
Choose to use Vault-managed credentials for authentication.
Specify the label, media type, link to the media, and optional caption.
Inputs:
Label
Media Type
Media Link
Caption
Additional Tips
Creating the WhatsApp Autom
When the user creates a new aurom for WhatsApp, we need to set the trigger type as “Webhook” to run it.
If the API key for the Autom Mate user was not created, there will be no API key at the end of the webhook URL and it won’t work because of it. For creating the API key, you need to press to the “?” icon on the left down part of web interface and choose “API key generate”.
If there is an API key visible to you when you press the button, it means that the user you are logging in has already created it and you can skip it.
After creating the API key, you can put the Webhook as Trigger to your flow.
The Webhook that we see is a unique webhook address that Autom Mate generates. Now, we need to redirect the WhatsApp number to the autom that we created to be able to use the autom variables that we are putting inside.
Connecting 360 Dialog to the Autom
For connecting the 360 Dialog to the autom that is created, the user needs to "POST" the data of the Autom to 360 Dialog.
Steps:
Open the Postman.
Create a new POST request.
The url of the POST is: https://waba.360dialog.io/v1/configs/webhook
The Header is "D360-API-Key":"{your_api_key}"
As body, put the below data as "raw".
Send the http request. The response should be "200 OK" and same with the step 5 data the user provided.
If return is succes, now every message that sends to the WhatsApp number will be redirected to the autom.
Webhook Rule Defining
In WhatsApp, when the user writes anything to the chatbot there will be 3 actions triggering on the WhatsApp’s API side. Trigger for message sent, message delivered and message read.
Every trigger comes to our trigger condition because of the webhook already connected with our chatbot.
In the monitoring side of Autom Mate, if we look at the History section after sending a message to the chatbot we will see 1 Completed and 3 Failed as it shown on the below screenshot. This is because webhook only able to read the data that has a specific json field called “contacts” in it.
This situation is not an issue but will create unwanted number of logs to monitor in our system. To prevent it we need to create a rule from Management > Webhook API menu. In this menu we will press the “Add Rule” button and a pop-up comes on the screen to start the process.
In the Details page, we will define a name and description for our rule.
In the Rule page, we will define the condition to make our webhook work without flaws.
In our case, the rule should be like this:
Params = Body
Key = contacs
Operator = is exist
Status = 200
When we put all the rules, we are pressing the Add button at the end and pressing next to continue.
At the Add Autom side, you can choose the WhatsApp flows that you already created and when you select them and press add rule, the operation will be done.
Now every step is done and we can continue to building the flow itself.
Triggering the WhatsApp flow which is created
WhatsApp “sessions” will be initiated when a user writes to the WhatsApp number that we directed it’s API to our Webhook.
After the first message that is sent to the number, the Webhook will be triggered and the rest of the session will go through the flow that we created.
Building the WhatsApp flow
Under WhatsApp application, there are 7 different actions that we can work with in the flow.
Text
Button Scope
Button Item
List Scope
Dynamic List
List Item
Send Media
Last updated