Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Bot Integration with Whatsapp [closed]

I am trying to integrate Microsoft Bot Framework with WhatsApp.

I already have existing bots (skype and webchat) that talk to the bot service and was trying to create a new channel for communication.

How can I construct this new channel?

I already have APIs in place that can send an receive messages from WhatsApp, I plan to hook my bot service when I receive a message from a user, but I can't figure out how to use my bot service as it accepts an a class Activity.

like image 952
user1393503 Avatar asked Aug 31 '18 11:08

user1393503


4 Answers

There are a two possibilities to connect a bot to additional channels, using a custom adapter and using the DirectLine API.

My preference would be to use an adapter, since you will have a direct connection to the WhatsApp service which offers a lot of flexibility. However in some scenarios you could benefit from using a proxy service connected to the Direct Line.

In the end, you could use any provider you like, as long as they offer an API. For example providers like Twilio, RingCentral, InfoBip, LivePerson.

My recommended approach: Custom Adapter

  • Bot has a direct connection to the WhatsApp service, using an extra endpoint in the bot
  • Well written adapters transform all Bot Framework SDK activities to the WhatsApp service, and vice versa. (example).
  • Multiple adapters could be used with the same bot project
  • Adapters could offer specific helper functions for the channel, callable from your bot project. (example)

Currently the following adapters for WhatsApp are available in the BotBuilderCommunity.

  • Twilio WhatsApp adapter (Javascript)
  • RingCentral (WhatsApp) adapter (C#)

Examples of how to build a custom adapter can be found on the BotBuilderCommunity. (C#, Javascript)


Alternative approach: Proxy service connected to DirectLine

  • DirectLine API communicates via a self-hosted proxy service to the WhatsApp service
  • Proxy service could be used for C#/NodeJS/Python bots, not language specific
  • Well written proxy services transform all Bot Framework SDK activities to the WhatsApp service, and vice versa.

Example of how to build a proxy service can be found here: C#, Javascript.

like image 116
Mick Avatar answered Jan 18 '23 16:01

Mick


You can try using the Direct Line as stated in the documentation!

You can enable your own client application to communicate with your bot by using the Direct Line channel.

like image 32
Ali Heikal Avatar answered Jan 18 '23 14:01

Ali Heikal


You can try using the Twilio Channel & then using the Twilio API for WhatsApp

like image 20
The Memebot Avatar answered Jan 18 '23 16:01

The Memebot


I used direct line channel. A relay application needs to be built to interface between whatsapp and microsoft directline.

like image 33
Mahesha Avatar answered Jan 18 '23 15:01

Mahesha