Veröffentlicht Mon, 24 Aug 2020 14:36:05 GMT von Stephen McBride
I am currently using the REST API to upload and index new documents into Docuware. I do this in two API calls, first I POST the index fields to /docuware/platform/FileCabinets/<file cabinet ID>/Documents and get back a DocID. I then POST the document file to /docuware/platform/FileCabinets/<file cabinet ID>a/Sections?DocId=<doc ID>

This works great EXCEPT the document name comes though as "Unnamed document with ID..." (This is what shows at the top of the document viewer)  The filename comes though at the bottom of the document viewer in what I believe is the "Original File Name" field.

What am I missing? How do I set the document name when uploading the file via the REST API?

Thanks for any help!
-Steve
Veröffentlicht Mon, 24 Aug 2020 14:49:03 GMT von Joe Kaufman Bell Laboratories Inc Application Development Manager
Stephen,

I believe the name is determined by whichever database field (index) is given the "Document Name" attribute when designing the file cabinet. There can be only one "Document Name" field designated, and when that index is filled in, it becomes the document name.

What are you placing in the field designated as Document Name? If you set that index (via the API or the web client), does the name then display as you would hope?

Thanks,
Joe Kaufman
Veröffentlicht Mon, 24 Aug 2020 17:00:32 GMT von Stephen McBride
Joe, thanks for the quick reply!  It wasn't the exact answer I needed, but it got me going down the right path. 

I do not have any fields designated as the Document Name, so by default it always uses the file name of the document when indexing through the Docuware client. So this got me thinking. If I'm setting the index values FIRST before I upload the document, then Docuware doesn't know the filename at the time of the record creation.

So, I changed the order in my code to send the file first, THEN set the index fields, and it works! File name becomes the Document Name as it should.

Thanks for pointing me in the right direction!
-Steve
Veröffentlicht Mon, 24 Aug 2020 17:33:07 GMT von Joe Kaufman Bell Laboratories Inc Application Development Manager
Not a problem, glad it worked! Interesting scenario, and it is good to know one can force the filename to be the document name in that way!

Thanks,
Joe Kaufman

Sie müssen angemeldet sein um Beiträge in den Foren zu erstellen.