Hello,
any idea how to upload document to a specific cabinet with specifying the tags?
example:
i want to upload document1.jpg to cabinet3 with tags: tag6,tag8.
upload document with specified cabinet/tag!
Re: upload document with specified cabinet/tag!
Hi,
It is not possible to upload a document while also adding to a cabinet and adding a tag. These operations must be done separately.
First, upload the document via the API as outlined here: https://docs.mayan-edms.com/chapters/rest_api.html
Then using the ID returned in the previous response, do two more requests: one to the tags API and the other to the cabinets API.
It is not possible to upload a document while also adding to a cabinet and adding a tag. These operations must be done separately.
First, upload the document via the API as outlined here: https://docs.mayan-edms.com/chapters/rest_api.html
Then using the ID returned in the previous response, do two more requests: one to the tags API and the other to the cabinets API.
Re: upload document with specified cabinet/tag!
Thanks, solved
-
- Posts: 6
- Joined: Tue Sep 17, 2019 7:33 am
Re: upload document with specified cabinet/tag!
Hi Bixmatech,
could you please add some code how you finally added the document to a cabinet?
I on my part had no luck so far. I tried python:
where parentId is a valid id of a cabinet and docId is the id returned when adding it to mayan.
However, the function returns ok but no document is added
Alternatively, I tried curl:
No response but also no document in the cabinet.
Any hints?
Thank you,
Ed
(I posted this question also in another thread, but that got no attention. Sorry, if this is considered a dupe)
could you please add some code how you finally added the document to a cabinet?
I on my part had no luck so far. I tried python:
Code: Select all
res=this.Session.post(this.Url+"/cabinets/"+str(parentId)+"/documents/",data={"documents_pk_list":str(docId)}).json()
However, the function returns ok but no document is added
Alternatively, I tried curl:
Code: Select all
curl -u admin:pass -X POST "http://127.0.0.1:8000/api/cabinets/11/documents/" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"documents_pk_list\":\"116\"}"
Any hints?
Thank you,
Ed
(I posted this question also in another thread, but that got no attention. Sorry, if this is considered a dupe)