How to get a latest email conversation message and its attachments only either it is a reply or single email? Now, GraphAPI is gives latest email thread , so the entire conversations coming inside the body ? Any way to achieve this

Yabesh 0 Reputation points
2024-06-15T04:35:45.8133333+00:00

The below code I have tried, usually the entire conversation messages inside the single email thread is coming inside the body as a html, but I want the latest reply email conversation message and with its attachments only, not the previous conversation messages inside that same email thread. Please let me know, how to achieve this?


folder_url = f'https://graph.microsoft.com/v1.0/me/mailFolders/{folder}/messages?$top=1&$orderby=receivedDateTime desc'
        folder_r = requests.get(folder_url, headers=headers)
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Abiola Akinbade 29,490 Reputation points Volunteer Moderator
    2024-06-15T06:48:17.9366667+00:00

    Hello Yabesh,

    Maybe try this? https://stackoverflow.com/questions/59743062/microsoft-graph-get-latest-message-content-only

    Regards,

    You can mark it 'Accept Answer' if this helped you


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.