Send Emergency Alerts from a Desktop or URL
Note: You must be a Revolution admin to set this up.
You can send an individual notification by using a desktop shortcut that initiates a PowerShell script the triggers the notification or by creating a URL that triggers a notification when the URL is copied into a browser's address bar, and you press Enter.
Both 3rd-party integration methods require you to first
This is a two-step process. First, you'll create the user account and then you need to edit the account.
Create the user account
- Go to Users, Contacts & Sites > Users
- Select New User.
-
For Full Name and Username, enter values that help you identify this user account is for use with the Revolution WebAPI.
Our example uses the full name of the admin and webapi as the username.
-
For Email Address, enter a valid address. Note that this field is not yet used by the system. It can be anything you want.
Our example uses the email account for the admin.
- For Role, select WebAPI.
- For Allowed IP Addresses, enter a comma-separated list of IP address from which the WebAPI will be answered. An empty list allows all WebAPI calls with a valid token to be answered.
- Enter and confirm a Password. The password is not used by the PowerShell script; it's just a requirement of creating user accounts.
- Select Save.
Once you have a WebAPI user account, you can create a
You can create a desktop shortcut that runs a PowerShell script that triggers an emergency alert notification. This would be handy in a scenario where there is an emergency and time is of the essence, however:
- You are not logged into Revolution and cannot wait for the log in process AND
- You do not have access to the mobile app, either because it is not installed, or you do not have access to your mobile device.
There are three basic steps:
Here's an example:
$url = 'http://10.10.1.10' $notificationId = 'ab9876bc-e543-e321-09de-005056933527' $webapiToken = 'AZBxZjI4OTktN2FmOS00ZjI1LThkYWYtZGI2NzM0YzQ1XCYd' $wshell = New-Object -ComObject Wscript.Shell $intButton = $wshell.Popup("Click Okay to Activate Alert", 0, "Emergency Alert", 0x1) switch ($intButton) { 2 { exit; } } $activationUrl = [string]::Format("{0}/unifiedgui/webapi/Notifications/ ActivateNotification(notificationId={1},token='{2}')", $url, $notificationId, $webapiToken) $WebResponse = Invoke-RestMethod $activationUrl $wshell.Popup($WebResponse.Status, 0, "Done")
where...
- The variable
$url
is your Revolution server IP address -
The variable
$notificationId
is the GUID of the emergency alert notification you want sent.You can find the GUID by clicking on the specific emergency alert notification and copying it from the URL in the browser address bar.
-
The variable
$webapiToken
is the token of the WebAPI user account you created.You can find this by editing the user account you created and clicking the WebApi Token copy icon.
- Create a desktop shortcut to the PowerShell script you created.
-
Edit the Properties of the shortcut and select the Shortcut tab
-
Prepend the Target location path with:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -windowstyle hidden -ExecutionPolicy Bypass -File
-
Replace the contents of Start in with:
C:\WINDOWS\System32\WindowsPowerShell\v1.0
.
-
- Select OK to close the Properties window.
You may also want to create a URL that can be included with another application that will send a notification.
Here's how to create a URL:
{0}/unifiedgui/webapi/Notifications/ActivateNotification(notificationId={1},token='{2}')
where...
{0}
is your Revolution server IP address.-
{1}
is the GUID of the emergency alert notification you want sent. You can find the GUID by clicking on the emergency alert notification and copying it from the URL in the browser address bar. -
{2}
is the token of the WebAPI user account you created. You can find this by editing the user account you created and clicking the WebApi Token copy icon.
Example
http://10.10.1.10/unifiedgui/webapi/Notifications/ ActivateNotification(notificationId=ab9876bc-e543-e321-09de-005056933527,token= 'AZBxZjI4OTktN2FmOS00ZjI1LThkYWYtZGI2NzM0YzQ1XCYd')