• Updating a document via Restful API or database

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #43474  by rdovell
 
I am working on importing a large number of documents from another document management solution, some of these documents have a few versions that need to be preserved.

Using the restful API, I am able to upload a document but receive an ItemExistsException when trying to upload a different document with the same save path. Is there a way that I can add a new version of a document over an existing one using the Restful API?
 #43475  by rdovell
 
I figured it out, here are the relevant curl commands for someone else:

You need to checkout the document, then check it back in which increments the version number by 0.1

Checkout command:
curl -u okmAdmin:admin -H "Accept: application/json" http://localhost:8080/OpenKM/services/r ... 4e780fae3a

Checkin command(If you have a file in the local directory called 'foobar.txt'
curl -u okmAdmin:admin -H "Accept: application/json" -X POST -F docId="afc7b0cd-d0ab-4920-8b5d-d64e780fae3a" -F content=@foobar.txt http://localhost:8080/OpenKM/services/r ... nt/checkin

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.