Configuration Settings API (v3.1)

https://github.com/folio-org/mod-oai-pmh

Table of contents

Configuration Settings API

API for managing OAI-PMH configuration settings

Configuration Settings

CRUD API for managing configuration settings

POST /oai-pmh/configuration-settings

Create a new configuration-setting item.

POST /oai-pmh/configuration-settings
Body

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"
  }
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created configuration-setting item

Body

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"
  }
}

Response 400

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.

Body

Media type: text/plain

Type: any

Example:

"unable to add configuration-setting -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create configuration-settings -- unauthorized

Response 422

Validation errors

Body

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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /oai-pmh/configuration-settings

Retrieve a list of configuration-setting items.

GET /oai-pmh/configuration-settings
Query Parameters
  • name: (string)

    Filter configuration settings by name (configName field)

  • totalRecords: (string - default: auto - pattern: exact|estimated|none|auto)

    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:

    none
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit 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:

    10

Response 200

Returns a list of configuration-setting items

Body

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
}

Response 400

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.

Body

Media type: text/plain

Type: any

Example:

unable to list configuration-settings -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list configuration-settings -- unauthorized

Response 422

Validation errors

Body

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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

PUT /oai-pmh/configuration-settings/{id}

Update configuration-setting item with given {configuration-settingId}

PUT /oai-pmh/configuration-settings/{id}
URI Parameters
  • id: required (string)
Body

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"
  }
}

Response 204

Item successfully updated

Response 400

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.

Body

Media type: text/plain

Type: any

Example:

"unable to update configuration-setting -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"configuration-setting not found"

Response 409

Optimistic locking version conflict

Body

Media type: text/plain

Type: any

Example:

version conflict

Response 422

Validation errors

Body

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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /oai-pmh/configuration-settings/{id}

Retrieve configuration-setting item with given {configuration-settingId}

GET /oai-pmh/configuration-settings/{id}
URI Parameters
  • id: required (string)

Response 200

Returns item with a given ID

Body

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"
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"configuration-setting not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /oai-pmh/configuration-settings/{id}

Delete configuration-setting item with given {configuration-settingId}

DELETE /oai-pmh/configuration-settings/{id}
URI Parameters
  • id: required (string)

Response 204

Item deleted successfully

Response 400

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.

Body

Media type: text/plain

Type: any

Example:

"unable to delete configuration-setting -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"configuration-setting not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator