I am working with a Power Virtual Agent (PVA) chatbot which I’ve set up using the PVA UI without any code. My goal is to allow users to interact with this bot via Twilio SMS, i.e., they send a text to the bot, and the bot responds in the same session and can have a contextual conversation because their are deep seeded questions involved in some QnA flows.
DirectLine Token with Twilio: I noticed that there’s a way to integrate Twilio using a DirectLine token. I suspect this requires setting up the bot programmatically (e.g., with nodejs). I’d like to see if there’s a no-code way to achieve this?
I’ve also connected this PVA bot to Azure Bot and Azure Insights Integration: I’ve connected the PVA chatbot to an Azure Bot and have set it up with Azure Insights for metrics. Within the Azure Bot, there’s a ‘Channels’ section where I see an option to connect to platforms like Twilio. I’ve successfully connected Twilio as a channel and I’ve attempted messaging the bot but it seems it’s not linking up with my PVA bot via message endpoints. I’ve also tried several webhook url’s on Twilio’s end as well (‘When a message comes in’).
My hope is that someone has connected their PVA bot to Twilio SMS whether that involves Azure Bot or another means.
2
Answers
To connect your Power Virtual Agent (PVA) chatbot to Twilio SMS without writing code, you can follow these steps:
Create a Twilio account: If you haven’t already, sign up for a Twilio account at https://www.twilio.com/ and get your account credentials ready.
Set up a Twilio SMS channel in PVA: In the PVA portal, go to the "Channels" section and click on "Add a channel." Select "Twilio SMS" as the channel type.
Configure the Twilio SMS channel: Provide the necessary details, such as your Twilio account SID, auth token, and phone number. Follow the instructions in the PVA portal to complete the setup.
Verify and test the connection: Once the Twilio SMS channel is set up, verify that the connection is working correctly. You can test it by sending a text message to the Twilio phone number you configured in PVA. The bot should respond to your text message.
Regarding the integration of Azure Bot and Azure Insights with PVA, it’s important to note that PVA is a separate service from Azure Bot Service. While PVA offers integration options with Azure Bot Service, the configuration and settings might differ. Make sure you are setting up the channels and connections within the PVA portal specifically.
If you encounter issues with the connection between Twilio and your PVA bot, double-check the webhook URL and ensure that it is correctly configured in the Twilio settings.
You may also need to verify that the message endpoints are correctly set up in PVA to receive incoming messages from Twilio.
If you continue to experience difficulties with the integration, I recommend reaching out to the official Microsoft Power Virtual Agents support or consulting the PVA documentation for more specific guidance on connecting Twilio SMS to your PVA bot.
Did you follow these steps for connecting a PVA bot to an Azure Bot Service instance, Add Power Virtual Agents bot to Azure Bot Service channels?
I won’t rehash all the steps listed in the doc. In short, you need to get the token endpoint from the Twilio Channel in your PVA bot’s Settings/Channels blade. The token generated from this endpoint is used for connecting your PVA bot via DirectLine to this associated ABS Twilio channel. Additionally, there is necessary code that needs to be included for managing the various client connections and conversations.
Also, be sure you have published your bot in PVA. 😉