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 Automate - Using Connectors
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
    4,413 Super User 2025 Season 2 on at
    Need to upload an image from a SharePoint folder to a 3rd Party App through their REST API
     
    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
    Need to upload an image from a SharePoint folder to a 3rd Party App through their REST API
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 721 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 545 Moderator

#3
chiaraalina Profile Picture

chiaraalina 321

Last 30 days Overall leaderboard

Featured topics