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.
Update: via python http requests methods and some json treatment i got it.
It was just an idea, upload a excel file with test topics and get bot answers via python while I run testing.
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
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.
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
Romain The Low-Code...
132
Michael E. Gernaey
81
Super User 2025 Season 1
Pablo Roldan
61