Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - General
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.

  • dieht27 Profile Picture
    12 on at
    Re: Retrieving information in Power Virtual Agents

    Update: via python http requests methods and some json treatment i got it.

  • dieht27 Profile Picture
    12 on at
    Re: Retrieving information in Power Virtual Agents

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

  • HenryJammes Profile Picture
    on at
    Re: Retrieving information in Power Virtual Agents

    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
    Re: Retrieving information in Power Virtual Agents

    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.

  • Verified answer
    HenryJammes Profile Picture
    on at
    Re: Retrieving information in Power Virtual Agents

    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

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Copilot Studio

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 132

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 81 Super User 2025 Season 1

#3
Pablo Roldan Profile Picture

Pablo Roldan 61