Azure Logic App Graph API Read Email and get Attachments

Bowles, Mickey 46 Reputation points
2022-08-24T01:32:42.273+00:00

Have a logic app with an HTML action that makes a Graph API Get call to read emails from an InBox. (we can't use the When a new email arrives V3 because of company SSO and I am not reading my own email) . I am using oauth with app permissions to graph api mail.read with admin consent.
I can get the emails and have a json schema for the email for the ParseJSON action, but don't have the schema for attachments. How can I get the attachments so I can save them to a blob?

234228-image.png

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Bruno Lucas 4,436 Reputation points MVP
    2022-08-24T04:07:11.117+00:00

    Hi @Bowles, Mickey

    Did you try:
    GET /users/{id | userPrincipalName}/messages/{id}/attachments/{id}/$value

    https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0&tabs=http

    https://stackoverflow.com/questions/54820844/download-attachments-from-mail-using-microsoft-graph-rest-api

    you can use graph explorer to try:

    https://developer.microsoft.com/en-us/graph/graph-explorer

    first get message:

    234256-image.png

    that returns the id you can use for next call:

    234354-image.png

    Please don't forget to click on "Accept Answer" or the vote button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.