outlookoffice365office365api

Outlook Office 365 - Get full profile detail


I've been using the outlook office 365 contacts API to fetch the user and its contacts/people as well, now the office 365 /me api is not returning the complete information for the user itself

I've been using this contacts api for fetching the contacts and the users itself data, and the request i'm using to get the user data is "https://outlook.office.com/api/v2.0/me", but its not sending back the complete profile information i.e. title and other relevant information.

Right now office 365 is returning following data

{
  "@odata.context": "https://outlook.office.com/api/v2.0/$metadata#Me",
  "@odata.id": "https://outlook.office.com/api/v2.0/Users('ecfb4693-d8ae-4383-87e3-ed70bba03acb@5a706ba8-2446-4b3d-af67-e485daeb8296')",
  "Id": "ecfb4693-d8ae-4383-87e3-ed70bba03acb@5a706ba8-2446-4b3d-af67-e485daeb8296",
  "EmailAddress": "ahsanmster@allinalldeveloper.onmicrosoft.com",
  "DisplayName": "Ahsan Hussain",
  "Alias": "ahsanmster",
  "MailboxGuid": "3ba1bd6c-f508-4bd9-a4ba-2b7e51fac5c4"
}

and I'm generating Auth2.0 Bearer token using following links

Auth Url: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Access Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token
Client ID: ****
Client Secret: ***
Scope: https://outlook.office.com/contacts.readwrite
Grant Type: Authorization Code

Please guide me how do i need to fetch the complete information for the user itself.

Thanks


Solution

  • The Outlook APIs will always give you a small amount of data about the user, but they will not give you full Active Directory details. For that, you should use the Microsoft Graph.