Configurations API documentation version v1
http://github.com/org/folio/lsp-apis
Configuration API updating system wide configurations
This documents the API calls that can be made to update configurations in the system
/configurations
- Retrieve configurations for all modules associated with a specific institution.
- Add a module to the configuration tables
The JWT token limits the returned configurations to those of the calling institution
Retrieve a list of entry items.
Create a new entry item.
get /configurations/entries
Retrieve a list of entry items.
Headers
- Authorization: required (string)
Used to send a valid JWT token.
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
Query Parameters
- facets: (string - repeat: true)
facets to return in the collection result set, can be suffixed by a count of facet values to return, for example, patronGroup:10 default to top 5 facet values
- offset: (integer - default: 0 - minimum: 0 - maximum: 1000)
Skip over a number of elements by specifying an offset value for the query
- limit: (integer - default: 10 - minimum: 1 - maximum: 100)
Limit the number of elements returned in the response
Example:
10 - query: (string)
JSON array [{"field1","value1","operator1"},{"field2","value2","operator2"},...,{"fieldN","valueN","operatorN"}] with valid searchable fields: for example module = CIRCULATION
Example:
scope.institution_id=aaa
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
HTTP status code 200
Returns a list of entry items
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"configs": {
"id": "configurationData",
"type": "array",
"items": {
"type": "object",
"$ref": "kv_configuration.schema"
}
},
"totalRecords": {
"type": "integer"
},
"resultInfo": {
"$ref": "../raml-util/schemas/resultInfo.schema",
"readonly": true
}
},
"additionalProperties": false,
"required": [
"configs",
"totalRecords"
]
}
Example:
{
"configs": [
{
"module": "CIRCULATION",
"configName": "validation_rules",
"updatedBy": "joe",
"updatedDate": "2016.06.27.10.56.03",
"code": "PATRON_RULE",
"description": "for patrons",
"default": true,
"enabled": true,
"value": ""
}
],
"totalRecords": 1
}
HTTP status code 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
Type: text/plain
Example:
unable to list entries -- malformed parameter 'query', syntax error at column 6HTTP status code 401
Not authorized to perform requested action
Body
Type: text/plain
Example:
unable to list entries -- unauthorizedHTTP status code 403
Access denied, not valid privilege in resources
Body
Type: text/plain
Example:
UnauthorizedHTTP status code 422
Validation errors
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$ref": "error.schema"
}
},
"total_records": {
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Type: text/plain
Example:
internal server error, contact administratorpost /configurations/entries
Create a new entry item.
Headers
- Authorization: required (string)
Used to send a valid JWT token.
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[a-f0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"module": {
"type": "string"
},
"configName": {
"type": "string"
},
"code": {
"type": "string"
},
"description": {
"type": "string"
},
"default": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"value": {
"type": "string"
},
"userId": {
"type": "string"
},
"metadata": {
"$ref": "../raml-util/schemas/metadata.schema",
"readonly": true
}
},
"additionalProperties": false,
"required": [
"module",
"configName"
]
}
Example:
{
"module": "CIRCULATION",
"configName": "validation_rules",
"code": "PATRON_RULE",
"description": "for patrons",
"default": true,
"enabled": true,
"value": ""
}
HTTP status code 201
Returns a newly created item, with server-controlled fields like 'id' populated
Headers
- Location: (string)
URI to the created entry item
Body
Type: application/json
Example:
{
"module": "CIRCULATION",
"configName": "validation_rules",
"code": "PATRON_RULE",
"description": "for patrons",
"default": true,
"enabled": true,
"value": ""
}
HTTP status code 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
Type: text/plain
Example:
"unable to add entry -- malformed JSON at 13:3"
HTTP status code 401
Not authorized to perform requested action
Body
Type: text/plain
Example:
unable to create entries -- unauthorizedHTTP status code 403
Access denied, not valid privilege in resources
Body
Type: text/plain
Example:
UnauthorizedHTTP status code 422
Validation errors
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$ref": "error.schema"
}
},
"total_records": {
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Type: text/plain
Example:
Internal server error, contact administratorGet, Delete or Update a specific entry
Retrieve entry item with given {entryId}
Delete entry item with given {entryId}
Update entry item with given {entryId}
get /configurations/entries/{entryId}
Retrieve entry item with given {entryId}
URI Parameters
- entryId: required (string)
Headers
- Authorization: required (string)
Used to send a valid JWT token.
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
HTTP status code 200
Returns item with a given ID
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[a-f0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"module": {
"type": "string"
},
"configName": {
"type": "string"
},
"code": {
"type": "string"
},
"description": {
"type": "string"
},
"default": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"value": {
"type": "string"
},
"userId": {
"type": "string"
},
"metadata": {
"$ref": "../raml-util/schemas/metadata.schema",
"readonly": true
}
},
"additionalProperties": false,
"required": [
"module",
"configName"
]
}
Example:
{
"module": "CIRCULATION",
"configName": "validation_rules",
"code": "PATRON_RULE",
"description": "for patrons",
"default": true,
"enabled": true,
"value": ""
}
HTTP status code 401
No valid token found
Body
Type: text/plain
Example:
UnauthorizedHTTP status code 403
Access denied, not valid privilege in resources
Body
Type: text/plain
Example:
UnauthorizedHTTP status code 404
Item with a given ID not found
Body
Type: text/plain
Example:
"entry not found"
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Type: text/plain
Example:
internal server error, contact administratordelete /configurations/entries/{entryId}
Delete entry item with given {entryId}
URI Parameters
- entryId: required (string)
Headers
- Authorization: required (string)
Used to send a valid JWT token.
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
HTTP status code 204
Item deleted successfully
HTTP status code 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
Type: text/plain
Example:
"unable to delete entry -- constraint violation"
HTTP status code 401
No valid token found
Body
Type: text/plain
Example:
UnauthorizedHTTP status code 403
Access denied, not valid privilege in resources
Body
Type: text/plain
Example:
UnauthorizedHTTP status code 404
Item with a given ID not found
Body
Type: text/plain
Example:
"entry not found"
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Type: text/plain
Example:
Internal server error, contact administratorput /configurations/entries/{entryId}
Update entry item with given {entryId}
URI Parameters
- entryId: required (string)
Headers
- Authorization: required (string)
Used to send a valid JWT token.
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[a-f0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"module": {
"type": "string"
},
"configName": {
"type": "string"
},
"code": {
"type": "string"
},
"description": {
"type": "string"
},
"default": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"value": {
"type": "string"
},
"userId": {
"type": "string"
},
"metadata": {
"$ref": "../raml-util/schemas/metadata.schema",
"readonly": true
}
},
"additionalProperties": false,
"required": [
"module",
"configName"
]
}
Example:
{
"module": "CIRCULATION",
"configName": "validation_rules",
"code": "PATRON_RULE",
"description": "for patrons",
"default": true,
"enabled": true,
"value": ""
}
HTTP status code 204
Item successfully updated
HTTP status code 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
Type: text/plain
Example:
"unable to update entry -- malformed JSON at 13:4"
HTTP status code 401
No valid token found
Body
Type: text/plain
Example:
UnauthorizedHTTP status code 403
Access denied, not valid privilege in resources
Body
Type: text/plain
Example:
UnauthorizedHTTP status code 404
Item with a given ID not found
Body
Type: text/plain
Example:
"entry not found"
HTTP status code 422
Validation errors
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$ref": "error.schema"
}
},
"total_records": {
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Type: text/plain
Example:
internal server error, contact administratorRetrieve entries from the audit configuration table.
Retrieve a list of audit items.
get /configurations/audit
Retrieve a list of audit items.
Headers
- Authorization: required (string)
Used to send a valid JWT token.
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
Query Parameters
- offset: (integer - default: 0 - minimum: 0 - maximum: 1000)
Skip over a number of elements by specifying an offset value for the query
- limit: (integer - default: 10 - minimum: 1 - maximum: 100)
Limit the number of elements returned in the response
Example:
10 - query: (string)
JSON array [{"field1","value1","operator1"},{"field2","value2","operator2"},...,{"fieldN","valueN","operatorN"}] with valid searchable fields: for example module = CIRCULATION
Example:
scope.institution_id=aaa
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
HTTP status code 200
Returns a list of audit items
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"audits": {
"id": "auditData",
"type": "array",
"items": {
"type": "object",
"$ref": "audit.schema"
}
},
"totalRecords": {
"type": "integer"
}
},
"required": [
"audits",
"totalRecords"
]
}
Example:
{
"audits": [
{
"id": "8d850f8d-3433-41e3-b0da-0c4b2d9a384e",
"orig_id": "8d850f8d-1111-41e3-b0da-0c4b2d9a384e",
"operation": "I",
"creation_date": "",
"jsonb": {}
}
],
"totalRecords": 1
}
HTTP status code 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
Type: text/plain
Example:
unable to list audit -- malformed parameter 'query', syntax error at column 6HTTP status code 401
No valid token found
Body
Type: text/plain
Example:
UnauthorizedHTTP status code 403
Access denied, not valid privilege in resources
Body
Type: text/plain
Example:
UnauthorizedHTTP status code 422
Validation errors
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$ref": "error.schema"
}
},
"total_records": {
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Type: text/plain
Example:
internal server error, contact administrator