Posted Mon, 04 Feb 2019 07:30:40 GMT by Chema Lopez Developer

Hi.

I am trying to replace a document using REST API but I have not been successful.

These are the steps:

1. Download an existing document of the FileCabinet.

2. Make some changes to the downloaded file, i.e. sign it with a certificate.

3. Upload the changed document and replace the original one.

I use the POST call with the multipart/form-data option to do the third step but with no success.

I hope someone can help.

Thanks.

Posted Mon, 04 Feb 2019 13:14:08 GMT by Joe Kaufman Bell Laboratories Inc No longer there

Chema,

I have never edited a document and then tried to put it back in DocuWare, but this is an example of doing it in .NET:

http://help.docuware.com/sdk/platform/html/1052e573-211a-4f74-b2ee-77d0439b7ae7.htm

Are you using .NET or straight HTTP calls? What version of DocuWare? Cloud or on-premise?

One thing I notice is that editing operations involves downloading the content of a document (as "Sections"), which appears to be different from downloading the whole document. It is also an asynchronous process.

I am not sure what the .NET calls translate to in terms of the URLs to use... Looking at Fiddler as I edit a document, it looks like one of the relevant resources is:

/DocuWare/Platform/FileCabinets/{fileCabinetId}/Sections?docid={docid}

Like I said, Sections vs Documents -- not totally sure what the difference is, though.

 

Good luck,

Joe Kaufman

Posted Mon, 04 Feb 2019 14:33:51 GMT by Chema Lopez Developer

I finally was able to replace the document using another REST function.

I have not been able to do so with a HTTP POST:

/DocuWare/Platform/FileCabinets/{cabinet}/Documents/{document}

Instead, I have had to use the Section URL:

/DocuWare/Platform/FileCabinets/{cabinet}/Sections/{section}/Data

 

Posted Mon, 04 Feb 2019 14:36:08 GMT by Chema Lopez Developer

Thank you Joe.

I am using Java and Spring to integrate some applications with DocuWare. I finally was able to do it the way you say.

 

Posted Mon, 04 Feb 2019 17:14:08 GMT by Joe Kaufman Bell Laboratories Inc No longer there

Really just a shot in the dark, but glad the clue about Sections helped. Now I will just have to remember that if and when I try to do integrations involving document editing...  *smile*

 

Thanks,

JoeK

Posted Tue, 05 Feb 2019 13:02:27 GMT by BONNEAU Stephane CEO

Hi chema,

I 'm also developping with the rest paltform of Docuware 7.

For replacing a document stored ,

i look for the section id of the document by invoking this uri below and parse the slink with releivant section id ...

DocuWare/Platform/FileCabinets/{id}/Sections?docid={id}

after that , i invoke this Uri :

Platform/FileCabinets/{id}/Sections/{id}/Data?documentInfoInFileName=0 and load my file in binary mode

Don't forget to precise the content-type...in the header of your request

Hope this help you ..

Stephane

 

You must be signed in to post in this forum.