Configure Events & Actions
The Events & Actions section in the Admin Portal allows for creating, editing, and deleting event listeners and specific actions that these listeners handle.
Event Listeners
The Event Listeners section allows you to see the number and type of event listeners you created, their status, and the number of actions they're connected to. Upon hovering, you can see the name of the action linked to the event listener. For more information, read how to create event listeners.
Actions
The Actions section allows you to see the number and type of actions you created, their status, and the number of event listeners they're connected to. Upon hovering, you can see the name of the event listener linked to the action. For more information, read how to create actions.
Create Event Listener
To create an event listener:
-
Open Admin Portal and choose Events & Actions.
-
Select your app and the corresponding keyset.
-
Click the + Add Event Listener button and select the event source for your listener. For more information about event sources, refer to Event source.
-
Choose the event producer and event type.
Available producers and types
If you don't see your desired event type, choose a different event source.
-
Select a filter type for the event listener from the dropdown list. Depending on your event source and type selection, the flow for creating an event listener varies.
Name Description No filter No filtering done on conditions. Selecting this option triggers actions for all messages. Basic filters Predetermined conditions triggering an action selected from the UI. Advanced JSONPath Conditions triggering an action in a JSONPath format. -
You can pair your event listener with a previously created action without leaving the Event Listeners view. Search for the desired action in the Add Action dropdown to do this.
-
Save your newly created event listener by clicking the Save Changes button.
Filter types
There are three types of filters available:
No filter
This filter doesn't require any configuration. Selecting this option triggers actions for all messages.
Basic filters
After choosing Basic filters, you will see two dropdown lists, Filters and Conditions, and an input field labeled Value.
-
From the Filters dropdown list, select one of the available filters.
Name Description Channel Trigger an action after a message is published on a specific channel. Sender ID Trigger an action after a message is published by a specific sender. -
From the Conditions dropdown list, select one of the available conditions.
Name Description Exact Match Trigger an action only if there is an exact match. Contains Trigger an action if the specified value is found. -
In the Value field, type the value that must meet the selected condition. For example, choosing the exact match by the channel name
Matrix
will create an event listener that will trigger an action on every message published in theMatrix
channel.
Advanced JSONPath
Utilizing JSONPath allows for a much more robust setup of event handlers than basic filters.
You can use JSONPath to define the following conditions to trigger an action:
Condition name | Data type | Description |
---|---|---|
channel | string | Name of the channel the message was sent to. |
message | any | Message content. |
meta | any | Custom metadata. |
uuid | string | Sender ID. |
User ID / UUID
User ID is also referred to as UUID
/uuid
in some APIs and server responses but holds the value of the userId
parameter you set during initialization.
To recreate the example from Basic Filters, you can use the following JSONPath query:$.[?(@.channel == "Matrix")]
.
This will trigger an action when your message is published to the Matrix
channel.
Create Action
Choose the category of your action and follow the configuration steps for each action category.
Name | Description |
---|---|
Webhook | Allows for a third-party service integration. |
Amazon SQS | Allows you to use a third-party message queuing service. |
Amazon Kinesis | Allows you to use a real-time, streaming data analysis service. |
Amazon S3 | Allows you to use third-party object storage service. |
Apache Kafka | Allows you to export events to an Apache Kafka event streaming platform. |
IFTTT Webhook | Allows you to create chains of conditional statements and use them to automate actions between different services and devices. |
AMQP Action | Allows you to export events to Advanced Message Queuing Protocol (AMQP). |
Webhook payload example
The following JSON is an example of a webhook payload that is triggered when the message Wake up, Neo...
is sent by Client-w5h0y
on the channel Matrix
.
User ID / UUID
User ID is also referred to as UUID
/uuid
in some APIs and server responses but holds the value of the userId
parameter you set during initialization.
{
"event": {
"channel": "Matrix",
"eventCategory": "message",
"eventType": "message.publish",
"eventId": "a2748829-a16e-4ce7-b3ed-67021d2c7c65",
"eventPayload": {
"message": "{\"text\":\"Wake up, Neo...\"}",
"meta": {}
},
"iso8601timestamp": "2023-11-28T12:31:32Z",
"subscribeKey": "sub-c-95c7895c-b977-4728-bebe-f2e5db1b4f90",
"timetoken": "17011746925168240",
"senderId": "Client-w5h0y"
},
show all 32 linesFor more information about webhook payloads, refer to Webhooks.