Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Graph API PDF attachment ContentBytes

Like (0) ShareShare
ReportReport
Posted on 28 Mar 2025 16:42:23 by 109
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
    109 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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

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

Leaderboard > Power Automate - Building Flows

#1
David_MA Profile Picture

David_MA 276 Super User 2025 Season 1

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 245 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 212

Overall leaderboard
Loading started