I want to use mayan edms as a storage backend for documents where I can retrieve documents based on 2 metadata keys. I know this is possible with the index capability, but I fail to understand how to do this in the rest api. So I need an example how to define an index and how to retrieve documents using this index with the rest-api.
Asked
Active
Viewed 421 times
1 Answers
1
You need to create both indexes filtering rules to on your metadata keys: https://docs.mayan-edms.com/chapters/indexes/examples.html#index-document-by-department-taken-from-the-first-character-of-the-invoice-number-metadata
example:
{% if document.metadata_value_of.invoice_number.0 == "H" %}Human Resources
{% endif %}
When this is working you can do a rest API call:
as example: request.get('http://localhost/api/v4/index_instances/1/nodes/61/documents/')
https://docs.mayan-edms.com/chapters/rest_api.html#examples
together with the swagger api/swagger/ui
/ and redoc api/redoc/ui
and the django API api/v4
in your Mayan EDMS installation website should help you in the right direction.

Bastiaan Wakkie
- 303
- 3
- 9