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 / HTTP POST files with m...
Power Automate
Unanswered

HTTP POST files with multipart/form-data OpenAI API

(1) ShareShare
ReportReport
Posted on by 4

Hi guys. 

New here. 

 

Perhaps I can find some help here. 

I am currently trying to upload some documents to openAI from SharePoint using power automator to glue the process but I tried everything except the solution I still can't figure out.

 

Not to drown you guys in bla bla.

Here's the openAI specifications using curl:

 

 

curl https://api.openai.com/v1/files \

  -H "Authorization: Bearer $OPENAI_API_KEY" \

  -F purpose="fine-tune" \

  -F file="@mydata.jso

nl"

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    @MSuser777 ,

    Do you mean you want to provide a document to Open Ai for Text extraction?

     

  • MSuser777 Profile Picture
    4 on at

    Yes sir, I would like go do that using the HTTP component of power automate.

  • GBURGARDT Profile Picture
    7 on at
    This is the request to the OpenAI files endpoint. To ensure the
    file does not become corrupted in OpenAI, the key is to put the content
    bytes inside a String function @{string(outputs('Get_Attachment_(V2)')?['body/contentBytes'])}


    URL

    Method
    POST

    Headers
    Authorization Bearer sk-proj-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Body                               
    {
      "$content-type": "multipart/form-data",
      "$multipart": [
        {
          "headers": {
            "Content-Disposition": "form-data; name=\"purpose\""
          },
          "body": "fine-tune"
        },
        {
          "headers": {
            "Content-Disposition": "form-data; name=\"file\"; filename=\"@{outputs('Get_Attachment_(V2)')?['body/name']}\""
          },
          "body": {
            "$content-type": "@{outputs('Get_Attachment_(V2)')?['body/contentType']}",
            "$content": "@{string(outputs('Get_Attachment_(V2)')?['body/contentBytes'])}"
          }
        }
      ]
    }

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 550

#2
Valantis Profile Picture

Valantis 390

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard