Thanks for using Microsoft Q&A !!
The error you are seeing is because of the change mentioned in devblogs notification according to which
accessing delegator's mailbox items using api/v2.0/me/messages/{message-id}
is no longer supported. Please find below the notification snippet -
Additionally, it was recommended to use Microsoft Graph API Mail endpoints to access Outlook items in an archive mailbox, or items belonging to another user in a delegated or shared mailbox.
Please find below steps which you can follow to Mark the Email as Read and then Move the message to Archive Folder -
- Create an HTTP with Azure AD Connection by using the Base url as
https://graph.microsoft.com
- Once you click on Sign In, you will be asked to provide credentials to connect and after successful connection you should be able to use the Microsoft Graph REST API endpoints.
- Please use the Microsoft Graph Endpoint to Update Message as Read Only-
https://graph.microsoft.com/v1.0/users/sharedmailbox@test.onmicrosoft.com/messages/{MessageId}
In this call you need to do PATCH by passing the IsRead to true in Request Body as below.
{
"isRead": "true"
}
Please refer to Request body section to know the properties which can be updated through the endpoint.
So, your logic app step will look like below -
- Then you can use the Move endpoint to move the previously read email to archive folder
https://graph.microsoft.com/v1.0/users/sharedmailbox@test.onmicrosoft.com/messages/{messageid}/move
In this call you need to do a POST by passing the Destination folder name in Request Body as below.
{
"destinationId": "archive"
}
Please refer to this page to know the folder names which you can use.
Logic app step will look like below -
Please find below screenshot with all the steps-
I have tested this and it works as expected. Please let me know if you have any other questions.
Thanks
Saurabh
Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.