By danielwalters - Tue Mar 13, 2018 8:32 am
- Tue Mar 13, 2018 8:32 am
#813639
Hello,
I'm building a Linux / Python web application that allows users to interact with processmaker cases. Everything has been going great with the REST API until i've tried to upload input documents.
I'm hit with the following error in my response:
http://wiki.processmaker.com/3.2/REST_A ... _Documents
I've also tried using the "@" before the filename but that didn't work.
I've tried both the standard Python Requests library and httplib2 but neither get around this error.
My code is as follows:
Uploader
Thanks,
Daniel
I'm building a Linux / Python web application that allows users to interact with processmaker cases. Everything has been going great with the REST API until i've tried to upload input documents.
I'm hit with the following error in my response:
Code: Select all
The documentation for this api call recognises this problem with PHP (im using python) and suggests to use CurlFile.{'code': 400, 'message': 'Bad Request: This filename does not exist!'}
http://wiki.processmaker.com/3.2/REST_A ... _Documents
I've also tried using the "@" before the filename but that didn't work.
I've tried both the standard Python Requests library and httplib2 but neither get around this error.
My code is as follows:
Uploader
Code: Select all
called by:def uploadInputDoc(access_token, app_uid, inp_doc_uid, tas_uid, app_doc_comment, form):
try:
url = "http://mybpmurl/api/1.0/workflow/cases/"+app_uid+"/input-document"
querystring = {"access_token":access_token}
payload = {'inp_doc_uid':inp_doc_uid,'tas_uid':tas_uid,'app_doc_comment':app_doc_comment,'form':form}
headers = {
}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
return response
except Exception as e:
print("error: " + str(e) )
Code: Select all
Any help would be greatly appreciated!uploadInputDoc(bmpAccessToken, "myappidhere", "myinputdocidhere", "mytasuidhere", "comment, "/media/report.pdf" )
Thanks,
Daniel