Connect WhatsApp Business directly
To connect a bot to your WhatsApp Business account:
- Create an application in your developer account.
- Set up the application.
- Create a script in Aimylogic.
- Connect an inbound channel.
- Set up a webhook in the application.
- Test the bot.
Create an application
caution
To set up the integration, you need a developer account.
- Sign in to your developer account.
- Select My Apps from the tab bar.
- Click Create App.
- On the Type tab, select Business and click Next.
- On the Details tab, add information about the application:
- an app name
- your contact email
- your business account
- Click Create App to save the information.
Set up the application
First, you need to generate a permanent token to continue the application setup.
caution
A permanent token is only available for applications in a live mode.
Generate a permanent token
To generate a permanent token:
- Go to the Business Settings page.
- In the Users section, select System Users and click Add.
- Enter System Username, System User Role and click Create System User.
- On the System Users page, click Add Assets.
- Go to Select Asset type → Apps → Select assets and select your app name.
- Enable the Manage App option in the Full Control section and click Save Changes.
- On the System Users page, click Generate New Token.
- Select your app from the dropdown list.
- Enable the
whatsapp_business_management
andwhatsapp_business_messaging
permissions from the list and click Generate Token.
Complete the application setup
To complete the application setup:
- Go back to the My apps page and select your app.
- On the Dashboard page, go to the Add products to your app section, select WhatsApp, and click Set up.
- On the Getting started tab:
- Go to Step 1: Select phone numbers and choose a phone number connected to your WhatsApp Business account. ! > If you do not have a number yet, go directly to Step 5: Add a phone number, create a profile and verify the number.
Then go back to Step 1: Select phone numbers and choose the number from the dropdown list. - Copy a Phone number ID.
- Go to Step 1: Select phone numbers and choose a phone number connected to your WhatsApp Business account. ! > If you do not have a number yet, go directly to Step 5: Add a phone number, create a profile and verify the number.
- On the Configuration tab, copy Permanent token.
caution
You will need a Phone number ID and a Permanent token for an inbound channel connection in Aimylogic.
Create a script in Aimylogic
Now you need to create a bot script in your Aimylogic account.
Aimylogic script features
In WhatsApp, users themselves start a dialog with the bot.
Add a global $TEXT
intent to the first screen of your script so that a user can start a dialog:
- On the My chatbots tab, choose the bot you will connect to the messenger.
- Click Add screen → Create your own intent.
- Create a
$TEXT
intent. - Click to turn the sample phrase into a template.
- Activate the Make the block available from any script point option.
- Click Save.
- Connect a
$TEXT
intent to the welcome screen in your script.
caution
Do not connect the Other intents option to any other blocks.
To handle unpredictable messages from a user:
- Add another screen with a
$TEXT
intent. Do not activate the Make the block available from any script point option. - Connect the Other intents option to a block that contains an answer to an unpredictable phrase.