You are viewing limited content. For full access, please sign in.

Question

Question

API Call from PowerAutomate to self hosted API Server returns error

asked on August 16, 2024

I am getting the error below when I attempt to import a document into my self-hosted API server. 

"Invalid Request. Property file not found in the request body."

 

I am able to perform other actions like downloading files and viewing the directories. The only issue I had is uploading documents. I have attached the action and request body here.

 

Any help is greatly appreciated.

 

Thanks

 

 

 

 

image.png
image.png (35.7 KB)
0 0

Replies

replied on August 19, 2024

Hi Sharon,

make sure that the filename contains the correct extension for the file type. For example:

Content-Disposition: form-data; name="file"; filename="filename.pdf"; Type: Text)"

0 0
replied on August 19, 2024 Show version history

Hi, 

Yes, I did confirm the filename does have the file extension but I am still getting the error.  Any help appreciated.

 

Below is the request body

=============================

{
   "$content-type": "multipart/form-data",
   "$multipart": [
 {
   "headers": {
     "Content-Disposition": "form-data; name=\"electronicDocument\"; filename=@{outputs('Get_file_metadata')?['body/Name']}",
     "Content-Transfer-Encoding": "binary"
   },
   "body": @{body('Get_file_content_using_path')}
 },
 {
   "headers": {
     "Content-Disposition": "form-data; name=\"request\"",
     "Content-Transfer-Encoding": "binary"
   },
   "body": {
      "name": "{documentName}",
     "autoRename": true,
     "metadata": {
       "templateName": "test tempate",
       "fields": [
         {
           "name": "Image Name",
           "values": [
             "12345"
           ]
         },
         {
           "name": "NUmber",
           "values": [
             "123"
           ]
         }
       ]
     }
   }
 }
   ]
 }

0 0
replied on August 19, 2024

Sharon,

We have a guide on our developer site that shows how to use Power Automate with our API.  Note that the first section of the guide covers authentication with Laserfiche Cloud only (but you have that working already).  The guide specifically shows how to upload a OneDrive document from Power Automate to our Laserfiche API.

 

Andrew

0 0
replied on August 19, 2024 Show version history

Hi Andrew, 

I have followed the guide and still facing the error that it is an invalid request. I tried in Postman and it did work.

 

Any help appreciated.

image.png
image.png (12.36 KB)
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.