Event notifications

Use these methods to manage event notifications that are delivered to Back Office users when certain events occur.

GET[host]api/v2/events/notifications/types

Get a list of events types

GET[host]/api/v2/events/notifications

Get a list of event notifications

GET[host]/api/v2/events/notifications/{notificationId}

Get event notification details

POST[host]/api/v2/events/notifications

Create a new event notification

PATCH[host]/v2/events/notifications/{notificationId}

Update an event notification

DELETE[host]/v2/events/notifications/{notificationId}

Delete an event notification

Use these methods to configure event listeners that are required to detect events of a few specific types.

GET[host]/api/v2/events/listeners

Get a list of event listeners

GET[host]/api/v2/events/listeners/{listenerId}

Get event listener details

POST[host]/api/v2/events/listeners

Add a new event listener

PATCH[host]/api/v2/events/listeners/{listenerId}

Update an event listener

DELETE[host]api/v2/events/listeners/{listenerId}

Delete an event listener

GET[host]/api/v2/events/listeners/types

Get an event types list

GET[host]/api/v2/events/listeners/handlers

Get a list of event handlers

GET[host]/api/v2/events/listeners/workflows

Get a list of event handler workflows


Get a list of events types

Use this method to get a list of event types that can trigger event notifications.

Request

Header parameters:

  • Authorization: Bearer <access_token>

GET[host]/api/v2/events/notifications/types

curl --location --request GET 'https://host.name/api/v2/events/notifications/types' \
--header 'Authorization: Bearer <token>'

Response

A response contains an array of string values specifying the event types configured in the Back Office.

RESPONSE EXAMPLE
[
  "EventLogUserTagged",
  "HedgingFailEvent",
  "NotifiableExceptionEvent",
  "TransactionVerifyingEvent",
  "SuccessfulRegistration",
  "TransferSuccessfulOperation",
  "PayoutSuccessfulOperation",
  "PaymentSuccessfulOperation",
  "ExchangeSuccessfulOperation",
  "AccountRequestEvent",
  "AddressRequestEvent",
  "ArchiveRequestEvent",
  "AvatarRequestEvent",
  "ClientTestsRequestEvent",
  "ClientTypeRequestEvent",
  "DeletingAccountRequestEvent",
  "DepositRequestEvent",
  "DocumentRequestEvent",
  "IBApplicationProviderRequestEvent",
  "InternalTransferRequestEvent",
  "ProfileRequestEvent",
  "TransferExternalRequestEvent",
  "TransferRequestEvent",
  "VerificationRequestEvent",
  "WithdrawRequestEvent",
  "TestPassing",
  "PayoutRequestInitialized"
]

Get a list of event notifications

Use this method to obtain a list of event notifications configured in the Back Office.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

The following filter parameters are available for this method:

event

The event type that triggers a notification.

userId

The identifier of a Back Office user that is added as a notification recipient.

The following sorting parameter is available for this method:

createTime

The data and time when an event notification was configured in the Back Office.

Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.

GET[host]/api/v2/events/notifications

curl --location --request GET 'https://host.name/api/v2/events/notifications?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[userId]=10&filter[event]=EventLogUserTagged' \
--header 'Authorization: Bearer <token>'

Response

A response contains an array of Event Notification objects providing information about the event notifications matching the request parameters.


Get event notification details

Use this method to obtain detailed information about a specific event notification.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

notificationId required

The identifier of an event notification.

GET[host]/api/v2/events/notifications/{notificationId}

curl --location --request GET 'https://host.name/api/v2/events/notifications/1' \
--header 'Authorization: Bearer <token>'

Response

A response contains an Event Notification object providing information about the specified event notification.


Create a new event notification

Use this method to configure a new event notification.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

Specify the following parameters for an event notification:

event string required

The event type that triggers a notification.

channels array required

An array of string values specifying channels through which notifications are delivered. Possible values:

  • email

  • sms

  • slack

  • telegram

userId integer required

The identifier of a Back Office user that you want to add as a notification recipient.

description integer required

The event notification description.

POST[host]/v2/events/notifications

curl --location --request POST 'https://host.name/api/v2/events/notifications' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "event": "EventLogUserTagged",
  "channels": [
    "email", 
    "slack"
  ],
  "userId": 10,
  "description": "Notifications about the notes and comments added on the Event log tab"
}'

Response

A response includes an Event Notification object providing information about the configured event notification.


Update an event notification

Use this method to update an event notification that was previously configured in the Back Office.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

notificationId required

The identifier of an event notification.

Body:

You can update the following field values:

event string

The event type that triggers a notification.

channels array

An array of string values specifying channels through which notifications are delivered. Possible values:

  • email

  • sms

  • slack

  • telegram

userId integer

The identifier of a Back Office user that you want to add as a notification recipient.

description integer

The event notification description.

PUT[host]/v2/events/notifications/{notificationId}

curl --location --request PATCH 'https://host.name/api/v2/events/notifications/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "event": "EventLogUserTagged",
  "channels": [
    "telegram",
    "sms",
    "slack"
  ],
  "userId": 10,
  "description": "Notifications about the notes and comments added on the Event log tab"
}'

Response

A response includes an Event Notification object providing information about the updated event notification.


Delete an event notification

Use this method to delete a specified event notification.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

notificationId required

The identifier of an event notification.

DELETE[host]/v2/events/notifications/{notificationId}

curl --location --request DELETE 'https://host.name/api/v2/events/notifications/1' \
--header 'Authorization: Bearer <token>'

Response

In case of success, no response body is returned.

Get a list of event listeners

Use this method to obtain a list of event listeners configured in the Back Office.

An event listener initializes a predefined action sequence when a specific event occurs.

Request

Header parameters:

  • Authorization: Bearer <token>

Query parameters:

The following filter parameter is available for this method:

enabled

If 1, only enabled event listeners are returned; otherwise, 0.

Refer to the Query parameters section in the API Overview for details on applying filter parameters.

GET[base]/api/v2/events/listeners/

curl --location --request GET 'https://host.name/api/v2/events/listeners?sort_order=desc&limit=10&offset=0&filter[enabled]=1&sort_by=createTime' \
--header 'Authorization: Bearer <token>'

Response

Body:

A response contains an array of Event Listener objects providing information about the event listeners matching the request parameters.


Get event listener details

Use this method to obtain detailed information about a specific event listener.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

listenerId required

The identifier of an event listener.

GET[base]/api/v2/events/listeners/{listenerId}

curl --location --request GET'https://host.name/api/v2/events/listeners/1' \
--header 'Authorization: Bearer <token>'

Response

Body:

A response contains an Event Listener object providing information about the specified event listener.


Add a new event listener

Use this method to add a new event listener.

Request

Header parameters:

  • Authorization: Bearer <token>

  • Content-Type: application/json

Body:

Specify the following parameters when adding a new event listener:

enabled boolean required

If true, an event listener is enabled; otherwise, false.

description string required

The event listener description.

type string required

The event type that is listened for. To get a list of event types, use the method to get an event types list.

handler string required

The name of an event handler. To find out an event handler’s name, use the method to get a list of event handlers.

eventHandlerProperties object required

The filtering options specified for an event handler.

workflow string required

The workflow name. To find out a workflow name, use the method to get a list of event handler workflows.

workflowProperties object required

The detailed information about the action sequence that takes place after an event occurs.

POST[host]/api/v2/events/listeners

curl --location --request POST 'https://host.name/api/v2/events/listeners' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "enabled": true,
  "description": "TransferEvent",
  "type": "B2B\\TCA\\EventHandler\\Events\\TransferEvent",
  "handler": "B2B\\TCA\\EventHandler\\Handlers\\TransferEventHandler",
  "workflow": "SendNotificationFlow",
  "workflowProperties": {},
  "eventHandlerProperties": {}
}'

Response

Body:

A response contains an Event Listener object providing information about the added event listener.


Update an event listener

Use this method to update a specified event listener.

Request

Header parameters:

  • Authorization: Bearer <token>

  • Content-Type: application/json

Path parameters:

listenerId required

The identifier of an event listener.

Body:

The following field values can be updated:

enabled boolean

If true, an event listener is enabled; otherwise, false.

description string

The event listener description.

handler string

The name of an event handler.

eventHandlerProperties object

The filtering options specified for an event handler.

workflow string

The workflow name.

workflowProperties object

The detailed information about the action sequence that takes place after the occurred event.

PATCH[host]/api/v2/events/listeners/{listenerId}

curl --location --request PATCH 'https://host.name/api/v2/events/listeners/1' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "enabled": true,
  "description": "TransferEvent",
  "handler": "B2B\\TCA\\EventHandler\\Handlers\\TransferEventHandler",
  "workflow": "SendNotificationFlow",
  "workflowProperties": {
    "emails": "user@example.com",
    "template": "TransferEvent"
  },
  "eventHandlerProperties": {
    "destination_platform": "3",
    "source_platform": "1",
    "min_amount": "1"
  }
}'

Response

Body:

A response contains an Event Listener object providing information about the event listener that was updated.


Delete an event listener

Use this method to delete a specified event listener.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

listenerId required

The identifier of an event listener.

DELETE[host]/api/v2/events/listeners/{listenerId}

curl --location --request DELETE 'https://host.name/api/v2/events/listeners/1' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, no response body is returned.


Get an event types list

Use this method to obtain a list of event types that can be listened for.

Request

Header parameters:

  • Authorization: Bearer <token>

GET[host]/api/v2/events/listeners/types

curl --location --request GET 'https://host.name/api/v2/events/listeners/types' \
--header 'Authorization: Bearer <token>'

Response

A response contains an array of string values specifying the event types that can be listened for.

RESPONSE EXAMPLE
[
  "B2B\\TCA\\ConfirmationProviders\\Events\\AccountBalanceReceived",
  "B2B\\TCA\\EventHandler\\Events\\TransferEvent",
  "B2B\\TCA\\Core\\Events\\Account\\AccountCreated",
  "B2B\\TCA\\EventHandler\\Events\\SuccessfulOperation"
]

Get a list of event handlers

Use this method to obtain a list of event handlers configured in the Back Office.

An event handler defines an action sequence that is initialized after a specific event occurs. In addition, it includes the filtering options for detecting only specific events that meet custom criteria.

Request

Header parameters:

  • Authorization: Bearer <token>

Query parameters:

The following filter parameter is required for this method:

type required

The event type to which an event handler is assigned.

GET[host]/api/v2/events/listeners/handlers

curl --location --request GET 'https://host.name/api/v2/events/listeners/handlers?filter[type]=B2B\TCA\ConfirmationProviders\Events\AccountBalanceReceived' \
--header 'Authorization: Bearer <token>'

Response

The response body includes the following fields:

key string

The name of an event handler routine.

fields array

An array of objects providing detailed information about the filtering options specified for an event handler.

workflows array

An array of string values specifying workflow names.

RESPONSE EXAMPLE
{
  "key": "B2B\\TCA\\ConfirmationProviders\\EventHandler\\AccountBalanceReceivedHandler",
  "fields": [
    {
        "id": null,
        "priority": null,
        "name": "min_balance",
        "label": {
            "value": "Send notification if account balance (EUR) less or equals",
            "raw": false,
            "hint": null
        },
        "type": "input",
        "rules": [
            "required",
            "regex:/^[0-9\\.]*$/"
        ],
        "initialValue": null,
        "options": [],
        "description": null,
        "hidden": false,
        "readonly": false,
        "data": null,
        "fields": null,
        "mask": null,
        "optionsType": null,
        "fieldToWatch": null,
        "change": false
    }
  ],
  "workflows": [
    "SendNotificationFlow"
  ]
}

Get a list of event handler workflows

Use this method to obtain a list of event handler workflows configured in the Back Office.

Request

Header parameters:

  • Authorization: Bearer <token>

Query parameters:

The following filter parameters are required for this method:

type required

The event type to which an event handler is assigned.

handler required

The name of an event handler routine.

Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.

GET[base]/api/v2/events/listeners/workflows

curl --location --request GET 'https://host.name/api/v2//events/listeners/workflows?filter[type]=B2B\TCA\ConfirmationProviders\Events\AccountBalanceReceived&filter[handler]=B2B\TCA\ConfirmationProviders\EventHandler\AccountBalanceReceivedHandler' \
--header 'Authorization: Bearer <token>'

Response

The response body includes the following fields:

alias string

The workflow name.

fields array

An array of objects providing detailed information about the action sequence that takes place after an event occurs.

RESPONSE EXAMPLE
{
  "alias": "SendNotificationFlow",
  "fields": [
    {
      "id": null,
      "priority": null,
      "name": "emails",
      "label": {
          "value": "Emails",
          "raw": false,
          "hint": null
      },
      "type": "input",
      "rules": [
          "required",
          {}
      ],
      "initialValue": null,
      "options": [],
      "description": null,
      "hidden": false,
      "readonly": false,
      "data": null,
      "fields": null,
      "mask": null,
      "optionsType": null,
      "fieldToWatch": null,
      "change": false
    },
    {
      "id": null,
      "priority": null,
      "name": "template",
      "label": {
          "value": "Template",
          "raw": false,
          "hint": null
      },
      "type": "input",
      "rules": [
          "required"
      ],
      "initialValue": null,
      "options": [],
      "description": null,
      "hidden": false,
      "readonly": false,
      "data": null,
      "fields": null,
      "mask": null,
      "optionsType": null,
      "fieldToWatch": null,
      "change": false
    }
  ]
}