Skip to main content

Notifications

Copilot Studio - General
Answered

Retrieving information in Power Virtual Agents

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
    dieht27 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
    dieht27 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
    HenryJammes 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
    dieht27 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
    HenryJammes 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

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Getting Started…

Welcome to the Power Platform Community! We appreciate your visit…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 138,006

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,059

Leaderboard