Bosch IoT Insights

Event Service

In Event Service, Bosch IoT Insights allows you to subscribe for events and to configure the respective action(s) which will be triggered when such an event is received.

Proceed as follows

On the left navigation, go to Admin > Event Service.

→ The Event Subscriptions tab is displayed and provides a list of all already configured subscriptions (if any), as well the opportunity to add subscriptions.

images/confluence/download/attachments/5770600322/event_service_navigation_item-version-1-modificationdate-1747815473000-api-v2.png


Prerequisites

To execute the following actions, you have to be assigned to the Admin role or higher.

Adding a subscription

To add a new event subscription:

  1. Click the + Add subscription button in the top right area (see the screenshot above).

  2. Select the option System Event.
    → The configuration editor is displayed.

    images/confluence/download/attachments/5770600322/create_new_event_subscription-version-1-modificationdate-1747815473000-api-v2.png
  3. In the Event configuration section, proceed as follows:

    1. In the Set as active checkbox, choose whether to activate the subscription now.

    2. In the Event field, select one of the predefined system events from the drop-down list.

    3. In the Subscription label field, add a label for the current event subscription.

    4. In the Mute period field, define the mute period in minutes until the next event will be sent out.

      This option is useful when you do not need to receive events too frequently.

    5. In the Condition Query section, you can further filter the events which you will receive.

      1. Choose between Simple Logic and Custom Query:

        • For Simple Logic, select a Path from the drop-down list, choose an Operator and a Data Type, and enter a Value.
          Then, click the + Add button to apply the condition.

          images/confluence/download/attachments/5770600322/simple_logic_example-version-1-modificationdate-1747815473000-api-v2.png
        • For Custom Query (see the screenshot below), write a MongoDB query whose condition must be met in order for the system to trigger the defined action(s).
          You can use the example which is automatically provided by the system in the Example Payload field for the selected event type.

    6. In the Example Payload area, you will find an example of the query specific for the selected event type.
      The screenshot below shows an example with the File Added event type:

      images/confluence/download/attachments/5770600322/example_payload_for_file_added-version-1-modificationdate-1747815472000-api-v2.png
  4. In the Actions section on the right, proceed as follows:

    1. Click the + Add Action button and select the relevant action type, namely HTTP-Request, E-Mail, or SMS.

      You must add at least one action which will be triggered when the subscribed event is received.

    2. Fill in the fields depending on the action type, as explained below.

    3. To remove an action, click the images/confluence/download/thumbnails/5770600322/delete-version-1-modificationdate-1747815473000-api-v2.png Remove icon in the action editor.

Proceed as follows:

If you selected the HTTP-Request action type:

  1. In the Action name field, enter a name for the action.

  2. Select an HTTP method.

  3. In the Request URL field, enter the URL of the request.

  4. In the Body tab, proceed as follows:

    1. In the Body Type field, select the relevant body type: Raw Data, Form Data, or Document.

      The Body type option allows you to specify the format of the request body when making requests to the REST API. It is not available for the GET and DELETE HTTP methods.

      1. For Raw Data, enter the request body in the Data field.

      2. For Form Data, enter a key-value pair.

      3. For Document, the system will send the matched document (defined in the data source) to the HTTP endpoint.

  5. In the Headers tab, proceed as follows:

    1. Click the + Add Header button for each header row that you wish to add.

    2. Enter a Header and a Value.

    3. To remove a header, use the images/confluence/download/thumbnails/5770600322/delete-version-1-modificationdate-1747815473000-api-v2.png Remove icon on its row.

  6. In the Authorization type field, specify the type of authorization to be used when making requests to the REST API.
    Select one of the following available options:

    1. The default option is Without Authentication.

    2. For Basic Auth:

      1. Click the + Set Configuration button.
        → The configuration dialog will open.

      2. In the Username field, enter the username.

      3. In the Password field, enter the password.

      4. Confirm with Save.

    3. For OAuth 2.0:

      1. Click the + Set Configuration button.
        → The configuration dialog will open.

      2. In the Grant Type drop-down list, select the type of credentials, namely Client Credentials or Password Credentials.

      3. Enter the Access Token URL.

      4. Enter the Client ID.

      5. Enter the Client Secret.

      6. If you selected Password Credentials as Grant Type, also enter the Username and the Password.

      7. In the Scope field, enter the scope.

      8. Confirm with Save.

    4. For OAuth 2.0 Bearer Token,

      1. Click the + Set Configuration button.
        → The configuration dialog will open.

      2. Enter the token.

      3. Confirm with Save.

    5. For Current User Session, be aware that this option only works for service domains that belong to the current project and not 3rd party applications.

  7. In the Retry Count field, define how many times the system will attempt the REST call again if it fails.

  8. See also an example of a configured HTTP-Request action in the Action examples section below.


If you selected the E-Mail action type:

  1. In the Action name field, enter a name for the action.

  2. In the Email recipients field, enter the email addresses of the people who will receive an email notification when an event is received.

  3. In the Subject field, enter the email subject.

  4. In the Message field, enter the body text of the email.

    With a placeholder like ${datapath} you can use dynamic content from the processed document for the email address, subject, and message.
    Strings for datetime values with the format yyyy-MM-dd'T'HH:mm[:ss[.SSS]]'Z' need to be explicitly followed by '?date', '?time' or '?datetime', e.g. ${timestamp?datetime}.

  5. See also an example of a configured email action in the Action examples section below.


If you selected the SMS action type:

  1. In the Action name field, enter a name for the action.

  2. In the SMS recipients field, enter the phone numbers which will receive an SMS when an event is received.

  3. In the Message field, enter the message body that should be read by the recipients.

    The character limit for a single SMS message is 160 characters. However, most modern phones and networks support concatenation; they segment and rebuild messages of up to 1600 characters.

    With a placeholder like ${datapath} you can use dynamic content from the processed document for the SMS recipients and message.
    Strings for datetime values with the format yyyy-MM-dd'T'HH:mm[:ss[.SSS]]'Z' need to be explicitly followed by '?date', '?time' or '?datetime', e.g. ${timestamp?datetime}.

  4. See also an example of a configured SMS action in the Action examples section below.

Action examples

Below you will find examples of the different action types configured for the File Added system event subscription.

HTTP-Request

Here is an example of a configured HTTP-Request action:

images/confluence/download/attachments/5770600322/rest_action_example_2-version-1-modificationdate-1747815472000-api-v2.png

The full Data of the example above can be found here:

E-Mail

Here is an example of a configured E-Mail action:

images/confluence/download/attachments/5770600322/email_action_example_2-version-1-modificationdate-1747815472000-api-v2.png

The full Message body of the example above can be found here:

SMS

Here is an example of a configured SMS action:

images/confluence/download/attachments/5770600322/sms_action_example-version-1-modificationdate-1747815472000-api-v2.png


Viewing the subscriptions

The already created subscriptions are automatically listed in the Event Subscriptions tab.

The Settings menu in the header bar allows you to define the number of results per page, as well as the columns which should be displayed.

images/confluence/download/attachments/5770600322/list_view_event_subscriptions-version-1-modificationdate-1747815473000-api-v2.png

Editing and deleting the subscriptions

To edit and delete an event subscription, use the corresponding icons on the row of the subscription.

When you click the images/confluence/download/thumbnails/5770600322/edit-version-1-modificationdate-1747815473000-api-v2.png Edit icon, the Update subscription view will open, where you can make the relevant changes and save them.

When you click the images/confluence/download/thumbnails/5770600322/delete-version-1-modificationdate-1747815473000-api-v2.png Delete icon, a confirmation dialog will open, where you should confirm your choice.