web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Retrieving information...
Copilot Studio
Answered

Retrieving information in Power Virtual Agents

(0) ShareShare
ReportReport
Posted on by 12

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.

Categories:
I have the same question (0)
  • Verified answer
    HenryJammes Profile Picture
    on at

    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:

     

    HenryJammes_0-1679401346560.png

     

    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

  • dieht27 Profile Picture
    12 on at

    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.

  • HenryJammes Profile Picture
    on at

    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

  • dieht27 Profile Picture
    12 on at

    It was just an idea, upload a excel file with test topics and get bot answers via python while I run testing.

  • dieht27 Profile Picture
    12 on at

    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.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 251 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 201 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard