I am trying to fetch Spam mail present in my mailbox via Microsoft Graph API. But I can't find any related documents on how to achieve that.
From this link https://learn.microsoft.com/en-us/graph/api/user-list-messages, I am able to retrieve all messages present in my inbox. But is there any way to fetch only particular folder messages like Spam, Trash etc...
Does anyone have any idea on how to achieve the above scenario? If yes, can someone help me out.
As mentioned in the doc to get messages in a specific folder in the user's mailbox you can call these endpoints:
Instead of mail folder id you can use well-known folder name