Graph API to read archived mails

Samal, Subhashree 0 Reputation points
2024-10-17T12:04:35.89+00:00

Hi All,

My requirement is to read archived outlook Emails by Graph API but unfortunately I am not able to achieve it.Please let me know what can I do to achieve this.

I have tried:

1.

https://graph.microsoft.com/v1.0/users/{user-id}/mailFolders/ArchiveMsgFolderRoot/childFolders

User's image

Not able to see what extra authorization needed.

Outlook Windows Classic Outlook for Windows For business
Microsoft Security Microsoft Graph
{count} votes

2 answers

Sort by: Most helpful
  1. Rohit Raghuwanshi - MSFT 625 Reputation points Microsoft External Staff
    2024-10-17T13:43:50.3766667+00:00

    Hi Samal, Subhashree,

    I tried to replicate the scenario and the error you are facing is because you are using malformed API URL to access mailFolder's subFolders. Please ensure to below endpoint to access user's specific mail folders messages or subfolders

    https://graph.microsoft.com/v1.0/users/******@3b8zzq.onmicrosoft.com/mailFolders/<mailFolderId>/childFolders
    https://graph.microsoft.com/v1.0/users/******@3b8zzq.onmicrosoft.com/mailFolders/<mailFolderId>/messages

    Please make sure you replace <mailFolderId> with Id of folder you want to access. Also ensure you provide Mail.ReadBasic application permission to access another user's mailbox.

    User's image

    For more details, please refer List Messgaes

    I hope this helps!
    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment

    0 comments No comments

  2. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2024-10-17T16:14:16.48+00:00

    You cannot use the Graph API to access content of the Online archive, this is not a supported scenario. If you need programmatic access, use EWS instead.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.