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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / I want to query user c...
Copilot Studio
Unanswered

I want to query user conversations from conversation transcripts Dataverse table using session id or conversation id or logged-In user id..

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Team,

When user escalates, I want to transfer whole conversations of PVA bot to a live agent of another bot. 
I am able to query using "/Api/data/v9.2/conversation transcripts" API, but I want to query using either session id or user id or conversation id.

When I am passing "system Conversation Id" of PVA, no records are matching, Api is returning empty result. *
Also, passed logged user id, but there are no properties available for user id.

Is it possible to get session id or some unique id within current channel (Web or Teams), so that based on that unique id, I can fetch whole conversations for the current channel from conversation transcripts using "/Api/data/v9.2/conversation transcripts" REST API?

Thank 
you.

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

    Hi @Anonymous 

     

    I don't think this approach can work, as conversation transcripts in Dataverse are not available instantly but are created 20/30 minutes after the conversation has ended.

     

    When doing the hand off over the Direct Line API, the full conversation transcript and variable values are available as an attachement to the handoff activity.

     

    Henry

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Henry,
    Thank you so much for your quick response.
    I am able to generate bearer token using /v3/direct line/tokens/generate Api by passing web channel security secret key as authorization.
    In the next call, I am passing previously generated token to below v3/directline/conversations/{conversationid} Api.
    I am getting below error.

    Token not valid for this conversation

    AnnaMoyalan_0-1702919521540.png



    I didn't enable authentication for my bot. Can you please help me out with this?
    Thanks in advance.

  • HenryJammes Profile Picture
    Microsoft Employee on at

    It looks like you're using a GUID for the conversation ID, which isn't the correct format for a Direct Line Conversation ID.

    Have a look at these examples at how to interact with the API: https://powerusers.microsoft.com/t5/General/API-integration-witn-Power-Virtual-Agent-Chat-bot/m-p/2419823/highlight/true#M7010 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Henry,
    Thank you so much for the links. Appreciated. I understood how to query data using Direct Line API. 

    Is it possible to get conversation id for direct line API within PVA Bot?

    AnnaMoyalan_0-1702979923938.png


    If not, how to get conversation id for direct line Api? I won't be posting conversations using Direct Line API but I want retrieve PVA bot conversations using Direct Line APIs.

    Here is my requirement in detail:
    1) User comes to PVA bot, ask some questions and PVA bot will reply to them.
    2) If User ask for live agent help, I want to transfer conversations happened with PVA bot to third party live agent.
    3) To retrieve conversations, I am using Direct Line APIs to fetch those conversations and passing system variable conversation id value but using that I am not able to retrieve conversations.
    Still getting same error:

    {
        "error": {
            "code": "BadArgument",
            "message": "Token not valid for this conversation"
        }
    }



    Please help me out with this requirement. 

     

    Thank you.

     


  • TSunIslam Profile Picture
    2 on at

     Hello, i have a related query. I want to get the conversations (script) log of chatbot for security reasons. Now, i have seen options from TABLE & SESSION id, it gives conversation with all codes that i don't require. Is there any way to retrieve only those conservations or if can filter or while exporting data can add cleansing activities?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 297

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 184 Super User 2026 Season 1

#3
chiaraalina Profile Picture

chiaraalina 51 Super User 2026 Season 1

Last 30 days Overall leaderboard