|
Target URL
Syntax
- http[s]://servername[:port][/path[?params]]
Example target URL (without path and without parameters)
Variable replacement
In general, all elements that are available in the built in notification JSON can be used
as 'variables' within target URLs, custom headers and custom JSON.
The 'known' variables are listed below:
- $AppDisplayName
- $AppId
- $ClientVersion
- $Content
- $HostName
- $TimeStamp
- $Title
Example (with some of the available variables as parameter)
- http://acme.com/toasts?t=$Title&c=$Content&h=$HostName
In addition to the static variable names, any variable defined in "UserProperties" can be used
within target URLs, custom headers and custom JSON.
Example configuration with 'UserProperties'
{
...
"UserProperties": [
{ "Name": "Foo", "Value": "Doo" } ,
{ "Name": "Woo", "Value": "Zoo" } ]
...
}
Those properties can be used within the supported places the same way like the static
variables. Simply insert the name of the property prefixed with a dollar sign ('$')
at any supported place. On target invocation, the name token will be replaced with
corresponding value from configuration setting.
Example target URL (with 'UserProperties' names)
- http://acme.com/toasts?t=$Title&c=$Content&h=$HostName&p1=$Foo&p2=$Woo
Additional http header
Since version 25.4.0.0 of EZ Notification Forwarder a comma separated list of
custom `Name: value` items can be provided as additional http headers.
For example, the API `https://api.pushbullet.com/v2/pushes` requires a http header
item like: "Access-Token: PrivateApiAccessToken".
To escape literal commas (",") in tokens or strong passwords, use the css entity
code "\002C" as replacement for the commas. For example, an entry like
"Access-Token: Before\002CAfter" will evaluate to
"Access-Token: Before,After".
Custom JSON
Since version 25.4.0.0 of EZ Notification Forwarder a custom JSON can be defined
that shall be forwarded as payload data.
Example JSON for the PushBullet API:
{
"type": "note",
"title": "$Title",
"body": "$Content"
}
Filter by application name and message text
The dialogs "Add target" and "Edit Target" provide entry fields
where a list of comma separated values can be defined.
When filter values have been added, only those notifications that
contain either of the defined value in the application name or the
message body will be forwarded to the configured URL.
The compare is done "case insensitive".
Without any filter value all notifications will be
forwarded to the configured URL.
'JsonSerializationConfig'
Since version 24.1.0.0 of EZ Notification Forwarder the configuration setting
'JsonSerializationConfig' can be used to customize the JSON payload data.
Within the 'PropertiesToExclude' a coma separated list of element names
can be specified that shall _NOT_ be serialized as json.
Example configuration with 'JsonSerializationConfig':
{
...
"JsonSerializationConfig": {
"Indent": true,
"PropertiesToExclude": "HostName, Id, UserProperties"
}
...
}
Result
{
"Notifications": [
{
"Title": "Notification Title Text",
"Content": "Notification Body Text"
}
]
}
|