Setting up the IVA for WhatsApp

Enable users to interact with Pega Intelligent Virtual Assistant (IVA) by using WhatsApp Messenger so that they can quickly and efficiently resolve their issues, request help, or report problems within your application. For example, when users request a car insurance quote in WhatsApp Messenger, the chatbot can respond by asking for more information and automatically opening an Insurance Quote business case in your application.

Before you begin: Perform the following tasks:
  • Create a new channel for IVA for Unified Messaging. For more information, see Creating a conversational channel.
  • Configure your Unified Messaging channel security settings. For more information, see Configuring Unified Messaging channel security.
  • Create a Facebook Manager business account on the Facebook portal to generate a Facebook Manager business account ID. For more information, see Get Started with Facebook Business Manager Guide on the Facebook website.
  • Create a Twilio account on the Twilio portal. For more information, see Get started with a free Twilio account on the Twilio website.
  • Upgrade the Twilio account to a paid account. For more information, see Upgrading to a paid Twilio account on the Twilio support website.
  • Set up a WhatsApp number for your Twilio account. For more information, see Adding a WhatsApp number to your Twilio account.

You use the integration manager on the Connection tab of the Unified Messaging channel to configure individual social channels in a Pega Platform application.

  1. In the header of Dev Studio, click the name of the application, and then click Channels and interfaces.
  2. In the Current channel interfaces section, click the icon that represents your existing Unified Messaging channel.
  3. In the Unified Messaging channel, click the Connection tab.
  4. Click Integration Manager.
  5. In the Manage Accounts Dashboard window, click the WhatsApp icon.
  6. On the Twilio WhatsApp Accounts page, click Add New Twilio WhatsApp Number.
  7. In the Add New Twilio WhatsApp Number window, in the Name field, enter a name for your WhatsApp account.
  8. In the Number field, enter a WhatsApp number, including the country code.
    For example: Enter: +12239992233
  9. In the Account SID field, enter the identifier for your Twilio account.
    Twilio generates a unique identifier when you create a Twilio account.
    For example: Enter: BA6d82c336e8d135edef20311c2287g8cd
  10. In the Auth Token field, enter the authorization token for your Twilio account.
    Twilio generates an authorization token when you create a Twilio account.
    For example: Enter: d2377c436100cd1edd0836cf5feab23d
  11. Click Submit.
    Result: The page displays your WhatsApp account information including its name, number, account SID, and account token.
  12. In the Webhook for Twilio WhatsApp section, select and copy the generated webhook URL for WhatsApp.
    For example: Copy the following URL to the clipboard: https://incoming.sample.pega.digital/twilio-whatsapp
  13. Define the webhook URL for the WhatsApp numbers in your Twilio account by performing the following steps:
    1. Log in to your Twilio account.
    2. Click the More icon, and then click Programmable SMS > WhatsApp > Senders.
    3. In the displayed list, select a WhatsApp number, and then click Configure.
    4. In the Twilio Senders for WhatsApp window, in the Senders Configuration section in the A Message Comes In field, paste the webhook URL that you copied in step 12.
      This action ensures that when your phone number receives inbound messages from WhatsApp Messenger, Twilio forwards the messages to the IVA channel.
      For example: Paste the following URL from the clipboard: https://incoming.sample.pega.digital/twilio-whatsapp
    5. To add additional WhatsApp numbers for your Twilio account to the webhook URL, repeat steps 13.c through 13.d.
    6. Click Close.
  14. Optional: To go back to the Manage Accounts Dashboard window and see all configured social messaging platforms, click the Home icon.
  15. Optional: To display a list of configured social messaging channels for the IVA for Unified Messaging, click Refresh, next to the Integration Manager button.
  16. Close the browser window, and then in the Unified Messaging channel, click Save.
What to do next: There are several considerations to keep in mind when using the IVA used for WhatsApp. For more information, see Best practices when using an IVA for WhatsApp.