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 / Need to upload an imag...
Power Automate
Answered

Need to upload an image from a SharePoint folder to a 3rd Party App through their REST API

(0) ShareShare
ReportReport
Posted on by 5
I need help on how to configure/syntax of the body parm of the HTTP Request
 
Below is the example of the CURL from the 3rd Party testing tool
 
Based on the results from the below, I tried creating the HTTP POST but getting invalid JSON error. JSON below.. the base64 variable is "base64(outputs('Get_file_content')?['body'])" The file is an image in a Sharepoint Folder that I used the Get_file_Content call for. 
 
 
 
 
CURL EXAMPLE:
curl 
-X POST "https://**redacted****/libraryItems/uploadFile" 
-H "accept: application/json" 
-H "Content-Type: multipart/form-data" 
-F "command={
"parentFolderId": 1121,
"fileType": "Single Brand Package Product File",
"fileStatus": "Active",
"customFields": [
{"fieldId": "BusinessPillar","value": ["Snacks"]},
{"fieldId": "Owner","value": ["US"],"fieldLabel": "Owner"},
{"fieldId": "PIMDate","value": ["2025-09-23 00:00:00.000-0500"],"fieldLabel": "PIM Date"},
{"fieldId": "Description","value": ["Product Benefit 1-No Package in Image-Z1NH"],"fieldLabel": "Description"}
]
}" -F "file=@00014500009821_C1C1_10117176.png;type=image/png"
Categories:
I have the same question (0)
  • Verified answer
    stampcoin Profile Picture
    5,153 Super User 2026 Season 1 on at
     
    You can have a try this:( with AI assistance), Please read the reference link to adjust the code accordingly.
    {
      "$content-type": "multipart/form-data",
      "$multipart": [
        {
          "headers": {
            "Content-Disposition": "form-data; name=command",
            "Content-Type": "application/json"
          },
          "body": {
            "parentFolderId": 1121,
            "fileType": "Single Brand Package Product File",
            "fileStatus": "Active",
            "customFields": [
              { "fieldId": "BusinessPillar", "value": ["Snacks"] },
              { "fieldId": "Owner", "value": ["US"], "fieldLabel": "Owner" },
              { "fieldId": "PIMDate", "value": ["2025-09-23 00:00:00.000-0500"], "fieldLabel": "PIM Date" },
              { "fieldId": "Description", "value": ["Product Benefit 1-No Package in Image-Z1NH"], "fieldLabel": "Description" }
            ]
          }
        },
        {
          "headers": {
            "Content-Disposition": "form-data; name=file; filename=00014500009821_C1C1_10117176.png",
            "Content-Type": "image/png"
          },
          "body": "@{body('Get_file_content')}"
        }
      ]
    }
    
    reference link:
     
     
    Hope this can help.
     

    Enjoy Power Platform and have a great day 🚀 |  My LinkedIn

    If the answer helps, please consider 👍, Thanks.

  • KO-10101805-0 Profile Picture
    5 on at
    Fan-Freakin-Tastic!!! That was EXACTLY what I needed. I was so close, just needed the Content-Disposition addition of name=commend and the header for the file. 
     
    Thanks so much for the reply and example!!
     
     

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 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard