List collections - Fluid Topics - Latest

Fluid Topics API Reference Guide

Category
Reference Guides
Audience
public
Version
Latest

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

Method Endpoint
GET /api/users/{userId}/collections
Path parameter Type Description
{userId} String The user's identifier.

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": "Collection number one",
    "description": "A collection of topics about xyz",
    "creationDate": "2023-10-22T15:10:07.126+00:00",
    "lastUpdate": "2023-11-09T11:54:03.121+00:00",
    "color": "orange",
    "documentsUrl": "https://fluid-topics/api/users/{userId}/collections/{collectionId}/documents"
  },
  {
    "ownerId": "87532-gt4g-3fn6-9gh2-b1d29h377422",
    "id": "g177gs2a-4199-4bts-n611-301360ab1arv",
    "title": "Collection number two",
    "description": "A collection of topics about abc",
    "creationDate": "2023-10-22T15:10:07.126+00:00",
    "lastUpdate": "2023-11-09T11:54:03.121+00:00",
    "color": "orange",
    "searchRequest": {
      "contentLocale": "en-US",
      "query": "abc",
      "filters": [
        {
          "key": "ft:editorialType",
          "values": ["book"],
          "negative": false
        }
      ],
      "sort": [
        {
          "type": "NATURAL",
          "key": "afs:sort=versionFacet",
          "order": "DESC"
        }
      ],
      "periodFilter": {
        "periodType": "CUSTOM",
        "period": {
          "from": "2022-07-08",
          "to": "2022-10-13"
        }
      }
    }
  }
]
Field Type Description
ownerId String The identifier of the user who owns the collection.
id String The identifier of the collection.
title String The name of the collection.
description String The description of the collection.
creationDate String The date and time when the collection was created.
lastUpdate String The date and time when the collection was last updated.
documentsUrl String A URL to retrieve the list of documents in the collection.
color String A color for the collection's tag. Accepted values are black, green, blue, purple, red, orange and yellow.
searchRequest Object The parameters of the search (for swift collections only).
    contentLocale String Indicates the language of the search results.
    query String The terms of the search query.
    filters Array The filters applied to the search query.
        key String The filter's metadata key.
        values String A list of values for the metadata key.
    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 Boolean 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 and NATURAL.
    periodFilter Array Filters search results by period.
        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 Array 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.

Selecting the URL in the documentsURL section of the response body sends a GET request to list information about each document, including a URL to access each document in the Reader page.

Return code Description
200 OK The request is valid and data is returned.
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 COLLECTION_USER role.
404 NOT FOUND No user exists with this ID.