Page 1 of 1

Search by file name using official API

PostPosted:Tue May 14, 2019 2:42 pm
by LauryMenton
Hi there,
I'm building a little system to make searches on my repo, so I can find and download specific doc file through my phone.

The problem is that I couldn't find any way to search files using file names. Is it possible? Available searches are:

Search simply by content:
Code: Select all
curl -u okmAdmin:admin -H "Accept: application/json" -X GET \
http://localhost:8080/OpenKM/services/rest/search/findByContent?content=santo+grial
Search by keyword:
Code: Select all
curl -u okmAdmin:admin -H "Accept: application/json" -X GET \
http://localhost:8080/OpenKM/services/rest/search/findByKeywords?keyword=santo\&keyword=grial
Or use a more customized search parameters:
Code: Select all
curl -u okmAdmin:admin -H "Accept: application/json" -X GET \
http://localhost:8080/OpenKM/services/rest/search/find?content=grial\&mimeType=application/pdf
Even can query by Property Groups:
Code: Select all
curl -u okmAdmin:admin -H "Accept: application/json" -X GET \
http://localhost:8080/OpenKM/services/rest/search/find?content=grial\&property='okp:name=alfa'

Re: Search by file name using official API

PostPosted:Tue May 14, 2019 3:17 pm
by LauryMenton
I just solved. It.

As an example:
Code: Select all
curl -u okmAdmin:admin -H "Accept: application/json" -X GET \
http://localhost:8080/OpenKM/services/rest/search/findByName?name=file_name
Documentation: https://docs.openkm.com/kcenter/view/ok ... earch.html

Re: Search by file name using official API

PostPosted:Thu May 16, 2019 4:52 pm
by jllort
You can try with:
Code: Select all
curl -u okmAdmin:admin -H "Accept: application/json" -X GET \
http://localhost:8080/OpenKM/services/rest/search/find?name=grial'
The latest OpenKM version comes with swagger what might help you
https://docs.openkm.com/kcenter/view/ok ... agger.html