Introduction
This programming guide discusses the REST API functionality built into Irisys Vector devices.
The REST API is just one of the many different methods of retrieving count data from a Vector device. It allows your software to pull various count data and other information from the Vector, as and when required, for use in end user reporting software.
Alternative data retrieval methods are the MQTT, HTTP Post, BACnet and relay outputs via the optional USB IO module.
A lot of the data output relies on the device being configured correctly, so make sure you follow the various configuration guides in order to do that. For example, data is logged internally against a time stamp, so ensure that the date and time is set correctly. Additionally, data is derived from count registers so correct configuration of the accompanying lines and zones so that they count accurately is also required.
Main REST API Documentation
The REST API is built into the Vector device, and the main API documentation is also built into the Vector.
It is done in this way so that any development changes to the API functions are automatically documented and updated. This ensures that any device has the correct documentation onboard for the functions that it is capable of. In all cases it is recommended that all devices are updated to the latest firmware version so that functionality is consistent.
Additionally, the built-in docs provide on-device testing functionality, which is extremely useful when developing your data reporting software.
As well as the onboard documentation, developers should also take a look at the REST API example apps stored online at the GitHub repository. Go to: https://github.com/IrisysUK
Accessing the REST API On Device
To access the REST API docs, simply connect to your Vector device via an IP address or URL connection. The API Docs are then accessed via the associated link in the Actions menu:
The REST API available on device is the same one used by Estate Manager, and with little modification, your reporting software could be made to communicate to a single device directly, or multiple devices via Estate Manager. To access the API Docs in Estate Manager, go to the ‘My Account’ section of the website:
Quick Start
For full details of what to do and how to do it, see the embedded API docs, and the sample apps available for download from the GitHub repository. Go to: https://github.com/IrisysUK
- [POST] /api/rt/v1/TokenProvider/get_token : get “Bearer Token”
- [POST] /api/rt/v1/connection/create : get Token
- [GET] /api/rt/v1/counts/countspage : get Jason data
- To prevent unauthorised persons from accessing count data, a key must be known. Each Vector has its own API key as shown below on the ‘Security’ tab, and Estate Manager has its own, as shown above.
Full details of how to use this API key, and the rest of the count data retrieval functionality, is available in the API docs links shown above.
Copyright © 2022 InfraRed Integrated Systems Limited
No part of this publication may be reproduced without prior permission in writing from InfraRed Integrated Systems Limited. This document gives only a general description of the products and except where expressly provided otherwise shall form no part of any contract. From time to time changes may be made in the products.