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.


Report
All responses (
Answers (