Patron Notice API (v1.1)

https://github.com/folio-org/mod-notify

Table of contents

mod-notify API

This documents the API calls that can be made to post patron notices for users

Patron Notice

API for sendig Patron Notices

POST /patron-notice

Send patron notice

POST /patron-notice
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",
  "description": "Patron Notice",
  "additionalProperties": false,
  "properties": {
    "recipientId": {
      "description": "The UUID of the receiving user",
      "type": "string"
    },
    "deliveryChannel": {
      "description": "delivery channel",
      "type": "string"
    },
    "templateId": {
      "description": "The UUID of the notice template",
      "type": "string"
    },
    "outputFormat": {
      "description": "Output format e.g email",
      "type": "string",
      "default": "text/html"
    },
    "lang": {
      "description": "Notice language",
      "type": "string",
      "default": "en"
    },
    "context": {
      "type": "object",
      "description": "Context object"
    }
  },
  "required": [
    "recipientId",
    "templateId",
    "deliveryChannel",
    "outputFormat"
  ]
}

Example:

{
  "recipientId": "e5f5a317-10a3-44e7-a944-0c3ac5a15940",
  "deliveryChannel": "email",
  "templateId": "e5f5a317-10a3-44e7-a944-0c3ac5a15940",
  "outputFormat": "text/html"
}

Response 200

Patron notice successfully sent

Response 422

Unprocessable entity, e.g. incorrect template id or recipient id

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "properties": {
          "message": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "parameters": {
            "type": "object",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Response 500

Internal Server Error

Body

Media type: text/plain

Type: any

Example:

Internal server error