The Flow Creator, the Notifier and the custom app must be installed on the same Edge Device. Open and login to the Flow Creator. The following chapters describe how to execute the Notifier OpenAPI requests step by step. All OpenAPI commands are executed via a http request.
A ready-to-use flow, that contains all these steps, can be downloaded here and imported into the Flow Creator.
In case of passing the defined limits of the KPI value, the custom app sends notifications to the Notifier. These notifications can also be listet in the Flow Creator by using the corresponding API request.
The following nodes are needed:
inject -- function -- http request -- debug
If you check the API documantation for this request, the parameter "notificationSource" is required. The function "set params" sets the mandatory parameter, which is later used in the URL of the http request:
msg.notificationSource = {}
msg.notificationSource = "KPI calculation app";
return msg;The http request node implements the corresponding Notifier API call:
Therefore you need to configure a GET request with the following URL:
http://notifier:4201/notificationservice/notifications/ext/active?notificationSource={{{notificationSource}}}
Deprecated API request
The deprecated API request (V1.0) also works. Therefore no parameter is necessary to send the API request.
The following nodes are needed:
inject -- http request -- debug
The http request node implements the corresponding Notifier API call:
Therefore you need to configure a GET request with the following URL:
http://notifier:4201/notificationservice/notifications
Testing the API request
To get all currently active notifications via these Flow Creator nodes, just trigger the inject node.
It is also possible to list just one specific notification which is active.
The following nodes are needed:
inject -- function -- http request -- debug
If you check the API documantation for this request, the parameters "notificationId" and "notificationSource" are necessary. The function "set params" sets the mandatory parameters, which are later used in the URL of the http request:
msg.notificationId = {}
msg.notificationSource = {}
msg.notificationId = "36";
msg.notificationSource = "KPI calculation app";
return msg;The http request node implements the corresponding Notifier API call:
Therefore you need to configure a GET request with the following URL:
http://notifier:4201/notificationservice/notifications/ext/active/{{{notificationId}}}?notificationSource={{{notificationSource}}}
Deprecated API request
The deprecated API request (V1.0) also works. Therefore only the parameter "notificationSource" is necessary.
The following nodes are needed:
inject -- function -- http request -- debug
The http request node implements the corresponding Notifier API call:
Therefore you need to configure a GET request with the following URL:
http://notifier:4201/notificationservice/notifications/{{{notificationId}}}
Testing the API request
To get the defined notification via these Flow Creator nodes, just trigger the inject node.
It is possible to accept an active notification.
The following nodes are needed:
inject -- function -- http request -- debug
If you check the API documantation for this request, the parameters "notificationId", "userId" and "notificationSource" are necessary. The function "set params" sets the mandatory parameters, which are later used in the URL of the http request:
msg.notificationId = {}
msg.userId = {}
msg.notificationSource = {}
msg.notificationId = "39";
msg.userId = "test@siemens.com"
msg.notificationSource = "KPI calculation app";
return msg;The http request node implements the corresponding Notifier API call:
Therefore you need to configure a PUT request with the following URL:
http://notifier:4201/notificationservice/notifications/{{{notificationId}}}/ext/accept?userId={{{userId}}}¬ificationSource={{{notificationSource}}}
Testing the API request
To accept a notification via these Flow Creator nodes, just trigger the inject node.
It is possible to clear an active notification.
The following nodes are needed:
inject -- function -- http request -- debug
If you check the API documantation for this request, the parameter "notificationId" is necessary. The function "set params" sets the mandatory parameter, which is later used in the URL of the http request:
msg.notificationId = {}
msg.notificationId = "14";
return msg;The http request node implements the corresponding Notifier API call:
Therefore you need to configure a PUT request with the following URL:
http://notifier:4201/notificationservice/notifications/{{{notificationId}}}/ext/clear
Testing the API request
To clear the defined notification via these Flow Creator nodes, just trigger the inject node.
It is possible to raise a further notification within the Flow Creator. The new notification gets an unique notificationId for identification.
The following nodes are needed:
inject -- function -- http request -- debug
If you check the API documantation for this request, a request body is necessary, containing "notificationTypeId", "eventText", "assetId" and "notificationSource". The function "set request body" sets the mandatory parameters within the request body for the http POST request.
msg.payload = {}
msg.payload={
'notificationTypeId': '3',
'eventText': 'INFO from Flow Creator',
'assetId': '<YourAssetId>',
'notificationSource': 'FlowCreator'
};
return msg;- notificationTypeId: 1 (alert) / 2 (warning) / 3 (information)
- eventText: message text (can be any string)
- assetId: id of asset in Data Service (looks like '549c3daa33cd4628b02c2e2745f54d80')
- notificationSource: who sended the notification, e.g. "KPI calculation app" (can be any string)
AssetId: To get the assetId, either look up in Data Service > select asset > copy id from URL OR execute a http request to GET notification and copy the assetId from the response.
The http request node implements the corresponding Notifier API call:
Therefore you need to configure a POST request with the following URL:
http://notifier:4201/notificationservice/notifications/ext/raise
Testing the API request
To send the defined notification via these Flow Creator nodes, just trigger the inject node.





















