Notifications
Announcements
Hi everyone!
In PVA, I would like to know if I can use some python/Js methods like 'post' or 'get' to get chatbot answers for doing some automated testing. Do you know if it is possible (and/or) how?
Thank you.
Hi @dieht27,
This is possible using the Direct Line API.
You first need to generate a token (Direct Line Authentication in Azure Bot Service - Bot Service | Microsoft Learn).
You can get the Token Endpoint for a PVA bot here: Add a chatbot to mobile and web apps - Power Virtual Agents | Microsoft Learn.
You can then do a POST to the Direct Line API to start a conversation or send an activity to the bot:
And a GET to receive activities:
By the way, for automated testing, we're soon going to release code samples on how to achieve this in a console app and as part of CI/CD pipeline.
Henry
Thank you for your response, I solved the issues.
However, I want to go a bit further now, I want to upload an excel or csv file. Do you know what should I type in 'Content-Type' and 'Content-Disposition' fields? Also, do I need to add/fill any other field?
Thank you for your help.
I'm not sure.
File uploads are supported for PVA with the Dynamics 365 Omnichannel for Customer Service integration (Configure file attachment capability for a chat widget | Microsoft Learn), but I'm not sure how to handle these over the Direct Line API in PVA standalone (it looks possible on the Bot Framework side though: API reference - Direct Line API 3.0 - Bot Service | Microsoft Learn.
As PVA standalone doesn't support attachments natively, I'm curious as to where this would be uploaded?
@Jameslew_MSFT FYI
It was just an idea, upload a excel file with test topics and get bot answers via python while I run testing.
Update: via python http requests methods and some json treatment i got it.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 251 Super User 2025 Season 2
Romain The Low-Code... 201 Super User 2025 Season 2
S-Venkadesh 93 Moderator