techexchange-WhatsApp Integration With ODA
techexchange-WhatsApp Integration With ODA
Introduction 3
Sandbox Setup 3
Create Webhook Channel in Oracle Digital Assistant 6
Setup the Webhook 9
Sandbox Setup
Sandbox is for testing. It is easy to use. You need to have an app created in Meta for Developers my apps. Here
are the steps to create a new app if not already created.
1. Go to Meta for Developers. If you are visiting for the first time, you will see get started button. Click on
"Get Started". Else, go to step 2.
3. Click on create app and choose "Business" as app type and click on next.
7. Now create a meta business account by selecting "Create a business account" and click on continue.
8. Now you will see the get started page where you can see the temporary access token. Copy this token.
9. Here a temporary phone number(phone number id) is generated for testing purpose. Copy this
temporary phone number id.
12. Now click on test button, for testing and getting the messages on the "Phone Number" mentioned in the
sandbox page. Test the flow with the API which is given and see how messages are flowing from test
number to the recipient number.
13. After testing, you can add a phone number and verify it using a code which WhatsApp sends. This is
actual business number which you want to use for messaging your customer. This number will get added
to the from number on the get started page.
14. Check the API version from the configuration section from the left panel in the setting->advanced tab as
shown below. You will need to enter it on the webhook at the time of integration.
1. Open Oracle Digital Assistant and open the Channels option under Development Tab
2. Press Add Channel Button and name it to as ODA_WhatsApp and a dummy Outgoing Webhook URI as
https://www.oracle.com (temporarily until I host my webhook app somewhere) as shown in the image
below.
5. Scroll down to find the Secret key and Webhook URL . Copy both the values as we will need these in our
webhook code.
6. Now open the webhook folder which I have provided and go to index.js file. Here you need to change the
url and secret with the above copied Webhook URL and secret key of yours in line number 21 and 22.
7. Now you need to host your code and expose it through a server. You can host it via ngrok, Heroku, render
or any such providers as well.
8. After the app is hosted, we need to make sure to pass the environment variables to the server. I have
created two environment variables MYTOKEN, TOKEN which needs to be passed.
MYTOKEN can be any text such as my name as well which we need to enter same in Webhook config
page of WhatsApp as well . Whatever MYTOKEN value I enter here needs to be entered in verify token as
well as shown below.
TOKEN can be obtained from getting started tab as shown below. It’s the temporary access token. You
can also apply for a permanent token from facebook for your app
10. Once you get this message means that your webhook is up and running. Copy the webhook host url and
append it with /webhook for whats app and /bot/message for ODA
11. Change the Outgoing Webhook URI from https://www.oracle.com to the above url
You will need to create a webhook entry for getting messages from Oracle Digital Assistant.
Please take the node app which I have created and do make the following changes into that
Subscribe to "messages" for sure. You can select others as well as I have done below
Once you have given the permission it will show as “subscribe” as shown in the screen shot below.