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 / Power Automate / Get user activity via ...
Power Automate
Answered

Get user activity via HTTP request.

(0) ShareShare
ReportReport
Posted on by 26

Hello all,

what should be the HTTP query to retrieve the login activity of a specific user?

ektoplasma24_0-1673366934865.png

 

My app is authorized in AAD as follows, 

ektoplasma24_1-1673367010508.png

 

 

The audit log is also enabled.

 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @ektoplasma24,


    Can you remove the curly brackets {} and try again?

  • ektoplasma24 Profile Picture
    26 on at

    @Expiscornovus 

    without the brackets I get the following error message, 

    ektoplasma24_0-1673370040095.png

     

  • Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @ektoplasma24,

     

    Apologies for the confusion. I forgot it is a beta method and the property is called signInActivity, not signIn:

    https://learn.microsoft.com/en-us/azure/active-directory/reports-monitoring/howto-manage-inactive-user-accounts#how-to-detect-inactive-user-accounts

     

     

    Try something like below:

     

    https://graph.microsoft.com/beta/users/youruserid/?$select=displayName,userPrincipalName,signInActivity

     

  • Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @ektoplasma24,

     

    And in case you are talking about audit logs signIns, you could use the below. I really need some coffee 😅

     

     

    https://graph.microsoft.com/v1.0/auditlogs/signIns?$filter=userId eq 'youruserid'

     

  • ektoplasma24 Profile Picture
    26 on at

    Hi, @Expiscornovus

    thanks for your help, I think there is not much left to solve this puzzle. 😄
    I got another error, I think that is because I was not registered as an app owner. - changed that now.
    Subsequently, I've triggered the workflow again unfortunately without success the error remains... 

    ektoplasma24_0-1673371178225.png

    URL is now, 

    https://graph.microsoft.com/beta/users/6da38f53-ff1d-445b-8a06-262cc******/?$select=displayName,userPrincipalName,signInActivity

     

    Error message, 

    {
     "error": {
     "code": "Authentication_MSGraphPermissionMissing",
     "message": "Calling principal does not have required MSGraph permissions AuditLog.Read.All",
     "innerError": {
     "date": "2023-01-10T17:13:05",
     "request-id": "bf8158c3-bee3-40d8-8941-f3456011a25d",
     "client-request-id": "bf8158c3-bee3-40d8-8941-f3456011a25d"
     }
     }
    }
  • ektoplasma24 Profile Picture
    26 on at

    @Expiscornovus 

    I've got the same error as in the last post. 

    I only would like to know when the user has logged in the last time..  seems to be difficult 😂

  • Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @ektoplasma24,

     

    There is a lot more to troubleshoot. For example, what type of authentication have you configured in the Authentication settings of the HTTP action?

     

    Since you were talking about an App, I assume you are using OAuth in the HTTP action configuration?

     

    Have you double checked you are using the correct client id, client secret, tenant id, etc.? 

     

    adappreg.png

     

     

     

  • ektoplasma24 Profile Picture
    26 on at

    @Expiscornovus 

    Tenant-ID and Client ID are correct - checked them twice 😅

    ektoplasma24_0-1673372187244.png

     

  • Verified answer
    Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @ektoplasma24,

     

    Just tested the signinActivity resource one. If it helps below is my setup and my test result. So, in theory it should work for you as well. Just need to find what is different in your setup.

     

    Below is my test setup.

     

    lastsignin02.png

     

    2. My test result

     

    lastsignin.png

  • ektoplasma24 Profile Picture
    26 on at

    @Expiscornovus 

    I've deleted the HTTP Action and set it up again, now it works.

    Thanks for your ambitions.❤️

    Now you have a new follower 😋

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard