API endpoints
FA01 | Create bookmark
POST | /favourites/bookmarks |
---|
User permission required
Remarks
- The parameter folderId defines all lists (folders) to add the bookmark.
- Duplicates for folderIds are not possible because of using a set.
- The folderId favorites is always used. If no folderId is specified, only favorites is used.
- If the folder favorites not exists, because a new user adds the first bookmark, then the folder favorites is created.
Query parameters
Name | Value | Occurence | Default |
---|---|---|---|
folderIds | ID of folder(s) | Multiple | - |
Response payload
Returns Bookmark JSON object:
{
"id": "rjzgAIgBdHmpxQQKvQHm",
"itemId": "IVMX3IRHKU725WR2HHT6VY2AFFS72FGK",
"description": "My important description",
"userId": "fachstelle_museum",
"type": "CULTURAL_ITEM",
"createdAt": 1683641908448,
"updatedAt": 1683641908448,
"keywordTool": {
"done": True
}
}
Status codes
- 200 = Bookmark created
- 400 = Item Id is missing (required)
- 401 = User is not authorized
- 500 = Internal server error
Related Use Case(s)
- UC01 | Create bookmark
- The user selects an object from an object list as a favorite.
- The user selects an object from an object list as a favorite.
Example call(s)
- Create bookmark in only main folder
- GET https://dev-ddb.fiz-karlsruhe.de/api/2/favourites/bookmarks
- Create bookmark in main folder and two additional folders
- GET https://dev-ddb.fiz-karlsruhe.de/api/2/favourites/bookmarks?folderIds=Sjszo4cBdHmpxQQKUvah&folderIds=rjwQKYgBdHmpxQQKKgSs
FA02 | Retrieve bookmark
GET | /favourites/bookmarks/{id} |
---|
User permission required
Response payload
Returns Bookmark JSON object:
{
"id": "rjzgAIgBdHmpxQQKvQHm",
"itemId": "IVMX3IRHKU725WR2HHT6VY2AFFS72FGK",
"description": "My important description",
"userId": "fachstelle_museum",
"type": "CULTURAL_ITEM",
"createdAt": 1683641908448,
"updatedAt": 1683641908448,
"keywordTool": {
"done": True
}
}
Status codes
- 200 = Bookmark found
- 401 = User is not authorized
- 404 = Bookmark ID not found
- 500 = Internal server error
Related Use Case(s)
- All info of a bookmark is retrieved to display it in the frontend.
FA03 | Retrieve bookmarks
GET | /favourites/bookmarks |
---|
User permission required
Query parameters
Name | Value | Occurence | Default |
---|---|---|---|
folderIds | ID of folder(s) | Multiple | - |
Response payload
Returns BookmarkResult JSON object:
{
"query": "user:"73611165cc142ae53176707d5a92e8f3",
"total": 4,
"offset": 0,
"size": 9999,
"bookmarks": [
{
"id": "rjzgAIgBdHmpxQQKvQHm",
"itemId": "IVMX3IRHKU725WR2HHT6VY2AFFS72FGK",
"description": "",
"userId": "fachstelle_museum",
"type": "CULTURAL_ITEM",
"createdAt": 1683641908448,
"updatedAt": 1683641908448,
"keywordTool": {
"done": False
},
},
{
"id": "nDxWtIgBdHmpxQQKNxNQ",
"itemId": "IVMX3IRHKU725WR2HHT6VY2AFFS72FGK",
"description": "Neues Lesezeichen",
"userId": "fachstelle_museum",
"type": "CULTURAL_ITEM",
"createdAt": 1683641908448,
"updatedAt": 1683641908448,
"keywordTool": {
"done": False
},
}
]
}
Status codes
- 200 = Bookmark(s) found
- 400 = Missing some search params
- 401 = User not authorized
- 500 = Internal server error
Related Use Case(s)
- Bookmarks according to certain criteria are retrieved to be displayed in the frontend.
FA04 | Update bookmark
PUT | /favourites/bookmarks/{id} |
---|
User permission required
Remarks
- The parameter folderId defines all lists (folders) to add the bookmark.
- Duplicates for folderIds are not possible because of using a set.
- The folderId favorites is always used. If no folderId is specified, only favorites is used.
- If the folder favorites not exists, because a new user adds the first bookmark, then the folder favorites is created.
Query parameters
Name | Value | Occurence | Default |
---|---|---|---|
userId | ID of user | Once | - |
itemIds | List of IDs | Multiple | - |
offset | Beginn offset of results | Once | -1 |
size | Size data of results | Once | -1 |
Request payload
Returns Bookmark JSON object:
{
"id": "rjzgAIgBdHmpxQQKvQHm", // Not used
"itemId": "IVMX3IRHKU725WR2HHT6VY2AFFS72FGK", // Not used
"description": "Another description", // Optional
"userId": "fachstelle_museum", // Not used
"type": "INSTITUTION", // Optional
"createdAt": 1683641908448, // Not used
"updatedAt": 1683641908448, // Not used
"keywordTool": { // Optional
"done": false
}
}
Response payload
Returns Bookmark JSON object:
{
"id": "rjzgAIgBdHmpxQQKvQHm",
"itemId": "IVMX3IRHKU725WR2HHT6VY2AFFS72FGK",
"description": "Another description",
"userId": "fachstelle_museum",
"type": "INSTITUTION",
"createdAt": 1683641908448,
"updatedAt": 1683641908555,
"keywordTool": {
"done": false
}
}
Status codes
- 200 = Bookmark updated
- 401 = User is not authorized
- 404 = Bookmark ID not found
- 500 = Internal server error
Related Use Case(s)
- UC07 | Change bookmark description
- A user changes the description of a bookmark.
- A user changes the description of a bookmark.
FA05 | Delete bookmark
DELETE | /favourites/bookmarks/{id} |
---|
User permission required
Query parameters
Name | Value | Occurence | Default |
---|---|---|---|
folderIds | ID of folder(s) | Multiple | - |
Status codes
- 200 = Bookmark deleted
- 401 = User is not authorized
- 404 = Bookmark ID not found
- 500 = Internal server error
Related Use Case(s)
- UC06 | Delete bookmarks in All Favorites
- A user deletes a bookmark from favorites (and the rest of the lists).
- A user deletes a bookmark from favorites (and the rest of the lists).
FA06 | Create folder
POST | /favourites/folders |
---|
User permission required
Request payload
Returns Folder JSON object:
{
"id": "73611165cc142ae53176707d5a92e8f3", // Not used
"title": "favorites", // Required
"description": "Das ist ein Test!", // Optional
"userId": "fachstelle_museum", // Not used
"publishingName": "xxx", // Optional
"createdAt": 1682070216141, // Not used
"updatedAt": 1683642142482, // Not used
"bookmarkIds": [ // Optional
"MESR_IcBosJ3rUWzhkJj",
"rjzgAIgBdHmpxQQKvQHm"
],
"institutionIds": [ // Optional
"MESR_IcBosJ3rUWzhkJj"
],
"blockingToken": "Test", // Optional
"blocked": true, // Optional
"published": true, // Optional
"keywordTool": { // Optional
"sentToAdmin": false
}
}
Response payload
Returns Folder JSON object:
{
"id": "73611165cc142ae53176707d5a92e8f3"
"title": "favorites",
"description": "Das ist ein Test!",
"userId": "fachstelle_museum",
"publishingName": "xxx",
"createdAt": 1682070216141,
"updatedAt": 1683642142482,
"bookmarksIds": [
"MESR_IcBosJ3rUWzhkJj",
"rjzgAIgBdHmpxQQKvQHm"
],
"institutionIds": [
"MESR_IcBosJ3rUWzhkJj"
],
"blockingToken": "Test",
"blocked": true,
"published": true,
"keywordTool": {
"sentToAdmin": false
}
}
Status codes
- 200 = Folder created
- 400 = Title attribute is missing
- 401 = User is not authorized
- 409 = Folder already exists
- 500 = Internal server error
Related Use Case(s)
- UC05 | Add personal folder
- A user creates a personal folder.
- A user creates a personal folder.
FA07 | Add bookmark to folder
POST | /favourites/{id}/bookmarks |
---|
User permission required
Remarks
- A bookmark could not be added to the main folder (favorites), because it is added to this folder when you create a bookmark.
- The folder ID and bookmark ID must exist before adding something.
Query parameters
Name | Value | Occurence | Default |
---|---|---|---|
bookmarkId | ID of bookmark to add | Once | - |
Status codes
- 200 = Bookmarks added
- 400 = Bookmark ID not exist
- 401 = User is not authorized
- 404 = Folder ID not exist
- 500 = Internal server error
Related Use Case(s)
- UC02 | Assign bookmarks to selected lists
- A user stores bookmarks (additionally) in personal lists.
- UC08 | Copy bookmarks from All Favorites to personal lists
- A user copies bookmarks into personal lists.
- UC14 | Copy bookmarks to another personal list
- A user copies bookmarks from a personal list to other personal lists.
- A user copies bookmarks from a personal list to other personal lists.
FA08 | Retrieve folder
GET | /favourites/folders/{id} |
---|
User permission required
Response payload
Returns Folder JSON object:
{
"id": "73611165cc142ae53176707d5a92e8f3"
"title": "favorites",
"description": "Das ist ein Test!",
"userId": "fachstelle_museum",
"publishingName": "xxx",
"createdAt": 1682070216141,
"updatedAt": 1683642142482,
"bookmarksIds": [
"MESR_IcBosJ3rUWzhkJj",
"rjzgAIgBdHmpxQQKvQHm"
],
"institutionIds": [
"MESR_IcBosJ3rUWzhkJj"
],
"blockingToken": "Test",
"blocked": true,
"published": true,
"keywordTool": {
"sentToAdmin": false
}
}
Status codes
- 200 = Folder found
- 401 = User is not authorized
- 404 = Folder not exist
- 500 = Internal server error
Related Use Case(s)
- All info of a list is retrieved to display it in the frontend.
FA09 | Retrieve bookmarks of a folder
GET | /favourites/folders/{id}/bookmarks |
---|
User permission required
Response payload
Returns BookmarkResult JSON object:
{
"query": "user:"73611165cc142ae53176707d5a92e8f3" AND folder:"p0Qyo4cBosJ3rUWznjiY"",
"total": 4,
"offset": 0,
"size": 9999,
"bookmarks": [
{
"id": "rjzgAIgBdHmpxQQKvQHm",
"itemId": "IVMX3IRHKU725WR2HHT6VY2AFFS72FGK",
"description": "",
"userId": "fachstelle_museum",
"type": "CULTURAL_ITEM",
"createdAt": 1683641908448,
"updatedAt": 1683641908448,
"keywordTool": {
"done": False
},
},
{
"id": "nDxWtIgBdHmpxQQKNxNQ",
"itemId": "IVMX3IRHKU725WR2HHT6VY2AFFS72FGK",
"description": "Neues Lesezeichen",
"userId": "fachstelle_museum",
"type": "CULTURAL_ITEM",
"createdAt": 1683641908448,
"updatedAt": 1683641908448,
"keywordTool": {
"done": False
},
}
]
}
Status codes
- 200 = Folder found
- 401 = User not authorized
- 404 = Folder not exist
- 500 = Internal server error
Related Use Case(s)
- UC04 | Retrieve bookmarks of a list
- The user retrieves bookmarks of a specified list.
- The user retrieves bookmarks of a specified list.
FA10 | Retrieve folders
GET | /favourites/folders |
---|
User permission required
Query parameters
Name | Value | Occurence | Default |
---|---|---|---|
userId | ID of user | Once | - |
title | Title of folder | Once | - |
offset | Beginn offset of results | Once | -1 |
size | Size data of results | Once | -1 |
Response payload
Returns FolderResult JSON object:
{
"query": "user:"73611165cc142ae53176707d5a92e8f3"",
"total": 19,
"offset": 0,
"size": 9999,
"folders": [
{
"id": "Sjszo4cBdHmpxQQKUvah",
"title": "Schiller",
"description": "",
"userId": "fachstelle_museum",
"publishingName": "dio",
"createdAt": 1682070262371,
"updatedAt": 1683642142787,
"bookmarksIds": ["MUSR_IcBosJ3rUWzmkLU"],
"institutionIds": Null,
"blockingToken": "",
"keywordTool": {
"sentToAdmin": false
},
"blocked": false,
"published": true},
{
"id": "rjwQKYgBdHmpxQQKKgSs",
"title": "favorites",
"description": "Das ist ein Test!",
"userId": "fachstelle_museum",
"publishingName": "xxx",
"createdAt": 1682070216141,
"updatedAt": 1683642142482,
"bookmarksIds": [],
"institutionIds": none,
"blockingToken": "Test",
"keywordTool": {
"sentToAdmin": false
},
"blocked": true,
"published": true
}
]
}
Status codes
- 200 = Folder(s) found
- 400 = Missing some search params
- 401 = User not authorized
- 500 = Internal server error
Related Use Case(s)
- UC03 | Listennamen eines Benutzers abrufen
- The user retrieves bookmarks of a specified list.
- The user retrieves bookmarks of a specified list.
FA11 | Update folder
POST | /favourites/folders/{id} |
---|
User permission required
Query parameters
Name | Value | Occurence |
---|---|---|
folderIds | ID of folder(s) | Multiple |
Request payload
Returns Folder JSON object:
{
"id": "Sjszo4cBdHmpxQQKUvah", // Not used
"title": "favorites", // Optional
"description": "Das ist ein Test!", // Optional
"userId": "fachstelle_museum", // Not used
"publishingName": "xxx", // Optional
"createdAt": 1682070216141, // Not used
"updatedAt": 1683642142482, // Not used
"bookmarksIds": [ // Optional
"MESR_IcBosJ3rUWzhkJj",
"rjzgAIgBdHmpxQQKvQHm"
],
"institutionIds": [ // Optional
"MESR_IcBosJ3rUWzhkJj"
],
"blockingToken": "Test", // Optional
"blocked": true, // Optional
"published": true, // Optional
"keywordTool": { // Optional
"sentToAdmin": false
}
}
Response payload
Returns Folder JSON object:
{
"id": "Sjszo4cBdHmpxQQKUvah",
"title": "favorites",
"description": "Das ist ein Test!",
"userId": "fachstelle_museum",
"publishingName": "xxx",
"createdAt": 1682070216141,
"updatedAt": 1683642142482,
"bookmarksIds": [
"MESR_IcBosJ3rUWzhkJj",
"rjzgAIgBdHmpxQQKvQHm"
],
"institutionIds": [
"MESR_IcBosJ3rUWzhkJj"
],
"blockingToken": "Test",
"blocked": true,
"published": true,
"keywordTool": {
"sentToAdmin": false
}
}
Status codes
- 200 = Folder updated
- 401 = User not authorized
- 404 = Folder ID not found
- 500 = Internal server error
Related Use Case(s)
- UC09 | Publish or privatize personal list
- A user publishes a list or make a published list private again.
- UC10 | Change properties of personal list
- Furthermore, the user can change name, description, private/public, name abbreviation of a personal list.
- Furthermore, the user can change name, description, private/public, name abbreviation of a personal list.
FA12 | Delete folder
DELETE | /favourites/folders/{id} |
---|
User permission required
Query parameters
Name | Value | Occurence |
---|---|---|
folderIds | ID of folder(s) | Multiple |
Status codes
- 200 = Folder deleted
- 400 = Folder favorite could not be deleted
- 401 = User not authorized
- 404 = Folder ID not found
- 500 = Internal server error
Related Use Case(s)
- UC11 | Remove personal list with bookmarks
- The user deletes a personal list with the contained bookmarks.
- The user deletes a personal list with the contained bookmarks.
FA13 | Delete bookmark from folder
DELETE | /favourites/folders/{id}/bookmarks/{bookmarkId} |
---|
User permission required
Remarks
- A bookmark could not be deleted from the main folder (favorites), because this is done only if the bookmark is deleted (see Delete Bookmark).
- The folder ID and bookmark ID must exist before deleting something.
Status codes
- 200 = Bookmark in Folder deleted
- 400 = Bookmark ID not found
- 401 = User not authorized
- 404 = Folder ID not found
- 500 = Internal server error
Related Use Case(s)
- FA13 | Delete bookmark from list
- A bookmark is removed from a personal list.
- A bookmark is removed from a personal list.
FA14 | Delete all bookmarks and folders
DELETE | /favourites/folders |
---|
User permission required
Query parameters
Name | Value | Occurence | Default |
---|---|---|---|
userId | ID of user to delete | Once | - |
Status codes
- 200 = Bookmarks and Folders deleted
- 401 = User not authorized
- 404 = User ID not found
- 500 = Internal server error
Related Use Case(s)
- A user deletes his account. Then the system first deletes all bookmarks in all lists of the user. Then all lists including favorites are deleted.
Model
Bookmark
Fields
Field | Data type | Description |
---|---|---|
id | String | ID of the bookmark (internal created by Elasticsearch) |
itemId | String | ID of the DDB object item |
description | String | User defined text to describe the list |
userId | String | AAS/LDAP managed ID of the User |
bookmarkType | String | Type of the bookmark |
createdAt | Long | Creation date of the folder in millis created by the DDB Backend |
updateAt | Long | Last Update date of the folder in millis created by the DDB Backend |
keywordTool | KeywordTool | Optional data for internal use in APD (for keyword tool) |
Description
- Model object to hold a bookmark (= favorites)
Remarks
- The possible types of a bookmark are:
- CULTURAL_ITEM | INSTITUTION | ENTITY | NEWSPAPER | ARTICLE
KeywordTool of Bookmark
Fields
Field | Data type | Description |
---|---|---|
Done | Boolean | Used in APD |
Description
- Model object to hold and transfer APD internal data
BookmarkResult
Fields
Field | Data type | Description |
---|---|---|
query | String | Summary of the executed query (for debugging use) |
total | Long | Total matches |
offset | Long | Used offset (default or send by the request) |
size | Long | Used size (default or send by the request) |
bookmarks | List<Bookmark> | List of the found bookmarks by the query |
Description
- Model object to hold bookmarks (depends of offset and size) by the query
Folder
Fields
Field | Data type | Description |
---|---|---|
id | String | ID of the folder (internal created by Elasticsearch) |
title | String | Title of the user list |
description | String | User defined text to describe the list |
userId | String | AAS/LDAP managed ID of the User |
publishingName | String | User Identifier if the list is published |
createdAt | Long | Creation date of the folder in millis created by the DDB Backend |
updateAt | Long | Last Update date of the folder in millis created by the DDB Backend |
bookmarkIds | Set<String> | List of related bookmarks IDs |
institutionIds | Set<String> | List of related institution IDs |
blockingToken | String | Optional token for internal use in APD |
blocked | Boolean | If the list is blocked for public use |
published | Boolean | If the list is published for public use |
keywordTool | KeywordTool | Optional data for internal use in APD (for keyword tool) |
Description
- Model object to hold a folder (= favorites list and user defined lists)
KeywordTool of Folder
Fields
Field | Data type | Description |
---|---|---|
sentToAdmin | Boolean | Used in APD |
Description
- Model object to hold and transfer APD internal data
FolderResult
Fields
Field | Data type | Description |
---|---|---|
query | String | Summary of the executed query (for debugging use) |
total | Long | Total matches |
offset | Long | Used offset (default or send by the request) |
size | Long | Used size (default or send by the request) |
folders | List<Folder> | List of the found folders by the query |
Description
- Model object to hold found folders (depends of offset and size) by the query