
I need to display user Profile Photos in my Website . I have an App registration and added required API Permission for Microsoft Graph to get User Details from Azure AD.
I got user details and I want User Profile photo together.
Steps I had done:
Created a Token API and passed Client credentials in the body to get Bearer token.
Created one more API for getting Profile photo by passing User Email as query parameter and Bearer token in the Header as below:
https://graph.microsoft.com/v1.0/users?$filter=maileq'******@test.com'&$select=id,displayName,userPrincipalName,photo
I'm getting the below response ,It returns only displayName and userPrincipalName:
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,displayName,userPrincipalName,photo)",
"value": [
{
"id": "9679a553-f5fa-4ecf-893e-a6a23d9f46d7",
"displayName": "Test Employee",
"userPrincipalName": "******@test.com"
}
]
}