List searches - Fluid Topics - Latest

Fluid Topics API Reference Guide

Category
Reference Guides
Audience
public
Version
Latest

This web service lists all saved searches that were previously added to the user's library.

Method Endpoint
GET
/api/users/{userId}/searches
Path parameter Type Description
{userId} String The user's identifier. See the List users or Search users web services to find a user's ID. It is also possible to get a user's ID from the Manage users menu.

Response body

The following lines show an example of a JSON response body:

[
  {
    "ownerId": "24502ba6-a2da-4db8-8ec1-c8d29f970454",
    "id": "a393cb2q-3070-4aaf-a134-917e154b4ceb",
    "title": "Search number one",
    "description": "Searching for topics about xyz",
    "color": "orange",
    "searchRequest": {
      "contentLocale": "en-US",
      "query": "xyz",
      "filters": [
        {
          "key": "ft:editorialType",
          "values": [
            "book"
          ],
          "negative": false
        }
      ],
      "metadataFilters": [
        {
          "key": "ft:editorialType",
          "valueFilter": {
            "values": [
              "book"
            ],
            "negative": false
          }
        },
        {
          "key": "Category",
          "rangeFilter": {
            "from": "2022-07-08",
            "to": "2022-10-13"
          }
        }
      ],
      "sort": [
        {
          "type": "NATURAL",
          "key": "afs:sort=versionFacet",
          "order": "DESC"
        }
      ],
      "periodFilter": {
        "key": "Category",
        "periodType": "CUSTOM",
        "period": {
          "from": "2022-07-08",
          "to": "2022-10-13"
        }
      }
    },
    "alert": true,
    "creationDate": "2023-10-22T15:10:07.126+00:00"
  }
]
Field Type Description
ownerId String The identifier of the user who owns the saved search.
id String The identifier of the saved search.
title String The title of the saved search.
description String The description of the saved search.
color String A color for the saved search's tag. Accepted values are black, green, blue, purple, red, orange, and yellow.
searchRequest Object The parameters of the saved search.
contentLocale String Indicates the language of the search results.
query String The terms of the search query.
metadataFilters Array Filters the results based on selected criteria including metadata and date ranges. Defaults to an empty list.
key String Expects a metadata key.
valueFilter Object Contains the filtering conditions based on metadata values.
values Array Defines the value for the selected key. When multiple values are defined, they are combined with an AND or an OR operator depending on the tenant's configuration.
negative Boolean When true, this parameter excludes results matching the previously defined values. By default, the negative parameter is implicit and false.
dateFilter Object Specifies the date-based filtering conditions using predefined periods.
type String Restricts results to those within a predefined period. Acceptable values are LAST_WEEK, LAST_MONTH, LAST_QUARTER, LAST_YEAR.
rangeFilter Object Specifies custom date range filtering.
from String The inclusive start date of the period. If unspecified, the default value is 1970-01-01.
to String The inclusive end date of the period. If unspecified, the default value is the current day.
sort Array Indicates if search results are sorted based on certain criteria.
key String A parameter prefixed by afs:sort that defines additional criteria by which to sort search results.
order String Defines the sort order. Possible values are ASC and DESC.
type String The sorting method to be applied to search results. Possible values are ALPHA (lexicographic order) and NATURAL (natural sort order).
periodFilter Object Filters search results by period.
key String The filter's metadata key.
periodType String Defines the type of period by which to filter the search results. Possible values include LAST_WEEK,LAST_MONTH, LAST_YEAR and CUSTOM.
period Object Defines the period by which to filter the search results.
from String The start date of the period.
to String The end date of the period.
alert Boolean Indicates whether alerts are enabled for this search.
creationDate String The date and time when the saved search was created.

The filters and periodFilter arrays are deprecated. Use the metadataFilters array instead. It combines the values of both arrays.

Return code Description
200 OK The request is valid and returns data.
401 UNAUTHORIZED The authorization header is absent or invalid.
403 FORBIDDEN The user or API key does not have the USERS_ADMIN or ADMIN role, or the user corresponding to the USER_ID parameter does not have the SAVED_SEARCH_USER role.
404 NOT FOUND No user exists with this ID.

For a comprehensive list of all possible return codes, see Return codes.