Microsoft Graph API support for outlook.com

Ward Horsfall 101 Reputation points
2022-06-24T04:17:21.533+00:00

Hi

Only because I have been asked - so be surprised if yes.

Anyway can Microsoft graph be used to search and work with an outlook.com email address.

Eg I can use the graph api to read an users outlook.com mail messages like fred@harsh.com .com

If yes if you could provide some more details on how to configure

Thanks
Ward

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,965 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shivam Dhiman 5,866 Reputation points
    2022-06-24T18:22:39.227+00:00

    Hi @Ward Horsfall

    To address your issue I have configured this by using outlook account as a Guest user in my tenant. You can invite user as a Guest user in your tenant and he can get all his messages using GET https://graph.microsoft.com/v1.0/me/messages Graph API endpoint(Please give all the required permissions before running this API). For more details please refer to this documentation. If you want to get messages from a particular user you can use https://graph.microsoft.com/v1.0/me/messages?$filter=from/emailAddress/address eq 'shivam@******.onmicrosoft.com'
    214815-listmails2.png.

    You cannot use GET /users/{id | userPrincipalName}/messages as it will give you "Resource could not be discovered." error for guest users.

    Hope this helps,

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".

    1 person found this answer helpful.