Scheduled Notice Storage (v0.1)

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
  • 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

    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
    
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

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",
        "$ref": "scheduled-notice.json"
      }
    },
    "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
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "UUID of scheduled task",
      "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}$"
    },
    "loanId": {
      "type": "string",
      "description": "UUID of related loan for loan notices",
      "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}$"
    },
    "requestId": {
      "type": "string",
      "description": "UUID of related request for request notices",
      "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}$"
    },
    "nextRunTime": {
      "type": "string",
      "format": "date-time",
      "description": "Next run time"
    },
    "noticeConfig": {
      "type": "object",
      "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",
          "$ref": "period.json",
          "description": "Interval for recurring events"
        },
        "templateId": {
          "type": "string",
          "description": "UUID of related template",
          "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}$"
        },
        "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": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "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#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of 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"
        }
      ]
    }
  ]
}

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
    
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

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)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "UUID of scheduled task",
      "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}$"
    },
    "loanId": {
      "type": "string",
      "description": "UUID of related loan for loan notices",
      "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}$"
    },
    "requestId": {
      "type": "string",
      "description": "UUID of related request for request notices",
      "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}$"
    },
    "nextRunTime": {
      "type": "string",
      "format": "date-time",
      "description": "Next run time"
    },
    "noticeConfig": {
      "type": "object",
      "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",
          "$ref": "period.json",
          "description": "Interval for recurring events"
        },
        "templateId": {
          "type": "string",
          "description": "UUID of related template",
          "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}$"
        },
        "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": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "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 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of 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"
        }
      ]
    }
  ]
}

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)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

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",
  "properties": {
    "id": {
      "type": "string",
      "description": "UUID of scheduled task",
      "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}$"
    },
    "loanId": {
      "type": "string",
      "description": "UUID of related loan for loan notices",
      "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}$"
    },
    "requestId": {
      "type": "string",
      "description": "UUID of related request for request notices",
      "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}$"
    },
    "nextRunTime": {
      "type": "string",
      "format": "date-time",
      "description": "Next run time"
    },
    "noticeConfig": {
      "type": "object",
      "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",
          "$ref": "period.json",
          "description": "Interval for recurring events"
        },
        "templateId": {
          "type": "string",
          "description": "UUID of related template",
          "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}$"
        },
        "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": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "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)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

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