web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get Attachment V2 - Ba...
Power Automate
Unanswered

Get Attachment V2 - Bad Request

(0) ShareShare
ReportReport
Posted on by 16

Hello,

 

I'm creating a flow where I need to get content of a csv attachment from shared mailbox.

Flow triggers correctly & condition identifies correct attachment.

Then the Get Attachment V2 fails with a Bad Request error message.

 

MarekFe_1-1704978331565.png

 

I see that the input is correct.

I dont uderstand why the output gives me this message:

 

 

{"statusCode":400,"headers":{"Date":"Thu, 11 Jan 2024 12:57:29 GMT","Connection":"close","Content-Type":"text/html; charset=us-ascii","Content-Length":"324"},"body":"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">\r\n<HTML><HEAD><TITLE>Bad Request</TITLE>\r\n<META HTTP-EQUIV=\"Content-Type\" Content=\"text/html; charset=us-ascii\"></HEAD>\r\n<BODY><h2>Bad Request - Invalid URL</h2>\r\n<hr><p>HTTP Error 400. The request URL is invalid.</p>\r\n</BODY></HTML>\r\n"}

 

 

All I'm looking for is to get the "contentBytes"of the attachment for further processing.

 

Please help.

 

Thank you

Kind Regards

Marek

Categories:
I have the same question (0)
  • MarekFe Profile Picture
    16 on at
    Re: Get Attachment V2 - Bad Request

    Now that I posted this message I see that instead of using Attachment ID I added the whole attachment in the ID field.

     

    How do I get just the Attachment ID from the output of the condition ?

     

    {
     "@odata.type": "#microsoft.graph.fileAttachment",
     "id": "AAMkADFiZjZhNgAQAO99MC-1PfJHn_4AnkXCJ4c=",
     "lastModifiedDateTime": "2024-01-11T12:57:11+00:00",
     "name": "Daily PDC_2024-01-10.csv",
     "contentType": "image/jpeg",
     "size": 1312,
     "isInline": false,
     "contentId": "2B29D731546@eurprd01.prod.outlook.com",
     "contentBytes": "U3RhdGlzdGljcyB"
    }

     

    Thank you

  • MarekFe Profile Picture
    16 on at
    Re: Get Attachment V2 - Bad Request

    Soo I found the solution.

    I just run the condition output through Compose.

    Then reference contentBytes from the Compose Array.

     

    MarekFe_0-1704981634328.png

     

    Still I would like to know if there is a way to use the Get Attachment V2 ?

     

    Thank you

    Kind Regards

    Marek.

     

  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at
    Re: Get Attachment V2 - Bad Request

    Hi Marek

     

    You need to pass the attachment id from the dynamic content window as shown below:

    ManishSolanki_0-1704983306802.png

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • MarekFe Profile Picture
    16 on at
    Re: Get Attachment V2 - Bad Request

    Thank you Manish, It works like that.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard