Fetching user details from Office 365

Risha 21 Reputation points
2022-03-10T08:41:49.197+00:00

Hi! I am building a web application project using MERN stack and I want to fetch user details (mainly user's email ids and their login details ) from Microsoft Office 365 into my Mongo DB Atlas database. I tried using several other methods but could not do so. Please help me with it.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,569 questions
0 comments No comments
{count} votes

Accepted answer
  1. Zehui Yao_MSFT 5,831 Reputation points
    2022-03-11T05:46:35.517+00:00

    Hello @Risha ,

    To fetch user details, you can refer to

    GET /users/{id | userPrincipalName}

    documentation: https://learn.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http

    For login details from Microsoft Office 365 or Outlook, you can refer to

    GET /reports/getOffice365ActivationsUserDetail

    documentation: https://learn.microsoft.com/en-us/graph/api/reportroot-getoffice365activationsuserdetail?view=graph-rest-1.0

    GET /reports/getOffice365ActiveUserDetail(period='{period_value}')
    GET /reports/getOffice365ActiveUserDetail(date={date_value})

    documentation: https://learn.microsoft.com/en-us/graph/api/reportroot-getoffice365activeuserdetail?view=graph-rest-1.0

    GET /reports/getEmailActivityUserDetail(period='{period_value}')
    GET /reports/getEmailActivityUserDetail(date={date_value})

    documentation: https://learn.microsoft.com/en-us/graph/api/reportroot-getemailactivityuserdetail?view=graph-rest-1.0

    GET /reports/getEmailAppUsageUserDetail(period='{period_value}')
    GET /reports/getEmailAppUsageUserDetail(date={date_value})

    documentation: https://learn.microsoft.com/en-us/graph/api/reportroot-getemailappusageuserdetail?view=graph-rest-1.0

    GET /reports/getMailboxUsageDetail(period='{period_value}')

    documentation: https://learn.microsoft.com/en-us/graph/api/reportroot-getmailboxusagedetail?view=graph-rest-1.0


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful