http://github.com/org/folio/mod-feesfines
Automated patron blocks API
GET /automated-patron-blocks/{userId}
Media type: application/json
Example:
{
"automatedPatronBlocks": [
{
"patronBlockConditionId": "2149fff5-a64c-4943-aa79-bb1d09511382",
"blockBorrowing": true,
"blockRenewals": false,
"blockRequests": false,
"message": "Patron has reached maximum allowed number of items charged out"
},
{
"patronBlockConditionId": "ac13a725-b25f-48fa-84a6-4af021d13afe",
"blockBorrowing": false,
"blockRenewals": false,
"blockRequests": true,
"message": "Patron has reached maximum allowed outstanding fee/fine balance for his/her patron group"
}
]
}
Invalid user ID in request
Media type: text/plain
Type: any
Example:
Bad request, e.g. invalid user UUID
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
POST /automated-patron-blocks/synchronization/job
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Synchronization job schema",
"properties": {
"id": {
"description": "Synchronization job ID",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"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 of re-sync data",
"enum": [
"user",
"full"
]
},
"userId": {
"type": "string",
"description": "Users ID for if scope is [user]",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"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}$"
},
"status": {
"description": "Status of synchronization job",
"type": "string"
},
"totalNumberOfLoans": {
"description": "Total number of loans",
"type": "integer"
},
"totalNumberOfFeesFines": {
"description": "Total number of fees/fines",
"type": "integer"
},
"numberOfProcessedLoans": {
"description": "Total number of processed loans",
"type": "integer"
},
"numberOfProcessedFeesFines": {
"description": "Total number of processed fees/fines",
"type": "integer"
},
"errors": {
"description": "Contains array of errors",
"type": "array",
"items": {
"type": "string"
}
},
"metadata": {
"description": "Metadata about creation and changes, 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"
]
}
Synchronization was done successfully
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Synchronization job schema",
"properties": {
"id": {
"description": "Synchronization job ID",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"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 of re-sync data",
"enum": [
"user",
"full"
]
},
"userId": {
"type": "string",
"description": "Users ID for if scope is [user]",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"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}$"
},
"status": {
"description": "Status of synchronization job",
"type": "string"
},
"totalNumberOfLoans": {
"description": "Total number of loans",
"type": "integer"
},
"totalNumberOfFeesFines": {
"description": "Total number of fees/fines",
"type": "integer"
},
"numberOfProcessedLoans": {
"description": "Total number of processed loans",
"type": "integer"
},
"numberOfProcessedFeesFines": {
"description": "Total number of processed fees/fines",
"type": "integer"
},
"errors": {
"description": "Contains array of errors",
"type": "array",
"items": {
"type": "string"
}
},
"metadata": {
"description": "Metadata about creation and changes, 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"
]
}
Example:
{
"id": "a28dc77a-995b-43d4-9af8-a7b345a13bce",
"scope": "user",
"userId": "92a16061-77e8-48d0-8434-717c17258f2c",
"status": "in-progress",
"totalNumberOfLoans": 10,
"totalNumberOfFeesFines": 10,
"numberOfProcessedLoans": 5,
"numberOfProcessedFeesFines": 5
}
Job request is not valid
Media type: text/plain
Type: any
Example:
The job is not valid
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
Media type: text/plain
Type: any
Example:
Internal server error, please contact administrator
Checks synchronization status of job
GET /automated-patron-blocks/synchronization/job/{syncJobId}
Media type: application/json
Example:
{
"id": "a28dc77a-995b-43d4-9af8-a7b345a13bce",
"scope": "user",
"userId": "92a16061-77e8-48d0-8434-717c17258f2c",
"status": "in-progress",
"totalNumberOfLoans": 10,
"totalNumberOfFeesFines": 10,
"numberOfProcessedLoans": 5,
"numberOfProcessedFeesFines": 5
}
The job was not found
Media type: text/plain
Type: any
Example:
Bad request, e.g. invalid user UUID
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
POST /automated-patron-blocks/synchronization/start
Synchronization job has been accepted for processing
Internal server error
Media type: text/plain
Type: any
Example:
Internal server error, please contact administrator