Scheduled Notice Storage (v0.6)

http://localhost:9130

Table of contents

Scheduled Notice Storage API

Storage for scheduled notices

/scheduled-notice-storage

GET /scheduled-notice-storage/scheduled-notices

Retrieve a list of scheduled-notice items.

GET /scheduled-notice-storage/scheduled-notices
Query Parameters
  • 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
  • query: (string)

    A 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.

    with valid searchable fields

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    loanId=188522a4-a2df-4a48-ab3d-44b62daef27f
    

Response 200

Returns a list of scheduled-notice items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of scheduled notices",
  "type": "object",
  "properties": {
    "scheduledNotices": {
      "description": "List of items",
      "id": "scheduledNotices",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Scheduled patron notice",
        "properties": {
          "id": {
            "type": "string",
            "description": "UUID of scheduled task",
            "$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}$"
          },
          "loanId": {
            "type": "string",
            "description": "UUID of related loan for loan notices",
            "$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}$"
          },
          "requestId": {
            "type": "string",
            "description": "UUID of related request for request notices",
            "$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}$"
          },
          "feeFineActionId": {
            "type": "string",
            "description": "UUID of related action for fee/fine notices",
            "$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}$"
          },
          "recipientUserId": {
            "type": "string",
            "description": "Id of the user to whom this notice should be sent to",
            "$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}$"
          },
          "sessionId": {
            "type": "string",
            "description": "UUID which is the same for all notices generated in scope of the same check-in/check-out session",
            "$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}$"
          },
          "nextRunTime": {
            "type": "string",
            "format": "date-time",
            "description": "Next run time"
          },
          "triggeringEvent": {
            "type": "string",
            "description": "Scheduled notice triggering event",
            "enum": [
              "Hold expiration",
              "Request expiration",
              "Due date",
              "Overdue fine returned",
              "Overdue fine renewed",
              "Due date - with reminder fee",
              "Aged to lost",
              "Aged to lost - fine charged",
              "Aged to lost & item returned - fine adjusted",
              "Aged to lost & item replaced - fine adjusted",
              "Title level request expiration"
            ]
          },
          "noticeConfig": {
            "type": "object",
            "description": "Scheduled notice configuration",
            "properties": {
              "timing": {
                "type": "string",
                "description": "Timing represents when we need to send notice, before, at or after loan due date",
                "enum": [
                  "Upon At",
                  "Before",
                  "After"
                ]
              },
              "recurringPeriod": {
                "type": "object",
                "description": "Interval for recurring events",
                "$schema": "http://json-schema.org/draft-04/schema#",
                "properties": {
                  "duration": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
                  },
                  "intervalId": {
                    "type": "string",
                    "description": "Interval for the period, e.g. hours, days or weeks",
                    "enum": [
                      "Minutes",
                      "Hours",
                      "Days",
                      "Weeks",
                      "Months"
                    ]
                  }
                },
                "required": [
                  "duration",
                  "intervalId"
                ],
                "additionalProperties": false
              },
              "templateId": {
                "type": "string",
                "description": "UUID of related template",
                "$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}$"
              },
              "format": {
                "type": "string",
                "description": "Notice format",
                "enum": [
                  "Email",
                  "SMS",
                  "Print"
                ]
              },
              "sendInRealTime": {
                "type": "boolean",
                "description": "Real time notice flag"
              }
            },
            "additionalProperties": false,
            "required": [
              "timing",
              "templateId",
              "format"
            ]
          },
          "metadata": {
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "metadata.schema",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "type": "object",
            "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": [
          "nextRunTime",
          "noticeConfig"
        ]
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "scheduledNotices"
  ]
}

Example:

{
  "scheduledNotices": [
    {
      "id": "4413b99a-111a-48c0-a818-fa478cb0958e",
      "loanId": "188522a4-a2df-4a48-ab3d-44b62daef27f",
      "nextRunTime": "2018-09-01T00:00:00.000+00:00",
      "noticeConfig": {
        "timing": "Before",
        "recurringPeriod": {
          "duration": 1,
          "intervalId": "Days"
        },
        "templateId": "15cdf026-dbf5-4442-8e1b-fbc900256b56",
        "format": "Email",
        "sendInRealTime": true
      }
    }
  ],
  "totalRecords": 1
}

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 scheduled-notices -- 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 scheduled-notices -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /scheduled-notice-storage/scheduled-notices

Create a new scheduled-notice item.

POST /scheduled-notice-storage/scheduled-notices
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Scheduled patron notice",
  "properties": {
    "id": {
      "type": "string",
      "description": "UUID of scheduled task",
      "$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}$"
    },
    "loanId": {
      "type": "string",
      "description": "UUID of related loan for loan notices",
      "$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}$"
    },
    "requestId": {
      "type": "string",
      "description": "UUID of related request for request notices",
      "$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}$"
    },
    "feeFineActionId": {
      "type": "string",
      "description": "UUID of related action for fee/fine notices",
      "$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}$"
    },
    "recipientUserId": {
      "type": "string",
      "description": "Id of the user to whom this notice should be sent to",
      "$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}$"
    },
    "sessionId": {
      "type": "string",
      "description": "UUID which is the same for all notices generated in scope of the same check-in/check-out session",
      "$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}$"
    },
    "nextRunTime": {
      "type": "string",
      "format": "date-time",
      "description": "Next run time"
    },
    "triggeringEvent": {
      "type": "string",
      "description": "Scheduled notice triggering event",
      "enum": [
        "Hold expiration",
        "Request expiration",
        "Due date",
        "Overdue fine returned",
        "Overdue fine renewed",
        "Due date - with reminder fee",
        "Aged to lost",
        "Aged to lost - fine charged",
        "Aged to lost & item returned - fine adjusted",
        "Aged to lost & item replaced - fine adjusted",
        "Title level request expiration"
      ]
    },
    "noticeConfig": {
      "type": "object",
      "description": "Scheduled notice configuration",
      "properties": {
        "timing": {
          "type": "string",
          "description": "Timing represents when we need to send notice, before, at or after loan due date",
          "enum": [
            "Upon At",
            "Before",
            "After"
          ]
        },
        "recurringPeriod": {
          "type": "object",
          "description": "Interval for recurring events",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "templateId": {
          "type": "string",
          "description": "UUID of related template",
          "$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}$"
        },
        "format": {
          "type": "string",
          "description": "Notice format",
          "enum": [
            "Email",
            "SMS",
            "Print"
          ]
        },
        "sendInRealTime": {
          "type": "boolean",
          "description": "Real time notice flag"
        }
      },
      "additionalProperties": false,
      "required": [
        "timing",
        "templateId",
        "format"
      ]
    },
    "metadata": {
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "type": "object",
      "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": [
    "nextRunTime",
    "noticeConfig"
  ]
}

Example:

{
  "id": "4413b99a-111a-48c0-a818-fa478cb0958e",
  "loanId": "188522a4-a2df-4a48-ab3d-44b62daef27f",
  "nextRunTime": "2018-09-01T00:00:00.000+00:00",
  "noticeConfig": {
    "timing": "Before",
    "recurringPeriod": {
      "duration": 1,
      "intervalId": "Days"
    },
    "templateId": "15cdf026-dbf5-4442-8e1b-fbc900256b56",
    "format": "Email",
    "sendInRealTime": true
  }
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created scheduled-notice item

Body

Media type: application/json

Type: any

Example:

{
  "id": "4413b99a-111a-48c0-a818-fa478cb0958e",
  "loanId": "188522a4-a2df-4a48-ab3d-44b62daef27f",
  "nextRunTime": "2018-09-01T00:00:00.000+00:00",
  "noticeConfig": {
    "timing": "Before",
    "recurringPeriod": {
      "duration": 1,
      "intervalId": "Days"
    },
    "templateId": "15cdf026-dbf5-4442-8e1b-fbc900256b56",
    "format": "Email",
    "sendInRealTime": true
  }
}

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 scheduled-notice -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create scheduled-notices -- 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

DELETE /scheduled-notice-storage/scheduled-notices

Delete scheduled notices by cql query

DELETE /scheduled-notice-storage/scheduled-notices
Query Parameters
  • query: (string)

    A 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.

    with valid searchable fields

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    loanId=188522a4-a2df-4a48-ab3d-44b62daef27f
    

Response 204

Successful deletion

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /scheduled-notice-storage/scheduled-notices/{scheduled-noticeId}

Update scheduled-notice item with given {scheduled-noticeId}

PUT /scheduled-notice-storage/scheduled-notices/{scheduled-noticeId}
URI Parameters
  • scheduled-noticeId: required (string)
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Scheduled patron notice",
  "properties": {
    "id": {
      "type": "string",
      "description": "UUID of scheduled task",
      "$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}$"
    },
    "loanId": {
      "type": "string",
      "description": "UUID of related loan for loan notices",
      "$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}$"
    },
    "requestId": {
      "type": "string",
      "description": "UUID of related request for request notices",
      "$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}$"
    },
    "feeFineActionId": {
      "type": "string",
      "description": "UUID of related action for fee/fine notices",
      "$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}$"
    },
    "recipientUserId": {
      "type": "string",
      "description": "Id of the user to whom this notice should be sent to",
      "$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}$"
    },
    "sessionId": {
      "type": "string",
      "description": "UUID which is the same for all notices generated in scope of the same check-in/check-out session",
      "$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}$"
    },
    "nextRunTime": {
      "type": "string",
      "format": "date-time",
      "description": "Next run time"
    },
    "triggeringEvent": {
      "type": "string",
      "description": "Scheduled notice triggering event",
      "enum": [
        "Hold expiration",
        "Request expiration",
        "Due date",
        "Overdue fine returned",
        "Overdue fine renewed",
        "Due date - with reminder fee",
        "Aged to lost",
        "Aged to lost - fine charged",
        "Aged to lost & item returned - fine adjusted",
        "Aged to lost & item replaced - fine adjusted",
        "Title level request expiration"
      ]
    },
    "noticeConfig": {
      "type": "object",
      "description": "Scheduled notice configuration",
      "properties": {
        "timing": {
          "type": "string",
          "description": "Timing represents when we need to send notice, before, at or after loan due date",
          "enum": [
            "Upon At",
            "Before",
            "After"
          ]
        },
        "recurringPeriod": {
          "type": "object",
          "description": "Interval for recurring events",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "templateId": {
          "type": "string",
          "description": "UUID of related template",
          "$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}$"
        },
        "format": {
          "type": "string",
          "description": "Notice format",
          "enum": [
            "Email",
            "SMS",
            "Print"
          ]
        },
        "sendInRealTime": {
          "type": "boolean",
          "description": "Real time notice flag"
        }
      },
      "additionalProperties": false,
      "required": [
        "timing",
        "templateId",
        "format"
      ]
    },
    "metadata": {
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "type": "object",
      "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": [
    "nextRunTime",
    "noticeConfig"
  ]
}

Example:

{
  "id": "4413b99a-111a-48c0-a818-fa478cb0958e",
  "loanId": "188522a4-a2df-4a48-ab3d-44b62daef27f",
  "nextRunTime": "2018-09-01T00:00:00.000+00:00",
  "noticeConfig": {
    "timing": "Before",
    "recurringPeriod": {
      "duration": 1,
      "intervalId": "Days"
    },
    "templateId": "15cdf026-dbf5-4442-8e1b-fbc900256b56",
    "format": "Email",
    "sendInRealTime": true
  }
}

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 scheduled-notice -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"scheduled-notice 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 /scheduled-notice-storage/scheduled-notices/{scheduled-noticeId}

Retrieve scheduled-notice item with given {scheduled-noticeId}

GET /scheduled-notice-storage/scheduled-notices/{scheduled-noticeId}
URI Parameters
  • scheduled-noticeId: 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#",
  "type": "object",
  "description": "Scheduled patron notice",
  "properties": {
    "id": {
      "type": "string",
      "description": "UUID of scheduled task",
      "$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}$"
    },
    "loanId": {
      "type": "string",
      "description": "UUID of related loan for loan notices",
      "$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}$"
    },
    "requestId": {
      "type": "string",
      "description": "UUID of related request for request notices",
      "$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}$"
    },
    "feeFineActionId": {
      "type": "string",
      "description": "UUID of related action for fee/fine notices",
      "$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}$"
    },
    "recipientUserId": {
      "type": "string",
      "description": "Id of the user to whom this notice should be sent to",
      "$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}$"
    },
    "sessionId": {
      "type": "string",
      "description": "UUID which is the same for all notices generated in scope of the same check-in/check-out session",
      "$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}$"
    },
    "nextRunTime": {
      "type": "string",
      "format": "date-time",
      "description": "Next run time"
    },
    "triggeringEvent": {
      "type": "string",
      "description": "Scheduled notice triggering event",
      "enum": [
        "Hold expiration",
        "Request expiration",
        "Due date",
        "Overdue fine returned",
        "Overdue fine renewed",
        "Due date - with reminder fee",
        "Aged to lost",
        "Aged to lost - fine charged",
        "Aged to lost & item returned - fine adjusted",
        "Aged to lost & item replaced - fine adjusted",
        "Title level request expiration"
      ]
    },
    "noticeConfig": {
      "type": "object",
      "description": "Scheduled notice configuration",
      "properties": {
        "timing": {
          "type": "string",
          "description": "Timing represents when we need to send notice, before, at or after loan due date",
          "enum": [
            "Upon At",
            "Before",
            "After"
          ]
        },
        "recurringPeriod": {
          "type": "object",
          "description": "Interval for recurring events",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "properties": {
            "duration": {
              "type": "integer",
              "minimum": 0,
              "description": "Duration of the period, number of times the interval repeats; 0 should be used with days only and means until the end of the day"
            },
            "intervalId": {
              "type": "string",
              "description": "Interval for the period, e.g. hours, days or weeks",
              "enum": [
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months"
              ]
            }
          },
          "required": [
            "duration",
            "intervalId"
          ],
          "additionalProperties": false
        },
        "templateId": {
          "type": "string",
          "description": "UUID of related template",
          "$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}$"
        },
        "format": {
          "type": "string",
          "description": "Notice format",
          "enum": [
            "Email",
            "SMS",
            "Print"
          ]
        },
        "sendInRealTime": {
          "type": "boolean",
          "description": "Real time notice flag"
        }
      },
      "additionalProperties": false,
      "required": [
        "timing",
        "templateId",
        "format"
      ]
    },
    "metadata": {
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "type": "object",
      "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": [
    "nextRunTime",
    "noticeConfig"
  ]
}

Example:

{
  "id": "4413b99a-111a-48c0-a818-fa478cb0958e",
  "loanId": "188522a4-a2df-4a48-ab3d-44b62daef27f",
  "nextRunTime": "2018-09-01T00:00:00.000+00:00",
  "noticeConfig": {
    "timing": "Before",
    "recurringPeriod": {
      "duration": 1,
      "intervalId": "Days"
    },
    "templateId": "15cdf026-dbf5-4442-8e1b-fbc900256b56",
    "format": "Email",
    "sendInRealTime": true
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"scheduled-notice 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 /scheduled-notice-storage/scheduled-notices/{scheduled-noticeId}

Delete scheduled-notice item with given {scheduled-noticeId}

DELETE /scheduled-notice-storage/scheduled-notices/{scheduled-noticeId}
URI Parameters
  • scheduled-noticeId: 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 scheduled-notice -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"scheduled-notice 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