Posted Mon, 24 Aug 2020 14:36:05 GMT by Stephen McBride Secondary Admin
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!
Posted Mon, 24 Aug 2020 14:49:03 GMT by Joe Kaufman Bell Laboratories Inc No longer there

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?

Joe Kaufman
Posted Mon, 24 Aug 2020 17:00:32 GMT by Stephen McBride Secondary Admin
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!
Posted Mon, 24 Aug 2020 17:33:07 GMT by Joe Kaufman Bell Laboratories Inc No longer there
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!

Joe Kaufman
Posted Fri, 06 Aug 2021 15:22:53 GMT by Tiago Matos CoreForm Business Technology - Software Implementation Specialist

I got the same issue here "Unnamed document with ID..." but in my case I'm just creating an data record via API. I'm not uploading any document.
Unfortunately, I can't change the order of my code to send the document first.

What am I missing?

Thanks for any help
Posted Fri, 06 Aug 2021 15:35:20 GMT by Stephen McBride Secondary Admin
Tiago,  by default, the filename of a document will become the Document Name. If you're not uploading a document, then there will be no filename.  However, you can Edit your File Cabinet, and go to "Database Fields" and select a field here to become the Document Name. Once you do that, when you create the data record with the API, as long as that field is populated, the document will have a name. 

You must be signed in to post in this forum.