Microsoft Graph API support for outlook.com

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

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 Mail API
Microsoft Graph Mail API
A Microsoft API that supports accessing data in users' primary mailboxes and in shared mailboxes.
676 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. answered 2022-06-24T18:22:39.227+00:00
    Shivam Dhiman-MSFT 4,321 Reputation points Microsoft Employee

    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".