Event config (v1)

https://github.com/folio-org/mod-event-config

Table of contents

Event config

CRUD APIs for event configuration.

/eventConfig

Collection of eventConfig items.

GET /eventConfig

Get list of funds

GET /eventConfig
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.

    searchable using CQL

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    name==RESET_PASSWORD_EVENT
    
  • 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
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of eventConfig items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Event List",
  "type": "object",
  "properties": {
    "eventEntity": {
      "description":"event entries",
      "id": "eventEntriesData",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "event_config_entity.json"
      }
    },
    "totalRecords": {
      "description":"total records",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "eventEntity",
    "totalRecords"
  ]
}

Example:

{
  "eventEntity": [
    {
      "id": "0b1b7cac-f6fe-45ec-99f5-6758d54a51d7",
      "name": "RESET_PASSWORD_EVENT",
      "active": true,
      "templates": [
        {
          "templateId": "ed8c1c67-897b-4a23-a702-c36e280c6a93",
          "outputFormat": "text/plain",
          "deliveryChannel": "email"
        }
      ]
    }
  ],
  "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 eventConfig -- 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 eventConfig -- 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 /eventConfig

Create a new eventConfig item.

POST /eventConfig
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#",
  "description": "Event entity",
  "type": "object",
  "properties": {
    "id": {
      "description": "unique identifier of event",
      "type": "string"
    },
    "name": {
      "description": "unique configuration name for module configuration: RESET_PASSWORD, CREATE_PASSWORD and etc.",
      "type": "string"
    },
    "active": {
      "description": "configuration availability",
      "type": "boolean"
    },
    "templates": {
      "description": "templates list",
      "id": "templateData",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "event_template.json"
      }
    },
    "metadata": {
      "description": "metadata",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "active"
  ]
}

Example:

{
  "id": "0b1b7cac-f6fe-45ec-99f5-6758d54a51d7",
  "name": "RESET_PASSWORD_EVENT",
  "active": true,
  "templates": [
    {
      "templateId": "ed8c1c67-897b-4a23-a702-c36e280c6a93",
      "outputFormat": "text/plain",
      "deliveryChannel": "email"
    }
  ]
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created eventConfig item

Body

Media type: application/json

Type: any

Example:

{
  "id": "0b1b7cac-f6fe-45ec-99f5-6758d54a51d7",
  "name": "RESET_PASSWORD_EVENT",
  "active": true,
  "templates": [
    {
      "templateId": "ed8c1c67-897b-4a23-a702-c36e280c6a93",
      "outputFormat": "text/plain",
      "deliveryChannel": "email"
    }
  ]
}

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

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create eventConfig -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /eventConfig/{id}

Retrieve eventConfig item with given {eventConfigId}

GET /eventConfig/{id}
URI Parameters
  • id: 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#",
  "description": "Event entity",
  "type": "object",
  "properties": {
    "id": {
      "description": "unique identifier of event",
      "type": "string"
    },
    "name": {
      "description": "unique configuration name for module configuration: RESET_PASSWORD, CREATE_PASSWORD and etc.",
      "type": "string"
    },
    "active": {
      "description": "configuration availability",
      "type": "boolean"
    },
    "templates": {
      "description": "templates list",
      "id": "templateData",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "event_template.json"
      }
    },
    "metadata": {
      "description": "metadata",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "active"
  ]
}

Example:

{
  "id": "0b1b7cac-f6fe-45ec-99f5-6758d54a51d7",
  "name": "RESET_PASSWORD_EVENT",
  "active": true,
  "templates": [
    {
      "templateId": "ed8c1c67-897b-4a23-a702-c36e280c6a93",
      "outputFormat": "text/plain",
      "deliveryChannel": "email"
    }
  ]
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"eventConfig 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 /eventConfig/{id}

Delete eventConfig item with given {eventConfigId}

DELETE /eventConfig/{id}
URI Parameters
  • id: 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 eventConfig -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"eventConfig 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

PUT /eventConfig/{id}

Update eventConfig item with given {eventConfigId}

PUT /eventConfig/{id}
URI Parameters
  • id: 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#",
  "description": "Event entity",
  "type": "object",
  "properties": {
    "id": {
      "description": "unique identifier of event",
      "type": "string"
    },
    "name": {
      "description": "unique configuration name for module configuration: RESET_PASSWORD, CREATE_PASSWORD and etc.",
      "type": "string"
    },
    "active": {
      "description": "configuration availability",
      "type": "boolean"
    },
    "templates": {
      "description": "templates list",
      "id": "templateData",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "event_template.json"
      }
    },
    "metadata": {
      "description": "metadata",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "active"
  ]
}

Example:

{
  "id": "0b1b7cac-f6fe-45ec-99f5-6758d54a51d7",
  "name": "RESET_PASSWORD_EVENT",
  "active": true,
  "templates": [
    {
      "templateId": "ed8c1c67-897b-4a23-a702-c36e280c6a93",
      "outputFormat": "text/plain",
      "deliveryChannel": "email"
    }
  ]
}

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

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"eventConfig 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