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 / Attach file to HTTP re...
Power Automate
Answered

Attach file to HTTP request body

(0) ShareShare
ReportReport
Posted on by 29

 Hello, 

 

I hope you are doing great. 

 

Does anyone know how to attach a file in a http post request in Power Automate Desktop?

 

I'm trying to send a file to an API using a post request

Tzai_0-1672171583814.png

 

In postman I can just add the file like this

Tzai_1-1672171650545.png

But, not able to attach the file into the body with PAD, and I'm getting this error:

 

{"message":"Add file or url in request}

 

Thanks in advance 

 

 

  • kinuasa Profile Picture
    801 Most Valuable Professional on at

    Hi,
    Instead of the 'Invoke web service' action, I suggest using a script or curl command, as in the following site.

     

     

    Regards,
    kinuasa

  • Tzai Profile Picture
    29 on at

    Hello Kinuasa, 

     

    Thanks a lot for the reply! 

    I tried this curl command

     

    curl --request POST \
    --url 'https://app.nanonets.com/api/v2/OCR/Model/{{model_id}}/LabelFile/' \
    --header 'accept: multipart/form-data' \
    -u '{{API_Key}}' \
    -F 'file=@{{Image_Path}}'

    Tzai_0-1672243548055.png

    And got this error:

    Tzai_1-1672243614969.png

     

    Do you have an example done in PAD?

     

    Best regards, 

     

     

  • VJR Profile Picture
    7,635 on at
  • PAG Profile Picture
    154 on at
  • Tzai Profile Picture
    29 on at

    Hello, 

     

    Thanks a lot for the reply.

     

    I tried with the Run DOS command 

     

    Something like this 

    curl --request POST \
    --url 'https://app.nanonets.com/api/v2/OCR/Model/{{model_id}}/LabelFile/' \
    --header 'accept: multipart/form-data' \
    -u 'REPLACE_API_KEY' \
    -F 'file=@REPLACE_IMAGE_PATH.jpg'

     

    And something like this

    curl -D- -u %ApiKey% -X POST -F "file=@%file%" %Domain%

     

    But, it gets stuck for hours, so, no luck so far.

  • Tzai Profile Picture
    29 on at

    Hello, 

     

    Thanks a lot for the reply. I tried to replicate it. 

    And also Nanonets documentation have curl, but, didn´t work.

    https://nanonets.com/documentation/#operation/OCRModelLabelFileByModelIdPost

     

    I tried with the Run DOS command 

     

    Something like this 

    curl --request POST \
    --url 'https://app.nanonets.com/api/v2/OCR/Model/{{model_id}}/LabelFile/' \
    --header 'accept: multipart/form-data' \
    -u 'REPLACE_API_KEY' \
    -F 'file=@REPLACE_IMAGE_PATH.jpg'

     

    And something like this

    curl -D- -u %ApiKey% -X POST -F "file=@%file%" %Domain%

     

    But, it gets stuck for hours, so, no luck so far.

  • Verified answer
    Tzai Profile Picture
    29 on at

    Sharing a workaround done by a team member who is brilliant.

     

    He created this python script 

    Tzai_0-1673042386828.png

    And we call it in PAD

    Tzai_1-1673042790255.png

     

    Adding the arguments like 

    "arg1" "arg2" "arg2" 

     

    And the working folder to store the JSON response.

     

    And it´s working fine.

     

     

     

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, would you mind explaining more how you are passing the arguments?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 132

Last 30 days Overall leaderboard