Skip to main content

Notifications

Calling Actions from Copilot Studio
Answered

Retrieve User Details in Virtual agent using flows

Posted on by 13

Hi Everyone,

 

I am trying to get user details using graph APIs "https://graph.microsoft.com/v1.0/me" in power automate. However, when I try to do so I am getting this error:

{
  "error": {
    "code""InvalidAuthenticationToken",
    "message""Access token validation failure. Invalid audience.",
    "innerError": {
      "date""2020-06-30T11:09:37",
      "request-id""<GUID>"
    }
  }
}

 Retrieve logged in user Token using Virtual agentRetrieve logged in user Token using Virtual agent

 

Error while getting details in flowError while getting details in flow

 

Permissions in App registrationPermissions in App registration

 

Any help would be appreciated. 

  • renatoromao Profile Picture
    renatoromao 6,762 on at
    Re: Retrieve User Details in Virtual agent using flows

    Congrats @Ramandeep_Singh ! 🙂

     

    Keeping doing a lot of things with Power Virtual Agents!

  • Verified answer
    Ramandeep_Singh Profile Picture
    Ramandeep_Singh 13 on at
    Re: Retrieve User Details in Virtual agent using flows

    Hi all,

    I was able to resolve the issues and it might help others while facing the same issue.
    The issue was that I am using "https://graph.microsoft.com/v1.0/me" API and in virtual agent authentication "Scope" I was not using the correct URL.
    Following is the screenshot when using graph APIs:


    Auth Virtual agent.PNG

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Thanks and keep helping each other.

  • Ramandeep_Singh Profile Picture
    Ramandeep_Singh 13 on at
    Re: Retrieve User Details in Virtual agent using flows

    Hi @renatoromao ,

     

    Thanks for the quick replay. Following are screenshot you asked for:

    VA.PNG

     

    AAD.PNG

     

    Automate.PNG

     

    I am using an trial instance for this.

  • renatoromao Profile Picture
    renatoromao 6,762 on at
    Re: Retrieve User Details in Virtual agent using flows

    Hi @Ramandeep_Singh ,

     

    Can you take some pictures inside your Http request method inside Power Automate, please? (edit mode to see the code)

    Can you confirm which variable do you are sending to Power automate like parameter?

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

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

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 137,998

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,059

Leaderboard

Featured topics