Reputation: 725
I have registered app in Azure. I https://graph.microsoft.com/v1.0/users
to get userinfo.
Is there any option to get all info about user? And see what data can I get in JSON reponse?
Now when I use https://graph.microsoft.com/v1.0/users I get only couple information like:
{
"aio": "kjaldjsfhkjsadhflkdhsafkjadhsfa",
"amr": "[\"pwd\"]",
"family_name": "Picasso",
"given_name": "Pablo",
"ipaddr": "11.12.113.144",
"name": "Pablo Picasso",
"oid": "234234-2343-4343-43434-2342342",
"onprem_sid": "234234234-23-423-4-234-2-34-234",
"sub": "234233q45rtferfwverfwgw45grfg45g45",
"tid": "sdfkjgasdhjfgasjdhfgashjdfgasdhjf",
"unique_name": "[email protected]",
"upn": "[email protected]",
"uti": "kajshdfkljahsdfkjahsdkjfahsd",
"ver": "1.0"
}
Actually I'm looking for username. We can login to Windows using shortcut or email. So if user name is Pablo Picasso user can login with username PaPi. And I'm looking for that.
Upvotes: 0
Views: 335
Reputation: 725
Thanks Md Farid Uddin Kiron
My workaround with all fields (without mailboxSettings
because get error 403 access denied)
https://graph.microsoft.com/v1.0/me?$select=aboutMe,accountEnabled,ageGroup,assignedLicenses,assignedPlans,birthday,businessPhones,city,companyName,consentProvidedForMinor,country,createdDateTime,creationType,deletedDateTime,department,displayName,employeeId,faxNumber,givenName,hireDate,id,identities,imAddresses,mailNickname,mobilePhone,mySite,officeLocation,onPremisesDistinguishedName,onPremisesDomainName,onPremisesExtensionAttributes,onPremisesImmutableId,onPremisesLastSyncDateTime,onPremisesProvisioningErrors,onPremisesSamAccountName,onPremisesSecurityIdentifier,onPremisesSyncEnabled,onPremisesUserPrincipalName,otherMails,passwordPolicies,passwordProfile,pastProjects,postalCode,preferredDataLocation,preferredLanguage,preferredName,provisionedPlans,proxyAddresses,refreshTokensValidFromDateTime,responsibilities,schools,showInAddressList,skills,signInSessionsValidFromDateTime,state,streetAddress,surname,usageLocation,userPrincipalName,userType,interests,isResourceAccount,jobTitle,lastPasswordChangeDateTime,legalAgeGroupClassification,licenseAssignmentStates,mail
Upvotes: 0
Reputation: 22457
Considering, you already know how to get token. Now see below example
If you want to fetch employeeId
or identities
or officeLocation
using Microsoft Graph API
.
try following way:
Request:
https://graph.microsoft.com/v1.0/users?$select=employeeId ,identities ,officeLocation
Response:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(employeeId,identities,officeLocation)",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/users?$select=employeeId+%2cidentities+%2cofficeLocation&$skiptoken=X%27445370740",
"value": [
{
"employeeId": 0200010000001C3A54696E614068616E,
"officeLocation": Redmond, Usa,
"identities": [
{
"signInType": "userPrincipalName",
"issuer": "someEmail.onmicrosoft.com",
"issuerAssignedId": "tenant.onmicrosoft.com"
}
]
}
}
See the screen shot below:
Please refer to Official document if you need more details.
Upvotes: 2