Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 1DQJkYkH6xRFy2amS3J7mn
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

🌸 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…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 105

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 86 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 62 Super User 2025 Season 1

Overall leaderboard
Loading started
Loading complete