Generate Sample Payload for a Custom Event Source
A custom event listener is used to pass data to a target function whenever its URL is invoked by the end user. Custom event listeners can contain multiple rules, which can be associated with different target functions. All rules of a custom event listener have the same URL endpoint, but each rule will contain a unique rule identifier variable that you can configure while creating it. This allows you to indicate the specific rule to invoke.
You can generate a sample payload for a custom event by executing this same command:
However, Catalyst only accepts the following values for source and action for a custom event source:
Mandatory Command Options
You must also use these options mandatorily while generating a sample payload for a custom event:
-e | --event-bus <event_bus_name>
The –event-bus option performs the same action as discussed in the previous section. It enables you to specify the name of the event bus that must be used in the sample payload. The event_bus_details JSON will contain the name that you pass as the bus’s name.
-rid | --rule-id <rule_identifier>
The –rule-id option enables you to specify the rule identifier that must be used in the custom event payload. As mentioned earlier, a rule identifier uniquely identifies a rule in a custom event bus. The data field in the JSON will contain the rule identifier.
You can generate a sample payload for a custom event, and pass the event bus name and rule identifier by executing the following command:
This will generate the following JSON payload. The payload will contain the details of your project, event bus, and rule identifier details you provided, as well as other sample data.
Last Updated 2023-05-09 17:07:05 +0530 +0530
Send your feedback to us