Creating a notification task
The user can use Engagement on their API Manager to receive notifications based on the defined criteria.
Before you begin
You must have at least one active Analytics service to use Engagement in the API Manager. When you create your notification task, you must fulfill the following criteria:
- Each rule can have only up to 7 filter criteria and 5 triggers.
- Each trigger can have only up to 3 actions.
About this task
The Engagement feature in the API Manager helps the user to create complex workflows that automate tasks and enhance the overall API management experience. Based on the criteria defined while creating notification tasks, each user receives notifications.
Create a notification task
To use Engagement, click on the API
Manager and
specify the criteria as required.
- Configure a
destination
, which is the definition of the HTTP(S) endpoint that will receive the notification tasks. For more information, see Create a destination. - Configure a
rule
, which is the job that runs on a defined schedule and send queries to the data source. For more information, see Create a rule. - Configure a
trigger
, which define the conditions that generate events. For more information, see Add triggers. - Configure an
action
, which defines what happens after a notification task is triggered. For more information, see Add actions.
Create a destination
- Click the Destinations tab.
- Click Create and provide the following details:
- In the
Title
, provide a Title for the destination. - Optional: In the Description box, provide a description.
- In the
- Click Create.
Create a rule
- Click the Rules tab.
- Click Create and provide the following details:
- In the
Title
field, provide a Title for the rule. - In the Schedule section, specify a schedule to run this rule. You can specify a schedule either by defining a time interval or a cron string.
- Click Next to select data and define query.
- In the Select data section, select an option from the Data source list based on the data against which you want to run the rule.
- In the Query section, define the aggregation metric that you want to use for the query. The default is a count of matching records. You can also use mathematical aggregations for numerical fields, such as the maximum value or the average over a time period.
- In the Data time range for the last fields, enter the time range based on how far back in the past you want to run the search for matching data items.
- Click Add filter + to select up to 7 data filters to based on the data you want to include while running the query. You can use any of the analytics event record fields.
- Click Add group by + to select a group based on how
you want to group the selected data and streamline the target criteria. For example, a rule that
matches 10 API events with a status code of 500 within a 24-hour period can use
Group by
onapi_name
to call for 10 matching events for an individual API as opposed to a total across all events for all APIs. - Click Next to configure triggers.
Add triggers:
- Click Add trigger +. You can add up to 5 triggers.
- In the Trigger details section, provide a Title for the trigger and then, select the severity level and trigger condition from the corresponding lists.
- Define the numerical target, which allows a single rule to have multiple triggers with different severity and trigger conditions. When the specified criteria are met, each trigger can trigger up to 3 actions, which then invokes different endpoints or with different payloads.
Add actions:
- Click Add action + to configure the action that happens when the trigger criteria are met.
- In the Trigger action section, provide a title for the action, and from the Destination list, select the destination to be invoked when the criteria are met.
- Enable throttling and define the throttling window to prevent invoking multiple triggers for the same rule in the same time period.
- Provide a message subject and a payload value. Note: The message subject is not sent to the HTTP endpoint. The payload value acts as the HTTP body of the notification task that is sent to the destination endpoint
- In the
- Click Save.
- Click Finish.
What you did in this task
On your API Manager, you used Engagement to automate notification tasks based on the specified criteria. The Task status tab displays the latest notification tasks for each trigger.