I would like to revive a topic that was asked 2017 but no answer was given. Maybe that changed in 2020:
Is there a way to add tags to a document using the REST or WebDav or whatever API?
If so, could someone give me an example?
I would like to test nextcloud as an DMS and thus have to import several thousend tagged documents.
Thank you, the part with “PROPPATCH” looks pretty much like what I was looking for.
However, appearently it does not work. If I execute it, then I get 200 OK as response but no tag is added. I assume I can see tags in the details as “collaborative tags” or am I mistaken? The name insinuates that there may be other categories of tags.
Maybe important: My nextcloud version is 17.0.2.
BTW: Is there a way to show tags in the files list right next to file names?
I think there are Systemtags what we see on the tab “tag” and there is the property oc:tags which can have a groupof tag-properties. I think you just update property-tags of a resource. To add a systemtag, you can run the following request:
Thank you for the hint with the curl-call.
I tried it but it did not work as expected.
First, I added a tag “Test” to a file.
Then I applied daniel512’s command to another file (file id=7) and tag (=1,). I get no response in this case but there appears no tag in the details of the file. When I try another tag id then I get an error response, so I believe the tag id exists.
Even if it worked I have the feeling the process is quite complicated:
Upload a file
Get the Id of the file (I guess via PROPFIND request)
Get the list of tags, check if the desired tag is already there, get the id of it. (No idea how)
You mean the call is what the web client is doing when I add a tag? Smart.
However it does not appear to work in my case. How can I find out what I am doing wrong?
I do not know how to proceed. The curl call does not return an error. I do not know how to list all tags to check the ids. The administrative page in the web client speaks of collaborative tags but your call suggests system-tags which as I understand cannot be seen or used in the web client.
I am that close to migrate my DMS to nextcloud but I would need tags for it and cannot add them manually.
Great. Works as described. Where do you get all this information on the API from?
It is a bit embarassing asking all that info from you bit by bit.
I guess I can get the tag name for a tag id by PROPFINDing /dav/systemtags/x ?
I cannot find a comprehensive list of avaliable properties for the tag list. Because of that I cannot determine the tag name from the ID. Here I am stuck. You need the id to add the tag to the file as described above.
Other issues that keep me from using Nextcloud as DMS up to now:
I use elasticsearch as an search engine. It is great when works. However, the installation needs a plugin to elasticsearch ‘ingest-attachment’. Whenever ubuntu updates eleasticsearch, it stops working as I have to update that plugin manually, even if the update is on the patch level 7.10.X. In nextcloud you don’t notice because the search just silently fails.
Elasticsearch does not search the tags. You can only use the filter on left side navigator.
I have not found out how to display the tags next to the file. I know there was a feature request some years ago but that was set ‘Deprecated’.
I have issues adding tags manually. When I click on the “…” next to a file I have to open ‘details’, then I have to click on ‘…’ for the entry “tags”. However, often the input box for the tags does not open. I do not know what I am doing wrong here. Anyway, too complicated to quickly add tags.
Why I would like to use nextcloud as a DMS anyway:
Best search performance on OCR’ed documents compared to other open-source dms like openkm and mayan.
I can keep a tree structure of the files. Call me antiquated but it helps keeping organized.
Access by file explorer by the sync mechanism. Easier to use with windows than webdav.
Maybe someone has news on my issues and can help solving the tag issue.