Skip to main content

Notifications

Community site session details

Community site session details

Session Id : EowpdSqS6/KqDizeNL8ZHO
Power Automate - Building Flows
Answered

Graph API PDF attachment ContentBytes

Like (0) ShareShare
ReportReport
Posted on 28 Mar 2025 16:42:23 by 107
Dear Community,
 
I am trying to send pdf attachment via email and GraphAPI. However, I am unable to get through the contentBytes section. I have also tried sending FileContent directly but unable to.
 
"contentType": "application/pdf",
  "message": {
    "IsReadReceiptRequested": "true",
    "IsDeliveryReceiptRequested": "true",
    "subject": "@{items('Apply_to_each')?['Subject']}",
    "body": {
      "contentType": "Text",
      "content": "@{items('Apply_to_each')?['NewBody']}"
    },
    "toRecipients": [
      {
        "emailAddress": {"address": "@{items('Apply_to_each')?['EmailTo']}" }
      }
    ],
  "attachments": [
      {
        "@odata.type": "#microsoft.graph.fileAttachment",
        "name": "@{outputs('Get_file_metadata')?['body/Name']}",
        "contentType": "application/pdf",
        "contentBytes": "@{base64(body('Get_file_content'))}"
}
      }
    ]
},
 "save To SentItems": "true",
}
 
  • Verified answer
    VK-25071541-0 Profile Picture
    107 on 29 Mar 2025 at 08:35:30
    Graph API PDF attachment ContentBytes
    This is sending document now. GraphAPI didnt have permissions in AppRegistrations Azure Portal
     
     "contentBytes": "@{base64(body('Get_file_content'))}"
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

Overall leaderboard