Upload REST API shows 400 bad request

cancel
Showing results for 
Search instead for 
Did you mean: 
Established Member

Upload REST API shows 400 bad request

Hi there ,

I have an ESB webservice client which upload document to Alfresco  using following RestAPI .

http://<xxx>:8080/alfresco/service/api/upload

I understand  ,  API  to be  called as multipart / form data  , with file and mandatory fields .    When i executed  , i got the following error ersponse back  .

{
  "status": {
    "code"400,
    "name""Bad Request",
    "description""Request sent by the client was syntactically incorrect."
  },
  "message""Required parameters are missing",
  "exception""",
  "callstack": [],
  "server""Enterprise v5.2.3 (r852994b1-b12) schema 10,065",
  "time""10-Jul-2020 12:26:47"
}
 
I use WSO2 ESB client , ESB code looks all good . The only place where i can debug is through wirelog .
wirelog shows alll good( please scee screen shot below) . Error message has confilicting information like
 
 "description""Request sent by the client was syntactically incorrect."
   "message""Required parameters are missing",
 
Is there a log i can get from Alfresco server side to identify what actually is the issue , which syntax is incorrect ?
what parameter is missing ?
 
Screen shot for wire log as below
 
FileUploadDire.jpg
 
 
 
 

 

 

 

4 Replies
Active Member

Re: Upload REST API shows 400 bad request

Did you verify that your alfresco version supports the above webservice ?

Problem solved? Click Accept as Solution!
Community Manager
Community Manager

Re: Upload REST API shows 400 bad request

Hi @brijeshnk,

As @malekgn says, check the supported API version - take a look at this thread for a similar issue.  

HTH

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
Established Member

Re: Upload REST API shows 400 bad request

Hi ,

Yes  i can call the same API from other clients  . POSTMAN and SOAPUI  client works and gives success message. 

When i called using WSO2( ESB)  client its rejecting  with error messages mentioned above .  for  debugging ,  I captured  wirelog using wireshack  ( attached in original message above) ,  I dont see anything  anwrong in that too . Hence i suspect something wrong  in server .    Where exactly i can see incoming API messages or more debugging logs for Rest API service

Moderator
Moderator

Re: Upload REST API shows 400 bad request

if i understand correctly, you are sending upload requesy to a SOAP webservice and from within the webservice you are calling alfresco file-upload rest api. 

Did you checked the webervice code whether it is able to get the input stream from the request for further passing it to alfresco file-upload rest api? Did you tried setting MTOM property to true while sending your soap request with filedata?

I remember this is one of the requirement for passing binary data to soap webservice. An example of enabling MTOM can be seen here for soapui client, likewise your client may have option to enable mtom. May be give it a try.

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)