This guide will help you test and implement a Command API that will allow an Alert automation to occur from a 3rd party emergency notification system. To know if your provider is compatible with our API, please check the list on our Command software page. For this document we will ensure that you can test and confirm the function of the API through Postman. Once this has been successful, please follow your emergency alert provider's documentation for specifics on how to use the API.
Before you start, please have the following available:
The latest .JSON file script for copy/paste: Command API v5
Alert image posted to a public URL (example: http://www.getcleartouch.com/media/CT24_Command-API-Test-Graphic-m3840-x-2160-px-1.png)
Alert audio posted to a public URL (example: http://www.getcleartouch.com/media/EmergencyBroadcastSystem_BW.12117.wav)
Text editor software
Familiarity with Postman: Postman Documentation
Command Organization Code and Device Groups setup correctly
Open a text document and record the Command Organization Code
Upload the Alert image to a public URL
Upload the Audio file to a public URL
Copy/paste the URL(s) into a text document
Download the image and import it into an MD5 hash utility. We use this: https://emn178.github.io/online-tools/md5_checksum.html
Download the audio file and import it into an MD5 hash utility.
Copy/paste the hash for each image and each audio file into a text document
Import the .JSON file into Postman (below is a description of the purpose for each POST or GET request)
Select “List Groups”
In the GET field replace {your school code} with your Command Organization Code.
Send the GET request
The Response field will generate a list of all the Groups with the “id” also known as “groudIds”. In the example below, the groups are listed and I can copy/paste the “id” of the “API Test” group.
Select “Send Alert With Groups”
Enter the following (already gathered) information
“code” = Command Organization Code
“groupIds” = “id” from List Groups GET request
“url” = public URL of Alert image
“md5” = MD5 hash generated by the utility
Select “Send” to send the Alert to the specified Group
Multiple groupIds can be entered.
Select “Send Image and Audio Alert Device Groups”
Enter the following (already gathered) information
“code” = Command Organization Code
“groupIds” = “id” from List Groups GET request
“url” = public URL of Alert image
“md5” = MD5 hash generated by the utility
“audioUrl” = public URL of Alert Audio file
“audioMd5” = MD5 hash generated by the utility
Select “Send” to send the Alert to the specified Group
Multiple groupIds can be entered
=======
In this case, we want to generate a Header for the payload so the request is secure and unique to each Alert. To accomplish this it is necessary to create a unique token by using a GET request. The following steps need to be taken after the Alert send has been tested and verified.
Select All and Copy the “Send Alert with Groups” script into a text editor
In the GET field replace {your school code} with your Command Organization Code.
Paste the Copied script into the Body field
Select “Send”
In the Body of the Response, Copy the “data” text as in the example below and paste it into a text editor
Select the POST “Send Alert With URL And Token” and view the “Headers”
Paste the Token in the Value field on the “x-open-token” row
Note: the x-open-app-key and the x-open-token will be entered into software that passes the payload with a Header instead of a Pre-Request Script.
Select the Body tab and copy/paste your original script into the field (example image below)
Select Send to confirm it is successful.
In this example, we will cancel the alert to a specific group. As with the Alert function, this can be specified to a Device Group or Device Groups. This is just a screenshot of the example payload used for guidance.
Select “Get Token for Cancel Alert” and enter the Organization Code in the GET request and in the Body of the text where it states “your school code”
Select “Send” and copy/paste the “data” text into a text editor (example image)
Select “Use the Token to Cancel and Alert”
Select Headers and Paste the Token in the Value field on the “x-open-token” row.
Select Body and enter the Command Organization Code in the “your school code” section
Enter the “groupIds” to designate the displays where the alert should be canceled.
Select “Send” to Cancel the Alert
This link will provide a guide for using the IP Integration within Centegix CrisisAlert: https://success.centegix.com/article/74-ip-integrations-overview