0% found this document useful (0 votes)
50 views11 pages

techexchange-WhatsApp Integration With ODA

The document describes how to integrate Oracle Digital Assistant with WhatsApp by setting up a WhatsApp sandbox, creating a webhook channel in Oracle Digital Assistant, and setting up the webhook. Key steps include creating a WhatsApp business account, copying tokens, setting webhook URLs, and configuring permissions.

Uploaded by

shubhank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views11 pages

techexchange-WhatsApp Integration With ODA

The document describes how to integrate Oracle Digital Assistant with WhatsApp by setting up a WhatsApp sandbox, creating a webhook channel in Oracle Digital Assistant, and setting up the webhook. Key steps include creating a WhatsApp business account, copying tokens, setting webhook URLs, and configuring permissions.

Uploaded by

shubhank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

TECHEXCHANGE

Integrating Oracle Digital


Assistant with WhatsApp
article by Anshuman Panda, March 2023

1 Oracle Digital Assistant TechExchange - Article


Copyright © 2023, Oracle and/or its affiliates
Table of contents

Introduction 3
Sandbox Setup 3
Create Webhook Channel in Oracle Digital Assistant 6
Setup the Webhook 9

2 Oracle Digital Assistant TechExchange - Article


Copyright © 2023, Oracle and/or its affiliates
Introduction
WhatsApp Cloud API allows businesses to send and receive messages using cloud hosted version of its WhatsApp
Business API. By offering free, secure, and cloud-based hosting, businesses can scale their customer
communication and reduce the go-live time.

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.

2. Navigate to MyApps buttons on the top right corner.

3. Click on create app and choose "Business" as app type and click on next.

4. Enter the display name for the app.

3 Oracle Digital Assistant TechExchange - Article


Copyright © 2023, Oracle and/or its affiliates
5. If you have business account, then select it or leave it as it is and click on submit button.

6. Scroll down on the page and select WhatsApp for setup.

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.

10. Copy the WhatsApp Business Account Id

4 Oracle Digital Assistant TechExchange - Article


Copyright © 2023, Oracle and/or its affiliates
11. Add a recipient (To) phone number and verify it with the code which WhatsApp will send on the
number. Update the same number at the time of WhatsApp Cloud API Integration with ODA

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.

5 Oracle Digital Assistant TechExchange - Article


Copyright © 2023, Oracle and/or its affiliates
Create Webhook Channel in Oracle Digital Assistant

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.

3. Now the channel is created.

6 Oracle Digital Assistant TechExchange - Article


Copyright © 2023, Oracle and/or its affiliates
4. Assign a skill and enable the channel

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 Oracle Digital Assistant TechExchange - Article


Copyright © 2023, Oracle and/or its affiliates
// add webhook integration to Oracle Cloud
const webhook = new WebhookClient({
channel: {
url: YOUR ODA WEBHOOK CHANNEL WEBHOOK URL,
secret: 'YOUR SECRET KEY'
}
});

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

8 Oracle Digital Assistant TechExchange - Article


Copyright © 2023, Oracle and/or its affiliates
9. Once the environment variables are set then host your web server and if your hit the webserver url in
your browser then you will get the below message

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

Outgoing Webhook URI in ODA : https://*********.*************/bot/message


Callback URL In WhatsAPP : https://*********.*************/webhook

11. Change the Outgoing Webhook URI from https://www.oracle.com to the above url

Setup the WhatsApp Webhook

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

Enter the URL: https://anshwhatsapp.*************/webhook


Verify Token: ******************. (As entered in your webhook environment variable MYTOKEN )

9 Oracle Digital Assistant TechExchange - Article


Copyright © 2023, Oracle and/or its affiliates
Once you have saved the webhook, click on manage and give the messaging permissions shown in the below
given screen shot

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.

10 Oracle Digital Assistant TechExchange - Article


Copyright © 2023, Oracle and/or its affiliates
Once we are done with the above steps, we are ready to try out from WhatsApp.

11 Oracle Digital Assistant TechExchange - Article


Copyright © 2023, Oracle and/or its affiliates

You might also like