REST API interface
External devices use the REST API interface to communicate with the Octalarm alarm dialler.
Good to know: for each external device you want to connect, add a REST API interface in the dialler. The Octalarm alarm dialler supports multiple REST API interfaces, each with its own token.
Setting up REST API interface(s)
- Add a REST API interface.
Good to know: adding a REST API interface is done via Remote setup. See The portal: portal.octalarm.com and Remote setup (local) for further explanation.
- Request the token. You need this token to test the REST API interface with the OpenApi (Swagger) tool.
- Click info button (
i
). - Click
Copy token to clipboard
. - Click
Close
.
- Click info button (
- Verify the interface with the OpenApi (Swagger) tool. See Octalarm Link|General methods and responses: Authentication for further explanation.
- At Value in the authorisation screen, type Bearer followed by a space and paste the copied token.
- Click
Authorise
.
Note: repeat these steps for each external device you want to connect.
Setting watchdog mechanism
To monitor the connection between the external device and the Octalarm alarm dialler, set up a watchdog mechanism.
"POST: /Interface/Watchdog"
{
"next_kick_before_secs": 60
}
cURL code:
curl -X 'POST' \
'http://192.168.10.72/rest_api/1/Interface/Watchdog' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTI1MzQ0ODgsIm5iZiI6MTYxMjUzNDQ4OCwianRpIjoiNjY0NzI2NzAtYTRkMi00N2ZmLWFiMjUtNzAyMGYwOTkwNWJhIiwiZXhwIjoxNjEyNTM3OTg4LCJpZGVudGl0eSI6IlJFU1QtQVBJXzAwMDUiLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MiLCJ1c2VyX2NsYWltcyI6eyJ1c2VyX2lkIjo1LCJyb2xlX2lkIjo1LCJsYW5ndWFnZSI6Im5sLU5MIn19.6xlCrMjNsKd9Eyq5ieS-MScZe6P1idstMCKPs5dfOd8' \
-H 'Content-Type: application/json' \
-d '{
"next_kick_before_secs": 60
}'
Response:
{
"next_kick_before_secs": 60
}
Note: if you do not make a new watchdog request within the time specified by you, the Octalarm alarm dialler generates a system failure.