This web service creates a new static collection and adds it to the user's library.
Method | Endpoint |
---|---|
POST |
/api/users/{userId}/collections |
Path parameter | Type | Description |
---|---|---|
{userId} |
String | The user's identifier. |
Request example
The following lines show an example of a JSON request body:
{
"title": "My new static collection",
"description": "A static collection of topics about xyz",
"color": "green",
"documents": ["a7wNxXBLnM65nqk0xv14ug", "wuq~8lXw7YHaFWTkn~CFA"]
}
Field | Type | Required? | Description |
---|---|---|---|
title |
String | Yes | A name for the static collection. |
description |
String | Yes | A description of the static collection. |
color |
String | Yes | A color for the static collection's tag. Accepted values are black , green , blue , purple , red , orange , and yellow . |
documents |
Array | Yes | A comma-separated list of the identifiers of the documents to add to the static collection. Web services are available to retrieve the identifiers. See List maps for structured documents and List documents for unstructured documents. |
Return code | Description |
---|---|
201 CREATED |
The static collection was created. |
400 BAD REQUEST |
A required parameter is missing or an invalid color was provided for the collection's tag. |
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, the Collections feature is disabled for the portal, or an identifier provided for the documents parameter does not correspond to an existing document. |
Response body
The following lines show an example of a JSON response body:
{
"ownerId": "d433cb2q-8d2f-4aaf-a8fc-917e154b4ceb",
"id": "bf93cb2q-3070-4aaf-a134-917e154b4ceef",
"title": "My new static collection",
"description": "A static collection of topics about xyz",
"color": "green",
"documentsUrl": "https://fluid-topics/api/users/{userId}/collections/{collectionId}/documents",
"creationDate": "2022-10-22T15:10:07.126+00:00",
"lastUpdate": "2022-10-22T15:10:07.126+00:00"
}
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. |
color |
String | The color of the collection's tag. |
documentsUrl |
String | A URL to retrieve the list of documents in 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. |
Selecting the URL in the documentsUrl
section of the response body sends a GET
request to list information about each document, including URLs to access the collection's documents in the Reader page.