http://localhost
CRUD APIs used to manage settings for mod-email.
Collection of setting items.
Get a list of settings
GET /email/settingsA 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==EMAIL_SMTP_CONFIGURATION
Skip over a number of elements by specifying an offset value for the query
Example:
0Limit the number of elements returned in the response
Example:
10Requested language. Optional. [lang=en]
Returns a list of setting 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-email"
]
},
"key": {
"type": "string",
"description": "Key within scope for this setting"
},
"value": {
"description": "Settings value (any type)"
},
"userId": {
"type": "string",
"format": "uuid",
"description": "Owner of this setting (optional)"
},
"_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": [
"id",
"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": "smtp-configuration",
"scope": "mod-email",
"value": {
"host": "localhost",
"port": 502,
"username": "username",
"password": "password",
"ssl": true,
"trustAll": false,
"loginOption": "REQUIRED",
"startTlsOptions": "DISABLED",
"expirationHours": 24,
"authMethods": "CRAM-MD5 LOGIN PLAIN",
"from": "noreply@folio.org",
"_version": 1,
"emailHeaders": [
{
"name": "Reply-To",
"value": "noreply@folio.org"
}
]
}
}
],
"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 settings -- malformed parameter 'query', syntax error at column 6Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to list settings -- unauthorizedInternal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administratorAdd a new setting
POST /email/settingsRequested language. Optional. [lang=en]
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-email"
]
},
"key": {
"type": "string",
"description": "Key within scope for this setting"
},
"value": {
"description": "Settings value (any type)"
},
"userId": {
"type": "string",
"format": "uuid",
"description": "Owner of this setting (optional)"
},
"_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": [
"id",
"scope",
"key",
"value"
]
}Example:
{
"id": "65de6432-be11-48ba-9686-a65101634040",
"key": "smtp-configuration",
"scope": "mod-email",
"value": {
"host": "localhost",
"port": 502,
"username": "username",
"password": "password",
"ssl": true,
"trustAll": false,
"loginOption": "REQUIRED",
"startTlsOptions": "DISABLED",
"expirationHours": 24,
"authMethods": "CRAM-MD5 LOGIN PLAIN",
"from": "noreply@folio.org",
"emailHeaders": [
{
"name": "Reply-To",
"value": "noreply@folio.org"
}
]
},
"_version": 1
}
Setting added
URI to the created setting item
Media type: application/json
Type: any
Example:
{
"id": "65de6432-be11-48ba-9686-a65101634040",
"key": "smtp-configuration",
"scope": "mod-email",
"value": {
"host": "localhost",
"port": 502,
"username": "username",
"password": "password",
"ssl": true,
"trustAll": false,
"loginOption": "REQUIRED",
"startTlsOptions": "DISABLED",
"expirationHours": 24,
"authMethods": "CRAM-MD5 LOGIN PLAIN",
"from": "noreply@folio.org",
"emailHeaders": [
{
"name": "Reply-To",
"value": "noreply@folio.org"
}
]
},
"_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 setting -- malformed JSON at 13:3"
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to create settings -- 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 setting item with given {settingId}
GET /email/settings/{id}The UUID of a setting
Requested language. Optional. [lang=en]
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-email"
]
},
"key": {
"type": "string",
"description": "Key within scope for this setting"
},
"value": {
"description": "Settings value (any type)"
},
"userId": {
"type": "string",
"format": "uuid",
"description": "Owner of this setting (optional)"
},
"_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": [
"id",
"scope",
"key",
"value"
]
}Example:
{
"id": "65de6432-be11-48ba-9686-a65101634040",
"key": "smtp-configuration",
"scope": "mod-email",
"value": {
"host": "localhost",
"port": 502,
"username": "username",
"password": "password",
"ssl": true,
"trustAll": false,
"loginOption": "REQUIRED",
"startTlsOptions": "DISABLED",
"expirationHours": 24,
"authMethods": "CRAM-MD5 LOGIN PLAIN",
"from": "noreply@folio.org",
"emailHeaders": [
{
"name": "Reply-To",
"value": "noreply@folio.org"
}
]
},
"_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:
"setting not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administratorDelete setting item with given {settingId}
DELETE /email/settings/{id}The UUID of a setting
Requested language. Optional. [lang=en]
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 setting -- constraint violation"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"setting not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administratorUpdate setting item with given {settingId}
PUT /email/settings/{id}The UUID of a setting
Requested language. Optional. [lang=en]
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-email"
]
},
"key": {
"type": "string",
"description": "Key within scope for this setting"
},
"value": {
"description": "Settings value (any type)"
},
"userId": {
"type": "string",
"format": "uuid",
"description": "Owner of this setting (optional)"
},
"_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": [
"id",
"scope",
"key",
"value"
]
}Example:
{
"id": "65de6432-be11-48ba-9686-a65101634040",
"key": "smtp-configuration",
"scope": "mod-email",
"value": {
"host": "localhost",
"port": 502,
"username": "username",
"password": "password",
"ssl": true,
"trustAll": false,
"loginOption": "REQUIRED",
"startTlsOptions": "DISABLED",
"expirationHours": 24,
"authMethods": "CRAM-MD5 LOGIN PLAIN",
"from": "noreply@folio.org",
"emailHeaders": [
{
"name": "Reply-To",
"value": "noreply@folio.org"
}
]
},
"_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 setting -- malformed JSON at 13:4"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"setting 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