web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Issues Sending a PDF F...
Power Automate
Answered

Issues Sending a PDF File to an API Using PowerAutomate

(0) ShareShare
ReportReport
Posted on by 18

Hello everyone,

 

I want to send my PDF file to an API using PowerAutomate.
However, I can't get it to work.

 

Here is the documentation for it:


https://docs.ninox.com/en/api/private-cloud-apis#upload-a-single-file-with-post](https://docs.ninox.com/en/api/private-cloud-apis#upload-a-single-file-with-post

 

Here is the cURL command from the documentation.

 

 

curl https://anastasiya.ninoxdb.de/v1/teams/u14mwnoutm14yrcnf/databases/pnum1qq8tpao/tables/B/records/5/files
-X POST
-H "Authorization": "Bearer e66e5190-14ad-11ec-aa6f-3502731d486c"
-H "Content-Type": "multipart/form-data"
-F 'file=@"/Users/anastasiya/Downloads/iStock-184877012.jpeg"'

 

 

 

Here is my PowerAutomate error and my code.
What am I doing wrong?

 

 

[
{
"message": "Unexpected token : in JSON at position 78"
}
]

 

 

MettyNitram_0-1716035062047.png

 

P.S. I can do it with Visual Studio Code, just not with PowerAutomate.

 

Translated with ChatGPT 😉

Categories:
I have the same question (0)
  • Verified answer
    v-yueyun-msft Profile Picture
    on at

    Hi , @MettyNitram 

    According to your description, you need to check your http body is correct in your side. You need to use the multipart/form-data type.

    And for more information, you can refer to this similar cases:
    Solved: HTTP POST files with multipart/form-data - Power Platform Community (microsoft.com)

    Solved: Send file with HTTP Rest - Power Platform Community (microsoft.com)

     

    Best Regards,

    Yueyun Zhang

     

  • Verified answer
    MettyNitram Profile Picture
    18 on at

    Thank you, that was very helpful. I was also able to recreate it in my FLOW using the video https://www.youtube.com/watch?v=6BZAO1r0Ucc. It was a bit challenging to find the correct syntax, but I managed to do it. Thanks.

  • MettyNitram Profile Picture
    18 on at

    This BODY was needed:

     

    {
     "$content-type": "multipart/form-data; boundary=--------------------------810335688172264482525643",
     "$multipart": [
     {
     "headers": {
     "Content-Disposition": "form-data; name=\"ZB1 Scan\"; filename=\"@{outputs('Dateimetadaten_abrufen')?['body/Name']}\"",
     "Content-Type": "application/pdf",
     "Content-Length": ""
     },
     "body": {
     "$content-type": "application/pdf",
     "$content": "@{body('Dateiinhalt_über_Pfad_abrufen')?['$content']}"
     }
     },
     {
     "headers": {
     "Content-Disposition": "form-data; name=\"threshold\"",
     "Content-Length": "4"
     },
     "body": {
     "$content-type": "application/octet-stream",
     "$content": "MC43NQ=="
     }
     }
     ]
    }

     

  • MettyNitram Profile Picture
    18 on at

    Hello everyone, I have another question.

    How can I post this file into a specific field in the NINOX database? Here is the API description: https://docs.ninox.com/en/api/private-cloud-apis#upload-a-single-file-with-post

    With Postman, it works like this: 

    MettyNitram_0-1720126031333.png

     

    But how can I do this with Power Automate to address the "fieldId" : "A"?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard