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
Outlook
A family of Microsoft email and calendar products.
3,915 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,139 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Rohit Raghuwanshi - MSFT 550 Reputation points Microsoft Vendor
    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/rohit@3b8zzq.onmicrosoft.com/mailFolders/<mailFolderId>/childFolders
    https://graph.microsoft.com/v1.0/users/rohit@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 106.8K Reputation points MVP
    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.

    0 comments No comments

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.