Page 1 of 1

Seach for existing documents using the API

Posted: Thu May 09, 2019 6:58 am
by Bastian
Hi @all,

I wrote a small python script which is triggered when a new document is created or an existing document is changed in our ERP software.
When a document is modified I want to upload is as a new version of the same document into Mayan.

Is there a better (quicker) way to search for a specific document then using the generic "/api/documents" method which gives me a list of all documents?
With that I have to loop through all result pages to check if the document already exists or not.

Any help is appreciated

Re: Seach for existing documents using the API

Posted: Fri May 10, 2019 8:45 am
by Bastian
Hi again,

I'll try to reduce the search time now with searching only the documents of a single cabinet

So I'll determin the correct cabinet and search there, not in the whole system

with url: /api/cabinets/cabinetid/documents/

this should do the trick for now