Content Server Rest API 20.4 - Search

Options

Hello,

I am trying to use the Content Server Rest API to search in content server.

I have found two alternatives for searching:

### search in a special location : full text search
POST https://servername/OTCS2/cs.exe/api/v2/search HTTP/1.1
OTDSTicket: {{ticket}}
Cache-Control: no-cache

where1=*&location_id1=1896817



### search in special location: full text with LQL
POST https://servername/OTCS2/cs.exe/api/v2/search HTTP/1.1
OTDSTicket: {{ticket}}
Cache-Control: no-cache

where=*%20and%20OTLocation%3A1896817

Now I would like to additonally search for documents that have the category "Studies", as shown in the search form below.

How are these search parameters for the Category translated for the API?

How would the POST request look like?


Thanks.

Comments

  • what does the HTTP Request look like with that field included ? you can then take the same field name and value pairing to REST usually.

  • Thanks for your hints, I first could not figure out the syntax for searching for document which have a certain category. Now it works:


    ### search for full text "graz" and for a category

    ### studies category has id 2147812

    POST https://Servername/OTCS/cs.exe/api/v2/search HTTP/1.1

    OTDSTicket: {{ticket}}

    Cache-Control: no-cache


    where=graz* and OTDCategory:2147812