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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / how to compose the req...
Power Automate
Unanswered

how to compose the request body of invoke web service

(0) ShareShare
ReportReport
Posted on by 29

Hi All,

 

I am working on an automation with Azure cognitive API which will need to submit an image file from local directory to Azure service. I am using  

'Content-Type': 'application/octet-stream'

in request header of Invoke web service action in PAD, but did not find a way to compose the request body accepted by Azure service. I tried to use convert file to binary action for a selected JPG file and directly use the output in the request body.

RickMa_1-1713232213601.png

 

However, there is an error "{"error":{"code":"InvalidImage","message":"The file submitted couldn't be parsed. This can be due to one of the following reasons: the file format is not supported ( Supported formats include JPEG, PNG, BMP, PDF and TIFF), the file is corrupted or password protected."}}". It highly appreciated that your experience can shed some light to it. 

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @RickMa 

     

    Initially, test the functionality using the Postman app to ensure everything operates smoothly. Afterward, replicate the parameters in the PAD invoke web service action. This approach will help avoid unnecessary issues within PAD.

    Thanks,

     


    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • RickMa Profile Picture
    29 on at

    Thanks for feedback. I actually succeeded in call the API in Python with below code, but cannot replicate the way in PAD.

    RickMa_0-1713257734244.png

     

  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @RickMa 

    According to the documentation, it also supports multipart data.

     

     

    For uploading some objects, I recommend using PowerShell or Python scripts to invoke Azure AI instead of using the Invoke Web Service, as ultimately, they achieve the same outcome.

     

    If you're open to using PowerShell, please try the link below.

     

    https://powerusers.microsoft.com/t5/Power-Automate-Desktop/How-to-attach-excel-file-in-Invoke-web-service-action-of-PAD-API/m-p/2667423 

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • RickMa Profile Picture
    29 on at

    I tried another call from Postman which is successful and still cannot translate the same request in PAD invoke Web service action. The request body in Postman is a binary data, but "Invoke Web service" did not accept the output form "Convert file to binary" action. 

    RickMa_0-1713749631031.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 801

#2
Valantis Profile Picture

Valantis 602

#3
Haque Profile Picture

Haque 581

Last 30 days Overall leaderboard