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:
Example failure:
{
"$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.
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
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2