https://github.com/folio-org/mod-oai-pmh
API for managing OAI-PMH configuration settings
CRUD API for managing configuration settings
Create a new configuration-setting item.
POST /oai-pmh/configuration-settingsMedia type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Configuration Setting DTO Schema",
"title": "Configuration Settings Schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the configuration entry"
},
"configName": {
"type": "string",
"description": "Name of the configuration group"
},
"configValue": {
"type": "object",
"description": "JSON configuration values"
}
},
"additionalProperties": false,
"required": [
"configName",
"configValue"
]
}Example:
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"configName": "behavior",
"configValue": {
"deletedRecordsSupport": "persistent",
"suppressedRecordsProcessing": "true",
"errorsProcessing": "200",
"recordsSource": "Source record storage"
}
}
Returns a newly created item, with server-controlled fields like 'id' populated
URI to the created configuration-setting item
Media type: application/json
Type: any
Example:
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"configName": "behavior",
"configValue": {
"deletedRecordsSupport": "persistent",
"suppressedRecordsProcessing": "true",
"errorsProcessing": "200",
"recordsSource": "Source record storage"
}
}
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 add configuration-setting -- malformed JSON at 13:3"
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to create configuration-settings -- unauthorizedValidation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "errors.schema",
"description": "A set of errors",
"type": "object",
"properties": {
"errors": {
"description": "List of errors",
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"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"
]
}
},
"total_records": {
"description": "Total number of errors",
"type": "integer"
}
}
}Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administratorRetrieve a list of configuration-setting items.
GET /oai-pmh/configuration-settingsFilter configuration settings by name (configName field)
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. Using limit=0 will return totalRecords with the exact value. For details about totalRecords see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example:
10Returns a list of configuration-setting items
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Configuration Collection DTO Schema",
"title": "Configuration Settings Collection Schema",
"type": "object",
"properties": {
"configurationSettings": {
"type": "array",
"description": "List of configuration settings",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Configuration Setting DTO Schema",
"title": "Configuration Settings Schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the configuration entry"
},
"configName": {
"type": "string",
"description": "Name of the configuration group"
},
"configValue": {
"type": "object",
"description": "JSON configuration values"
}
},
"additionalProperties": false,
"required": [
"configName",
"configValue"
]
}
},
"totalRecords": {
"type": "integer",
"description": "Total number of records"
}
},
"additionalProperties": false,
"required": [
"configurationSettings",
"totalRecords"
]
}Example:
{
"configurationSettings": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"configName": "behavior",
"configValue": {
"deletedRecordsSupport": "persistent",
"suppressedRecordsProcessing": "true",
"errorsProcessing": "200",
"recordsSource": "Source record storage"
}
},
{
"id": "123e4567-e89b-12d3-a456-426614174001",
"configName": "general",
"configValue": {
"enableOaiService": "true",
"repositoryName": "FOLIO_OAI_Repository",
"baseUrl": "http://folio.org/oai",
"administratorEmail": "oai-pmh@folio.org",
"timeGranularity": "YYYY-MM-DDThh:mm:ssZ"
}
}
],
"totalRecords": 2
}
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 configuration-settings -- malformed parameter 'query', syntax error at column 6Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to list configuration-settings -- unauthorizedValidation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "errors.schema",
"description": "A set of errors",
"type": "object",
"properties": {
"errors": {
"description": "List of errors",
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"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"
]
}
},
"total_records": {
"description": "Total number of errors",
"type": "integer"
}
}
}Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administratorUpdate configuration-setting item with given {configuration-settingId}
PUT /oai-pmh/configuration-settings/{id}Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Configuration Setting DTO Schema",
"title": "Configuration Settings Schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the configuration entry"
},
"configName": {
"type": "string",
"description": "Name of the configuration group"
},
"configValue": {
"type": "object",
"description": "JSON configuration values"
}
},
"additionalProperties": false,
"required": [
"configName",
"configValue"
]
}Example:
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"configName": "behavior",
"configValue": {
"deletedRecordsSupport": "persistent",
"suppressedRecordsProcessing": "true",
"errorsProcessing": "200",
"recordsSource": "Source record storage"
}
}
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 configuration-setting -- malformed JSON at 13:4"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"configuration-setting not found"
Optimistic locking version conflict
Media type: text/plain
Type: any
Example:
version conflictValidation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "errors.schema",
"description": "A set of errors",
"type": "object",
"properties": {
"errors": {
"description": "List of errors",
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"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"
]
}
},
"total_records": {
"description": "Total number of errors",
"type": "integer"
}
}
}Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administratorRetrieve configuration-setting item with given {configuration-settingId}
GET /oai-pmh/configuration-settings/{id}Returns item with a given ID
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Configuration Setting DTO Schema",
"title": "Configuration Settings Schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the configuration entry"
},
"configName": {
"type": "string",
"description": "Name of the configuration group"
},
"configValue": {
"type": "object",
"description": "JSON configuration values"
}
},
"additionalProperties": false,
"required": [
"configName",
"configValue"
]
}Example:
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"configName": "behavior",
"configValue": {
"deletedRecordsSupport": "persistent",
"suppressedRecordsProcessing": "true",
"errorsProcessing": "200",
"recordsSource": "Source record storage"
}
}
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"configuration-setting not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administratorDelete configuration-setting item with given {configuration-settingId}
DELETE /oai-pmh/configuration-settings/{id}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 configuration-setting -- constraint violation"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"configuration-setting not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator