http://localhost
CRUD APIs used to manage settings for mod-users.
Collection of entry items.
Get a list of settings
GET /users/settings/entriesA query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.
CQL query
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
key==setting_key
How to calculate the totalRecords property. "exact" for the correct number, "estimated" for an estimation, "auto" to automatically select "exact" or "estimated", "none" for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example:
noneSkip over a number of elements by specifying an offset value for the query
Example:
0Limit the number of elements returned in the response
Example:
10Returns a list of entry items
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Collection of setting records",
"type": "object",
"properties": {
"settings": {
"description": "The list of settings in this collection",
"type": "array",
"id": "settings",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Setting",
"properties": {
"id": {
"description": "Identifier",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"scope": {
"type": "string",
"description": "Scope for this entry (normally a module)",
"enum": [
"mod-users"
]
},
"key": {
"type": "string",
"description": "Key within scope for this setting"
},
"value": {
"description": "Settings value (any type)"
},
"userId": {
"description": "Owner of this setting (optional)",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
},
"metadata": {
"description": "Metadata about creation and changes to setting, provided by the server (client should not provide)",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"additionalProperties": false,
"required": [
"scope",
"key",
"value"
]
}
},
"totalRecords": {
"description": "The number of setting records returned in this collection",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"settings",
"totalRecords"
]
}Example:
{
"settings": [
{
"id": "65de6432-be11-48ba-9686-a65101634040",
"key": "settingKey",
"scope": "mod-users",
"value": {
"someProperty": "value1",
"someOtherProperty": "value2"
},
"_version": 1
}
],
"totalRecords": 1
}
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
unable to list entries -- malformed parameter 'query', syntax error at column 6Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to list entries -- unauthorizedInternal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administratorAdd a new setting
POST /users/settings/entriesMedia type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Setting",
"type": "object",
"properties": {
"id": {
"description": "Identifier",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"scope": {
"type": "string",
"description": "Scope for this entry (normally a module)",
"enum": [
"mod-users"
]
},
"key": {
"type": "string",
"description": "Key within scope for this setting"
},
"value": {
"description": "Settings value (any type)"
},
"userId": {
"description": "Owner of this setting (optional)",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
},
"metadata": {
"description": "Metadata about creation and changes to setting, provided by the server (client should not provide)",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"additionalProperties": false,
"required": [
"scope",
"key",
"value"
]
}Example:
{
"id": "65de6432-be11-48ba-9686-a65101634040",
"key": "settingKey",
"scope": "mod-users",
"value": {
"someProperty": "value1",
"someOtherProperty": "value2"
}
}
Setting added
URI to the created entry item
Media type: application/json
Type: any
Example:
{
"id": "65de6432-be11-48ba-9686-a65101634040",
"key": "settingKey",
"scope": "mod-users",
"value": {
"someProperty": "value1",
"someOtherProperty": "value2"
},
"_version": 1,
"metadata": {
"createdByUserId": "0c799032-442e-4d01-8e68-8c46529ef978",
"createdDate": "2023-10-01T12:00:00Z",
"updatedByUserId": "0c799032-442e-4d01-8e68-8c46529ef978",
"updatedDate": "2023-10-01T12:00:00Z"
}
}
Bad Request
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}Media type: text/plain
Type: any
Example:
"unable to add entry -- malformed JSON at 13:3"
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to create entries -- unauthorizedInternal error
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}Media type: text/plain
Type: any
Example:
Internal server error, contact administratorRetrieve entry item with given {entryId}
GET /users/settings/entries/{id}The UUID of a setting
Returns item with a given ID
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Setting",
"type": "object",
"properties": {
"id": {
"description": "Identifier",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"scope": {
"type": "string",
"description": "Scope for this entry (normally a module)",
"enum": [
"mod-users"
]
},
"key": {
"type": "string",
"description": "Key within scope for this setting"
},
"value": {
"description": "Settings value (any type)"
},
"userId": {
"description": "Owner of this setting (optional)",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
},
"metadata": {
"description": "Metadata about creation and changes to setting, provided by the server (client should not provide)",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"additionalProperties": false,
"required": [
"scope",
"key",
"value"
]
}Example:
{
"id": "65de6432-be11-48ba-9686-a65101634040",
"key": "settingKey",
"scope": "mod-users",
"value": {
"someProperty": "value1",
"someOtherProperty": "value2"
},
"_version": 1,
"metadata": {
"createdByUserId": "0c799032-442e-4d01-8e68-8c46529ef978",
"createdDate": "2023-10-01T12:00:00Z",
"updatedByUserId": "0c799032-442e-4d01-8e68-8c46529ef978",
"updatedDate": "2023-10-01T12:00:00Z"
}
}
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"entry not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administratorDelete entry item with given {entryId}
DELETE /users/settings/entries/{id}The UUID of a setting
Item deleted successfully
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
"unable to delete entry -- constraint violation"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"entry not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administratorUpdate entry item with given {entryId}
PUT /users/settings/entries/{id}The UUID of a setting
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Setting",
"type": "object",
"properties": {
"id": {
"description": "Identifier",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"scope": {
"type": "string",
"description": "Scope for this entry (normally a module)",
"enum": [
"mod-users"
]
},
"key": {
"type": "string",
"description": "Key within scope for this setting"
},
"value": {
"description": "Settings value (any type)"
},
"userId": {
"description": "Owner of this setting (optional)",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
},
"metadata": {
"description": "Metadata about creation and changes to setting, provided by the server (client should not provide)",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"additionalProperties": false,
"required": [
"scope",
"key",
"value"
]
}Example:
{
"id": "65de6432-be11-48ba-9686-a65101634040",
"key": "settingKey",
"scope": "mod-users",
"value": {
"someProperty": "value1",
"someOtherProperty": "value2"
},
"_version": 1,
"metadata": {
"createdByUserId": "0c799032-442e-4d01-8e68-8c46529ef978",
"createdDate": "2023-10-01T12:00:00Z",
"updatedByUserId": "0c799032-442e-4d01-8e68-8c46529ef978",
"updatedDate": "2023-10-01T12:00:00Z"
}
}
Item successfully updated
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
"unable to update entry -- malformed JSON at 13:4"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"entry not found"
Optimistic locking version conflict
Media type: text/plain
Type: any
Example:
version conflictInternal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator