Skip to main content
Community site session details

Community site session details

Session Id : aEa4C7wL6oQxpNsa2pRBgg
Copilot Studio - General
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 14 Dec 2023 13:30:19 by

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:
  • TSunIslam Profile Picture
    2 on 12 Mar 2024 at 02:19:44
    Re: I want to query user conversations from conversation transcripts Dataverse table using session id or conversation id or logged-In user id..

     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?

  • Community Power Platform Member Profile Picture
    on 19 Dec 2023 at 10:10:05
    Re: I want to query user conversations from conversation transcripts Dataverse table using session id or conversation id or logged-In user id..

    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.

     


  • HenryJammes Profile Picture
    on 18 Dec 2023 at 17:54:35
    Re: I want to query user conversations from conversation transcripts Dataverse table using session id or conversation id or logged-In user id..

    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
    on 18 Dec 2023 at 17:23:27
    Re: I want to query user conversations from conversation transcripts Dataverse table using session id or conversation id or logged-In user id..

    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
    on 14 Dec 2023 at 14:43:30
    Re: I want to query user conversations from conversation transcripts Dataverse table using session id or conversation id or logged-In user id..

    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

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 169 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 150

#3
sandeep_angara Profile Picture

sandeep_angara 75 Super User 2025 Season 2