Queries
You can query sources, sessions, and videos based on a title and description (or HotMark title and description, where applicable) by adding the "q" query parameter to the collection URL.
Queries are case-insensitive and search title, description, calypso:creator
, and HotMarks. For example: GET /apis/assets?q="My Search Term"
You can add filters for filtering categories. The filter format is as follows:
Example: Example: Example: Example: |
Operators:
IN ("value1", "value2", ..., "valueN")
– case-insensitive values in the set are ORed and the results are returned.NOT IN ("value1", "value2", ..., "valueN")
– case-insensitive values in the set are ORed and the negated results are returned."category" IN ("")
– returns all results that have this category regardless of value."category" NOT IN ("")
– returns all results that do not have this category.&
– Binary operand values are ANDed.
Label and value must be quoted. Label and value string must have special characters escaped (based on ECMA 262, 5th edition, Section 7.8.4 "String Literals").
The following special characters must be escaped:
Character | Escaped Character | Character | Escaped Character |
---|---|---|---|
" | \\" | \n | \\n |
\\ | \\\\ | \v | \\v |
\b | \\b | \f | \\f |
\t | \\t | \r | \\r |
For example, you can use JSON.stringify() to do the escaping. You need to encode the filter string with urlencode and append the encoded string after the "filter" parameter in the URL. For example:
GET /apis/assets?q="My Search Term"&filter=category%3A%3A%22Patient+ID%22+IN+
%28%22123%22%2C+%22456%22%2C+%22First%22%2C+%22Second%22%29+%26+
category%3A%3A%22Doctor%22+IN+%28%22john%22%2C+%22Bob%22%29