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 / HTTP Post API Call wit...
Power Automate
Unanswered

HTTP Post API Call with Image Content Payload

(0) ShareShare
ReportReport
Posted on by

I am working on a Flow to automate image uploads to Square, who provides an API to create catalog images. My current process saves JPEGs to OneDrive and then utilizes the API to post the content to Square. However, this fails with a 400 Bad Request status from the API call - I could certainly be building the HTTP message incorrectly for use with their API, but I think it is correct, so I'm wondering if I am not properly handling the File Content for the image.

 

Any thoughts on 1) handling the file content or 2) HTTP header/body content?

 

Flow Actions:

image.png

image.png

 

 

Example failure:

image.png

image.png

image.png

 

{
 "$content-type": "multipart/form-data",
 "$multipart": [
 {
 "headers": {
 "Content-Disposition": "form-data; name=\"file\"; filename=\"9781452172187-L.jpg\""
 },
 "body": {
 "$content-type": "image/jpeg",
 "$content": ""
 }
 },
 {
 "headers": {
 "Content-Disposition": "application/json"
 },
 "body": {
 "idempotency_key": "39008122-ce15-490c-9ee2-936f18c014b6",
 "image": {
 "id": "#9781452172187",
 "type": "IMAGE",
 "image_data": {
 "caption": "ISBN 9781452172187"
 }
 }
 }
 }
 ]
}

 

 

 

 

 

Thanks for any help.

Categories:
I have the same question (0)
  • MJain Profile Picture
    2,450 on at
    Re: HTTP Post API Call with Image Content Payload

    Hi @Kismet ,

     

    Have you tried doing the same via Postman , if so there is a button at the top right to show code of the request. You can click on it and decide which programming language you want to view the output.  All you need is to grab the same request and paste in the HTTP post call you are making in flow.

     

    Thanks

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