How to integrate in WhatsApp.
Introduction.
Even though it might seem that Meta has made it difficult to integrate your Caleida AI Agent into your WhatsApp Business, don't worry: we bring you a detailed step-by-step tutorial to help you with your setup, along with all the necessary requirements to complete it.
Still, remember that we help you configure Caleida in your business if you subscribe to the annual AI Plus Agent plan or higher.
Steps.
Throughout the tutorial, we will follow these steps:
Create a personal Facebook Account.
Create a business page.
Access Meta Business Suite.
Generate the Token.
Create a Business Portfolio.
Create an account on Meta for Developers.
Create an Application.
Add system users.
Assign assets.
Generate the token or identifier.
Obtain IDs.
Phone Number ID.
WhatsApp Business ID.
Obtain the key (Secret).
Webhook Endpoint and Verification Code.
Message Activation.
Enter your phone number for WhatsApp Business.
Add your Payment Method.
Verify your Business.
Customize your WhatsApp Business.
Requirements.
On the other hand, the requirements to complete the WhatsApp Business integration are as follows:
Personal Facebook Account.
Business page.
Business Portfolio on Meta.
Permanent Token or Identifier.
A phone number dedicated to WhatsApp Business.
Phone and WhatsApp Business IDs.
Key (Secret).
Payment Method.
Important.
This tutorial will help you from scratch if you do not have your personal Facebook account set up, so if you already have one, you can skip directly to Step 2.
If you already have an account on Meta Business Suite, you can skip directly to Step 3.
If you already have a business portfolio, you can skip directly to Step 3.2.
If you already have an account on Meta for Developers, you can skip Step 3.2.
Note: due to the number of integration steps, we recommend that you follow the tutorial and verify that everything is correct.
1. Create a Personal Facebook Account.
The first thing you need to integrate your AI Agent into WhatsApp Business is a personal Facebook account. If you don't have one, you can create it directly from the following link.
2. Create a Business Page.
Next, we will create a Facebook Business Page. Go to the following link and make sure you are logged in with your personal Facebook account. After this, you can click on “Create a Page”.
Fill out each of the required fields with your company's data. Once you are done, click on the “Create Page” button.
2.1 Access Meta Business Suite
Once you have created your business page, you need to access the Meta Business Suite to manage your business assets. Go to the following link to access your Meta Business Suite Dashboard. Make sure you are logged into your Facebook account, and click on "Get Started".
3. Generate the Token
The first necessary data to integrate our AI Agent into WhatsApp Business is the Token or Identifier.
3.1 Create a Business Portfolio
To generate it, once inside Meta Business Suite, the first thing we need to do is create a Business Portfolio. Create one from the dropdown menu at the top left and fill in the fields.
Remember to select the previously created Business Page.
Once created, click on "Settings" in the left sidebar menu.
A new selection of sections will appear, where we should select "Business Settings". This will take us to a different page, which you can also access by clicking here. Once on this page, click on "Apps" within the Accounts section and create an application by clicking first on "Add" and then on "Create an App ID."
3.2 Create an Account on Meta for Developers
When you click on "Create an App ID," it will redirect you to Meta for Developers. If it doesn't, you can also access it by clicking on the following link and then on "Log In." If you are already logged into Facebook, it will likely log you in automatically. Otherwise, log in with your previously created personal account.
Now, we will complete the three simple registration steps:
Accept the terms and conditions.
Enter a phone number and confirm via SMS.
Select our role.
3.2.1 Create Application
Next, click on "Apps" in the menu at the top and then on "Create App."
Three options will appear. You should select the option "Other."
In the Application Type, select the option "Company."
Finally, you will need to fill in the following fields:
Application Name (we recommend naming it after your business).
Your personal Facebook account email (already pre-filled by default).
Business Profile: select the one we created earlier.
Once you have filled out these fields, simply click on "Create Application".
3.3 Add System User
Once you have created your account on Meta for Developers and created the application, return to Meta Business Suite. In Business Settings, select System Users from the left sidebar menu, and then click Add.
Here we will name the user "Caleida" and assign them the role of administrator (very important).
3.4 Assign Assets
With the user created, now click on "Assign Assets". In the new menu that appears, click on "Apps" and select the application you created in Meta for Developers in step 3.2.1. Give it Full Control by enabling the option to "Manage App". Don't forget to save your changes.
3.5 Generate the Token
Once you have assigned the app as an asset, click on "Generate a new identifier".
Select the application that we created in Meta for Developers in step 3.2.1, named after our business. Next, choose "Never" for expiration and select ONLY the last two permissions:
whatsapp_business_management
whatsapp_business__messaging
Now click on "Generate Identifier".
Copy this Token (a set of numbers and letters in blue) and paste it into the "WhatsApp Token" field within "WhatsApp Settings" under Integrations > Basic in the Caleida Dashboard.
4. Get IDs
To obtain the phone number ID and the WhatsApp Business ID, which are the second and third pieces of data needed for integration, we will return to Meta for Developers and select our app.
Once inside, click on "Dashboard" in the left sidebar menu, then scroll down to WhatsApp, and click on "Set Up" to proceed.
On the left-hand side, click on "API Settings," then click "Continue" to proceed.
Here you will find a test number with its corresponding IDs. With this number, you can conduct necessary tests before launching your AI Agent to the public. (To test your agent, you'll need to add the phone number you want to test with, just below the phone number identifier, in the "To" section.)
Remember, this is a phone number provided by Facebook for testing your APIs.
Later, we will show you how to replace it with your own, which will be used to handle your WhatsApp Business.
4.1 Phone Number ID
Copy both identifiers, the numerical combination that appears to the right of "Phone Number Identifier."
Paste it into the WhatsApp configuration in Caleida in its corresponding section ("Phone Number Identifier").
4.2 WhatsApp Business Account ID
Copy both identifiers, the numerical combination that appears to the right of "WhatsApp Business Account Identifier."
Paste it into the WhatsApp configuration in Caleida in its corresponding section ("WhatsApp Business Account Identifier").
5. Get the Access Key (Secret)
To obtain the access key, return to Meta for Developers and navigate to "Basic Information" under "App Settings" on the left side of the screen.
Here, you simply need to copy the application's secret key. Click on "Show" to reveal the key, and then copy it.
Return to Caleida's Dashboard, and paste it into the "Secret" section within the WhatsApp configuration. Don't forget to save your changes.
6. Webhook Endpoint and Verification Code
We're almost done. In this step, instead of copying and pasting data from Meta's apps to Caleida, we'll do it from Caleida to Meta.
After saving the changes in the previous step, a window will open with the last two pieces of data needed to complete the integration:
Webhook Endpoint
Verification Code
First, we will copy the webhook endpoint and then navigate back to Meta for Developers. Go to the WhatsApp section in the left-hand menu and click on "Settings."
We will edit the webhook and paste the webhook endpoint key copied from Caleida into the "Callback URL" section. Then, we will go back to Caleida's website, copy the verification code, and paste it into the "Verification Code Identifier" section.
We verify and save the changes.
7. Activate Messaging
Finally, to activate messaging, click on "Manage Webhook Fields", select the "messages" option, and then click "Done".
Once you have saved the changes, test your agent as much as you need by chatting via WhatsApp with the test phone number from step 5, using the phone number you added in section "A" (it won't work if you use a different device).
In the following steps, we'll show you how to replace it with the phone number that will be used for your WhatsApp Business, so your customers can start interacting with it and verifying your business.
8. Enter your WhatsApp Business phone number
Once you have completed all the checks you deem necessary, you should add the phone number that will be associated with your WhatsApp Business.
Go back to the section where the test phone number is located and replace it with your own. (Note: Pricing and limits apply based on conversations by Facebook. You can find more information here.)
Once you have added the phone number for your WhatsApp Business, you'll need to copy its corresponding IDs and replace the ones you pasted in Caleida's Dashboard configuration.
Remember, the IDs previously linked in your WhatsApp Business settings in Caleida were for the test phone number. Now, we will replace them with the IDs for the real phone number.
9. Add payment method
Once you have added the final phone number, in API Settings under WhatsApp configuration, proceed to Step 6: Add Payment Method.
This step is necessary to add the phone number that will be associated with your WhatsApp Business.
Here, click on "Payment Settings," where you simply need to add your banking card details.
ChatGPT
10. Verify your business (optional)
Lastly, to verify your business, go to Meta Business Suite and navigate to Settings > Business Settings > Accounts > WhatsApp Accounts and click on "Start Verification" or use the following link.
On this screen, simply initiate the verification process and fill out the fields with your business information. You may need to upload some documents.
11. Customize your WhatsApp Business
This step is optional but highly recommended to take your Agent to the next level.
First, access the following link.
Once inside, click on the gear icon next to the phone number you selected for your business to configure it.
Navigate to the profile section where you'll find various fields to customize, such as profile picture, company description, contact details, etc.
And that concludes the tutorial for integrating Caleida with WhatsApp Business. Remember, if you have any questions, you can contact the Caleida team at support@caleida.io.
Last updated