Create a conversational voicebot utilizing WhatsApp and Watson providers – IBM Developer

Note: This code sample makes use of the traditional Watson Assistant expertise. After October 8, 2021, all cases (besides the usual plan) can change between the traditional and new Watson Assistant experiences by going to the upper-right nook of the Watson Assistant display and clicking the Manage icon.

Manage icon


In this code sample, construct a framework that lets customers ship voice queries utilizing the WhatsApp software and get a response from IBM Watson Assistant. The question from the consumer is distributed to the Watson Speech to Text Service by a customized software. The output from the Watson Speech to Text Service is then fed to Watson Assistant. Watson Assistant responds again to the consumer with an acceptable reply.


Conversational AI voicebots are serving to companies automate repetitive and time-consuming queries. This offers your workforce extra time to deal with extra complicated, excessive precedence strategic duties, whereas nonetheless making certain that the purchasers are engaged. Voicebots absorb voice enter and might ingest, analyze, interpret, and reply to buyer inquiries, with the purpose with the ability to reply a buyer’s query in actual time or with the ability to proceed a textual content alternate with the client to make clear the query.

A voicebot is beneficial in lots of eventualities the place typing isn’t a handy possibility, reminiscent of:

  • Elderly clients who discover it extra handy to talk than to kind. Some clients have higher spoken language expertise than written language expertise. They discover it simpler to make use of voicebots.
  • Delivery executives on the transfer with a have to replace techniques.

This code sample makes use of the state of affairs of a buyer talking Brazilian Portuguese by the WhatsApp software to work together with a buyer care middle. A framework is constructed that lets the client ship queries utilizing speech on WhatsApp, after which get a response from Watson Assistant. The consumer’s question is distributed to the Watson Speech to Text Service by a customized software. The output from the Watson Speech to Text Service is then fed into Watson Assistant. Watson Assistant understands the question with the assistance of the built-in help for Brazilian Portuguese and responds again to the consumer with an acceptable reply. This code sample could be configured to help a number of languages. Watson Assistant helps these languages.

When you will have accomplished this code sample, you perceive find out how to:

  • Use the Watson Speech to Text Service
  • Use the Watson Assistant Service
  • Integrate WhatsApp with Watson Services
  • Handle queries despatched over voice on WhatsApp

Flow diagram


  1. The consumer sends a voice or textual content message within the WhatsApp software.
  2. The message is redirected to the Twilio Programmable Messaging service.
  3. Twilio redirects the message to the voicebot software that’s deployed on IBM Cloud or Red Hat OpenShift.
  4. If the consumer despatched a voice message, the voicebot software makes use of the Watson Speech to Text Service to transcribe the message into textual content.
  5. The textual content message is distributed to Watson Assistant.
  6. The Watson Assistant chatbot detects the intent and replies with a response.
  7. The Twilio Programmable Messaging service redirects the response message to WhatsApp.
  8. The consumer is ready to view the response message on WhatsApp.


Find the detailed steps within the README file. Those steps clarify find out how to:

  1. Clone the repository.
  2. Create the Watson Services.
  3. Create the Twilio Service.
  4. Build and deploy the voicebot software.
  5. Try out the voicebot software on WhatsApp.