There are 5 parts to WhatsApp in engAIge
- Adding an external source
- Adding a WhatsApp configuration
- Create a WhatsApp template
- Set up an Automation
- Testing an Automation using Postman
Adding an external source
Login to your engAIge account
Click Settings
Click Data Sources > View All
Click Add External Source
Complete the name and description fields
- No spaces allowed
Click Save
Add a WhatsApp configuration
Login to your engAIge account
Click Settings
Click WhatsApp
Complete fields
1 | Name | choose a name for the config |
2 | AppId | Can be found on the meta development portal |
3 | Token | permanent Meta access token |
4 | AccountId | WhatsApp Business Account ID also referred to as WABA |
5 | PhoneId | WhatsApp Number ID |
Example
Click Add Configuration
Create a WhatsApp template
Click Channels
Click WhatsApp
Click Create
Complete the fields as set out in the image below
1: Name
No Capitals or spaces allowed. Use underscores
2: Tag
Categorise templates using the Tag
3: Configuration
Dropdown, select configuration set up in settings4: Header Type
Dropdown, select TEXT or IMAGE5: Text
WhatsApp header for the message. This is not used when selecting IMAGE type6: Body
WhatsApp message. You may copy and paste emojis or choose an emoji from a list by clicking the windows key and full stop buttons on the keyboard. Rich text can be added by using * for bold or – for italics7: Add Variable (Header)
Adding a variable will add {{1}} in the space where the variable value will populate. The template will ask for a sample of the variable. The variable path will be added in the automation later. The header allows for 1 variable8: Add Variable (Body)
Adding a variable will add {{1}} in the space where the variable value will populate. More than one (with no end limit) can be added to the body. The 2nd variable will be labelled {{2}} and so on. The template will ask for a sample of the variable. The variable path will be added in the automation later.
Click Save
By clicking save the template will be sent via the Meta Cloud API to Meta for approval. Once Meta approves this template, it can be used in an automation
Set up an automation
Click on Automator in the top menu
Click on Add Workflow
Create a name for the workflow
Click Save
Workflow/Automation will open on saving
Adding your Trigger
Click Add Trigger
Click Details
Complete the details for the trigger
Name of Trigger: No spaces allowed
Source Type: External Source
Triggers: External Event Received
Source: Choose the source created earlier
Click Add
Clicking add on the trigger will close the details and allow you to add the leading action
Adding your Action
Choose the Send WhatsApp Action from the Action list shown on the left
Drag and drop this action into the automation being created
Click on the Send WhatsApp Action
Click Details
Complete the Action details
Name: One word name
Count this action: No longer using this form of reporting (will be removed from begininning of April 2024)
WhatsApp Configuration: Choose the configuration set up earlier
Msisdn: This is a JS expression. InputData.msisdn.ToString(). the word msisdn will be swapped out for the field name in the payload specific to your source
WhatsApp Template: Only templates created using this WhatsApp Config and in approved status can be chosen here. Choose the WhatsApp Template created earlier
Click Save
Adding your Transition
Connect point a to point b by clicking point a and dragging the line to point b. This will create a transition between the trigger and the action.
A pop-up window willbe displayed allowing you to choose the transition type
Condition: Setting a condition will have the WhatsApp send to the customer should a particular condition be met in the payload
Bookmark: Bookmark transitions allow a workflow to be paused at a certain point and then resumed later
Delay: This will allow a time/date delay between the trigger received and the WhatsApp being sent to the customer
Default: Once the trigger is received, the WhatsApp will be sent to the customer immediately
Click OK
Activating your Automation
Save your workflow/Automation
Activate your automation
Testing an Automation using Postman
Postman is an API parsing tool
Sign-up to Postman: https://www.postman.com/
Download the desktop app: https://www.postman.com/downloads/?utm_source=postman-home
Open Postman and sign-in
Click New
Click HTTP
Choose POST from this drop down
Add the following URL to the URL field:
PRODUCTION: https://marketicevent.webuildgreat.software/triggerexternalevent
TEST : https://marketicevent.webuildgreatsoftware.co.za/externalevent
Click on Params to add the following:
- externalSourceID
- eventID
We are going to go find out External Source and Event IDs in engAIge and come back to Postman to add the information
How to find the External Source ID and Event ID for your automation:
- Login to engAIge
- Click on Settings
- Click on View All under Data Sources
- Use the search functionality to find the external source
- Click on more
- Click on Analytics
- Click on Events
- Click on the automation name you are wanting to test
When you have the view as shown below, click in the URL bar on the browser.
Here you can find you externalSourceID and eventID
For example:
externalSourceID: 656731f17299530001e9bbad
eventID: 6677237d-2930-488e-9756-dc3bbba136af
Now you can add these to the parameters in your POST statement on Postman
Go back to Postman
Click on Body and ensure raw is selected
Add a payload like the example below.
{
"customerName": "Kira",
"emailAddress": "silversurfer@mailinator.com",
"msisdn": "0825633259",
"toEmail": "kira.francis@ignitiongroup.co.za",
"fromEmail": "info@ignitiongroup.co.za",
"sms":"kira SMS11231",
"head1":"Head1",
"body1":"body1",
"body2":"body2",
"body3":"body3",
"body4":"body4",
"date":"23-01-24",
"amount":"299"
}
The important part of this payload is the msisdn as this is where the test WhatsApp message will be sent.
Save the POST statement
Click Send
A 200 OK response will show and the number provided in the msisdn field will receive the test WhatsApp message
Author: Kira Francis