This web service updates a static collection that was previously added to the user's library.
Method | Endpoint |
---|---|
PUT |
|
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. |
{collectionId} |
String | The identifier of the static collection as retrieved when listing collections. |
- All query parameters are optional, but it is necessary to specify at least one.
- Only parameters included in the query are updated. Parameters not included in the query remain unchanged.
Request example
The following lines show an example of a JSON request body:
{
"title": "My updated static collection",
"description": "An updated 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 list maps or unstructured documents with their identifiers. See List maps for structured documents and List documents. |
Return code | Description |
---|---|
20O OK |
The collection was updated. |
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 identifier for the documents parameter does not correspond to an existing document or no collection matches the COLLECTION_ID . |
Response body
The following lines show an example of a JSON request body:
{
"ownerId": "d433cb2q-8d2f-4aaf-a8fc-917e154b4ceb",
"id": "bf93cb2q-3070-4aaf-a134-917e154b4ceef",
"title": "My updated static collection",
"description": "An updated static collection of topics about xyz",
"color": "green",
"documentsUrl": "https://doc.fluidtopics.com/api/users/{userId}/collections/{collectionId}/documents",
"creationDate": "2022-10-22T15:10:07.126+00:00",
"lastUpdate": "2022-11-05T15:17:25.101+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 at which the collection was created. |
lastUpdate |
String | The date and time at which the collection was last updated. |
Selecting the URL in the documentsUrl
section sends a GET
request to list information about each document. This includes URLs to access collection documents in the Reader page.