Seach for existing documents using the API

Questions, comments, discussions. Over time certain topics might be moved to their own category.
Post Reply
Bastian
Posts: 12
Joined: Tue Dec 04, 2018 6:18 pm

Seach for existing documents using the API

Post by Bastian » Thu May 09, 2019 6:58 am

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
Bastian

Bastian
Posts: 12
Joined: Tue Dec 04, 2018 6:18 pm

Re: Seach for existing documents using the API

Post by Bastian » Fri May 10, 2019 8:45 am

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

Post Reply