none
API to get Office 365 User data (email, first name, last name) RRS feed

  • Question

  • I am new to azure and Microsoft graph. I want to query office 365 for users where I am not a member of the organization - via api secret, client id, tenant id, etc. I have managed to create a demo Azure account and do the following:

    Create application in Azure Active Directory
    Create Subscription/Get Subscription ID
    Get Tenant ID
    Get Client ID
    Get Client secret

    I am able to make API calls (via Java) to the graph /users endpoint and list the active directory users first name, last name and userPrincipalName (that looks like an email address??)

    Now I am wondering how build on this and for a demo office 365 account and add users (or copy my active directory users over) and query them.

    Thanks

    <style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #66e1f8} </style>
    Tuesday, January 28, 2020 3:15 AM

All replies

  • > userPrincipalName (that looks like an email address??)

    yes, in most cases userPrincipalName looks like email address. Although for external users it contains "EXT" substring

    The following part of the question I didn't understand:

    > Now I am wondering how build on this and for a demo office 365 account and add users (or copy my active directory users over) and query them.


    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - https://github.com/sadomovalex/camlex

    Wednesday, January 29, 2020 2:20 PM
  • Hi sadomovalex,

    My apologies for the unclear question, I am not familiar with this suite of products and will try again...

    As I stated,  I am able to query active directory users.  (using my free/development account)

    Ultimately I wish to query office 365 users.

    1) Do I do this using the same API as my azure/active directory solution? If so, what steps are needed to create a development office 365 account to test against? How do I associate the 365 account with my azure app?

    OR

    2) Is this a different use case altogether? Is the 365 API different from the graph API I had success with active directory.

    Thursday, January 30, 2020 10:46 PM