Unable to create document using WebXtender REST API
I keep getting the following error when trying to create a document:
"The HTTP request does not contain index information to create a AX document!"
Not sure what's really causing this error because I am providing the index information.
Here's my python script:
## TEST UPLOADING DOC
urlDev = 'http://localhost/appxtenderrest/api/axdatasources/db/'
appID = 108
URI = urlDev+"axdocs/"+str(appID)
testFilePath = 'test-document.pdf'
testDocOpen = open(testFilePath, 'rb')
testDoc = {"file": (testFilePath, testDocOpen)}
headers = {'Accept':'application/vnd.emc.ax+json'}
## index info
data={}
data['TargetDoc'] = {"ID":None}
data['NewIndex'] = {"indexid":None, "values":[{"FieldID":"field1","FieldValue":"PDF"},{"FieldID":"field2","FieldValue":"TEST DOCUMENT"},{"FieldID":"field3","FieldValue":"0"}]}
data['FromBatch'] = {"ID":None}
data['BatchPageNum'] = None
data['IgnoreDuplicateIndex'] = False
data['IgnoreDlsViolation'] = False
#print(data)
axDocPOST = requests.post(URI, json=data, files=testDoc, headers=headers, auth=HTTPBasicAuth(userDev, passDev))
print (axDocPOST.json())
print (axDocPOST.headers)
print('status code:', axDocPOST.status_code)
if axDocPOST.status_code == 201:
print ("Success")
else:
print ("Failure")
Comments
-
which OT product are you using as this is the Content Server forum not an Application Extender forum ?
0 -
nope, a completely different product.
@Karen Weir can you assist locating the correct forum ? I suspect it will be https://forums.opentext.com/forums/support/categories/family-applicationxtender or similar.
0 -
Thanks @Greg Griffiths
@wstrahan , we do not have an area in the Developer Community for Application Xtender. Please upgrade your account so that you can access our Support community for that product line:
https://forums.opentext.com/forums/support/categories/family-applicationxtender
1
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 102 General Questions
- 123 Services
- 40 OpenText Hackathon
- 33 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 901 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 127 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax