Retrieving the image of a user through Microsoft graph api - microsoft-graph-api

I am trying to fetch the image of a user based on email id from microsoft graph API.
I am able to get the details of the logged in user using https://graph.microsoft.com/v1.0/me/photo/$value .
What i need is image of another user based on email id. Is there a way to accomplish this?
Ref: Microsoft Graph API Explorer

You can use the below api from the graph explorer to get the photo
Goto Graph explorer page
Microsoft Graph Explorer
Paste the below api with email id of the user
https://graph.microsoft.com/v1.0/users/<email id>/photo/$value
It will retrieve photo of the user.

Related

Give mailbox permissions from graph api

I am using the Graph API with app permission & with a certificate.
I know how to send emails with the sender which is different from the requestor's email.
I go to admin.exchange.com, select the user and add a mailbox delegation then add the user in "Send as".
My question is how to add user with "Send As" option via Graph API only.
I would like use this method microsoft permission: but from graph api
Thanks for your help
No this (and all the other Exchange Admin tasks) aren't currently in the Graph API, the only option for doing this programmatically is to use the Powershell cmdlets https://learn.microsoft.com/en-us/powershell/module/exchange/add-mailboxpermission?view=exchange-ps. The good news is that the v2 Powershell module does now support the client_credentials flow https://techcommunity.microsoft.com/t5/exchange-team-blog/modern-auth-and-unattended-scripts-in-exchange-online-powershell/ba-p/1497387

How to get the Department field from the Office profile using Microsoft Graph?

I'm trying to get the Department field from the Contact Information in the Office 365 profile using the Microsoft Graph API, but the data being returned doesn't match.
Screenshot of contact information in office.com
Screenshot of the query in the Graph Explorer
Example:
Office 365 user profile page: https://nam.delve.office.com/?u=d10110c2-5f89-40dc-8db2-323e35e24f73&v=editprofile
Microsoft Graph API query: https://graph.microsoft.com/v1.0/me/department
Microsoft Graph API query result:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('d10110c2-5f89-40dc-8db2-323e35e24f73')/department",
"value": "Clinical"
}
I logged into office.com and the Microsoft Graph Explorer using the same account, and all fields seems to match, except this particular field which doesn't.
Could anyone help me find out what am I missing there?
I am not able to repro this behavior. For me, a response from graph API matches the department name stated on the profile page(office.com)
Couple of things to check here -
Make sure you are logged in with correct account at both places.
If not, please share actual screen shot from both places. Also please share request timestamp and client id from graph call.
Hope this helps. Thanks!

Is there any way to identify user is a MailUser or normal Cloud user in M365 using graph api?

Is there any way to identify user is a MailUser or normal Cloud user in M365 using graph api?

Microsoft Graph API: Is there a way to get the user's acitivity feed of teams?

We want to get the number of acitivities for a user, which is also shown as badge in the teams app.
I didn't found any direct way. Does anyone found a way to achieve this indirectly?
There is no such way to get all the activity of an user in Teams.
You can look into Subscription Graph API. It allows a client app to receive change notifications about changes to data in Microsoft Graph. Currently, subscriptions are enabled for the following resources:
An alert from the Microsoft Graph Security API
A conversation in an Office 365 group
Content in the hierarchy of a root folder driveItem
in OneDrive for Business, or of a root folder or subfolder driveItem
in a user's personal OneDrive
A list under a SharePoint site
A message, event, or contact in Outlook
A user or group in Azure Active Directory
See Use the Microsoft Graph API to get change notifications for the possible resource path values for each supported resource.

How to get the externally shared user's profile information for one drive using Microsoft Graph api

To get External user information if we share the file with specific people through link.
You can use following end point for fetching external users in your AD:
https://graph.microsoft.com/beta/users?$filter=userType eq 'Guest'
make sure that you have to select beta version of microsoft graph for additional user properties.
If you just want to get the external user list, you can use "/users?$filter=userType eq 'Guest'" resolve your issue.
If you want to get the access log of share file through link:
No matter you use OneDrive or OneDrive for business, we cannot use Graph API to get the user who have access the share file through link.
If you share the Team site's document, we can use JSOM to get the user profile first and store it to the access log. Then use the get user api to get the external user info.
If you share the document from OneDrive/OneDrive for business, we cannot assign our custom access log and no known Graph API for this too. You can submit an feature request in the UserVoice, meanwhile, you can try to see the audit logging first.

Resources