How to send an Alarm using HTTP

In this article, you will learn about how you can send an alarm with HTTP. You will learn to install and configure an HTTP user and routing it to a Contact ID call. This solution offers you the capability to send an alarm remotely with the help of HTTP. This process will take about 20 minutes to perform. The article is detailed and easy to follow so you will have no problem completing it. We assume that you are familiar with the SMS communication technology and HTTP. Don’t waste any time! Let’s start!

How to setup the HTTP API user (Video tutorial)

In this video you will learn to setup a new HTTP user. It will start with adding a new HTTP user and end with a working user that can be accessed remotely with the help of the HTTP API. The video is short, easy to understand. It only takes 3 minutes to watch it. The video shows you how easy it is to setup a new HTTP user with the help of the Ozeki SMS Gateway. It offers you a very intuitive GUI so you will have no problem working with it. This new user will help you creating an HTTP alarm system.

Click the HTTP user’s install link

To have a working system that could send an Alarm using HTTP, you need to have an HTTP user. To install one, search for the Source button on the Ozeki Toolbar. It is located next to the Routes button. By clicking it, you will be presented with the Install alarm source install list. From there, choose the HTTP user list item (Figure 1). Click the blue Install button next to it to start the installation process.

add new http api user
Figure 1 - Add new HTTP API user

Provide login information

Now you need to provide the login information that will be used to access the system with the help of the HTTP API. Make sure to choose a username that is distinguishable and easy to remember. The password should be something hard to guess but easy to remember. If you have typed in both, click the Ok button to proceed with the setup.

http api username and password
Figure 2 - HTTP API username and password

Get help on the help page

If you are not familiar with the HTTP API of the Ozeki SMS Gateway, you can always get help on the Help tab of the HTTP user. Click it and you will be presented with a list of all the commands that is usable to control the API. The commands you need this time is in the SendMessage section (Figure 3). Click it to see all the commands and a short explanation for them.

http api sendmessage help page
Figure 3 - HTTP API sendmessage help page

Compose the HTTP API request

Using the help page, compose a HTTP API request. This request will tell the API, that you wish to send an alarm. This request must contain the provided username, the password, and the command you wish to give to the API. You could use notepad or any other coding environment to create the code. In the example we used notepad (Figure 4).

write the http api request
Figure 4 - Write the HTTP API request

Send the request

After the request was composed, open a browser. In the browser page, you can see the URL bar at the top of the window (Figure 5). Copy the request into the URL bar and hit enter. It will send the request to the API. Then the API will send the alarm and give you a respond. You will see the respond in your browser. As you can see on Figure 5, the respond contains the status of the message, the recipient’s address and the text of the SMS.

send http request
Figure 5 - Send HTTP request

Log of request received

If you open the Ozeki Alarm System app, you can check the log of the alarm system. Visit the Events tab to see the records of all the events. As you can see on Figure 6, you can see that the alarm you sent with the help of an HTTP request is visible as a log. Here you can get more information about the alarm you sent.

http request received
Figure 6 - HTTP request received

How to route an HTTP alarm message to a Contact ID call (Video tutorial)

In this video, you will learn how to route an HTTP alarm message to Contact ID call. It will start with turning in the created Contact ID sender and will end with the event records of the sent message. This video is short and easy to understand. It only takes 3:34 to watch it. At the end you will be able to route two connections together. This video is about the Ozeki Alarm System which offers you an intuitive GUI. You will have no problem working with the software.

Install contact ID sender

To setup a new system that will send a custom contact ID to the recipient’s phone number, you need to install a Contact ID sender. Click the Channels button located on the toolbar of the Ozeki Alarm System (Figure 7). It will open the Install notification channel install list. Click the Install button next to the Contact ID sender list item. It will open a page where you can configure the notification channel.

install contact id sender
Figure 7 - Install Contact ID sender

Customize notification channel

Now you need to provide the account details of a VoIP/SIP user. This information will be used to register you VoIP phone line into the VoIP service provider. You need to provide a display name, a username, a password, a domain and a port number for the connection. If you are finished, click the Ok button to proceed (Figure 8).

provide sip account details
Figure 8 - Provide SIP account details

Turn on the contact ID sender

To turn on the new contact ID sender, look for the Connection switch button. Click it to switch the button and start registering the SIP account. As you can see on Figure 9, you will see the registration process on the Events tab in details. After this step, you will have a working Contact ID Sender.

register to pbx
Figure 9 - Register to PBX

Set up a new route

Now you need to setup a new route for communication between the http user and the contact ID sender. To do so, click the Routes button located on the Toolbar of the Alarm System. Here you will see a list of all the existing routes. Click the blue Create new Route button (Figure 10). It will open a panel where you can customize your new route. In the Settings groupbox you need to provide the sender address and a receiver address. In the From textbox, select the http user’s address. In the To textbox, choose the contact ID sender’s address. This way, all the messages from the http user will be forwarded to the contact ID sender. After you finished the process, click the Ok button.

create routing rule
Figure 10 - Create routing rule

Configure the ID message

Now you can configure the ID message that you will send with the HTTP request. Click the Alerts tab in the contact ID sender details page. Click the Create new Contact ID message button to open the right-side panel where you can setup keyword (Figure 11). The alert will be sent if the keywords are detected. You can see some helpful information under the textbox.

create new contact id message
Figure 11 - Create new Contact ID message

Specify contact ID parameters

Now you need to customize the Alarm message. Scroll down until you see an Alarm message groupbox (Figure 12). There you will find 6 data field that you need to fill in. You need to provide an account number, a message type, an event qualifier, an event code, a partition number and a zone number. After you have finished setting up the Contact ID message details, click the Ok button.

specify contact id parameters
Figure 12 - Specify Contact ID parameters

Log of request received

Now you are finished with the setup process. You have a working alarm system. To check if all the components are working, send a test alarm using an HTTP request. After the message was sent, you can check the log of the request in the HTTP user’s events tab (Figure 13). This log will give you a proof that the system is working.

http request received
Figure 13 - HTTP request received

Contact ID sent

The second part of the system is the contact ID sender. You can check the log of it in the Events tab. (Figure 14). As you can see in case of a successful alarm, the contact ID sender will dial the predefined number, start the transmission, and send the contact ID. After it, the call will hang up.

contact id sent
Figure 14 - Contact ID sent

Examples for pre defined contact ID messages

Single alarm:

Multiple alarms:

Multiple alarms with delivery report callback: