cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AlexRD
Level: Power Up

Send HTTP POST with email attachment

Hi, 

 

I'm currently trying to create a flow that is triggered when a new email is received and for each of the attachments creates an HTTP requests which posts the content to a backend server for further processing of the file.

 

I tried setting the file as content body and also as a request parameter' file. In all cases, I'm receiving that the file is Null at the backend.

I've also tried posting the array of attachments and I get a Json like this:

[{
	@odata.type = #Microsoft.OutlookServices.FileAttachment,
	Id = AQMkADNmNWYwMWViLT...,
	Name = myPhoto.jpg,
	ContentType = image / jpeg,
	Size = 19092,
	ContentBytes = null
}, {
	@odata.type = #Microsoft.OutlookServices.FileAttachment,
	Id = AQMkADNmNWYwMWViLTcx... ,
	Name = My PDF.pdf,
	ContentType = application / pdf,
	Size = 44972,
	ContentBytes = null
}]

The problem I have is that contentBytes is always null. If I try to loop trough each of the attachments and get the content, I post a null value in the request body.

 

What's the proper way to post an email attachment to an HTTP request?

1 ACCEPTED SOLUTION

Accepted Solutions
AlexRD
Level: Power Up

Re: Send HTTP POST with email attachment

After serveral hours of debugging and crying in the corner, I just figured out what was wrong. I wasn't including the email attachments from the initial trigger action. Make sure to select "Include email attachment".

The attachment is encoded in Base64.

1 REPLY 1
AlexRD
Level: Power Up

Re: Send HTTP POST with email attachment

After serveral hours of debugging and crying in the corner, I just figured out what was wrong. I wasn't including the email attachments from the initial trigger action. Make sure to select "Include email attachment".

The attachment is encoded in Base64.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 215 members 3,051 guests
Please welcome our newest community members: