Hello Mayank Gupta, first retrieve the email message to get its ID. You can use the "list messages" API for this. Once you have the message ID, you can retrieve the attachments using the "get attachments" API post which you can append the /$value to the request URL to get the raw content of a file attachment. So, the workflow would be something like the below.
GET https://graph.microsoft.com/v1.0/me/messages
GET https://graph.microsoft.com/v1.0/me/messages/{message-id}/attachments
GET https://graph.microsoft.com/v1.0/me/messages/{message-id}/attachments/{attachment-id}/$value
Similarly, to mark an email as read, you need to update the isRead property of the message. It would be something like the below.
PATCH https://graph.microsoft.com/v1.0/me/messages/{message-id}
Content-Type: application/json
{
"isRead": true
}
You may want to read this documentation page - https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0&tabs=http
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.