Alerts are also available on the following dedicated topic so you don’t have to process all locations messages if you are only interested in alerts.
1 | {environment}/{API_key}/alerts |
It also contains a Message Pack payload, it has the following structure once unpacked:
4 | 'timestamp': timestamp in seconds from Epoch, required |
5 | 'alert_id': ID of the alert defined on NAO Cloud, required |
6 | 'alert_name': name of the alert defined on NAO Cloud, required |
7 | 'trackable_id': ID of the tag defined on NAO Cloud, required |
8 | 'tracking_id': MAC address of the tag, required |
9 | 'zone_ids': list of IDs of current zones, optional, only if there is a valid location |
10 | 'lon': longitude in decimal degrees, optional, only if there is a valid location |
11 | 'lat': latitude in decimal degrees, optional, only if there is a valid location |
12 | 'alt': altitude in meters, optional, only if there is a valid location |
13 | 'loc_uncertainty': accuracy in meters, optional, only if there is a valid location |
14 | 'loc_updated_at': timestamp in ms from Epoch, optional, only if there is a valid location |
15 | 'trigger': trigger of the location, optional, only if there is a valid location |
All the fields in the alert event, except ‘timestamp’, ‘alert_id’ and ‘alert_name’, come from the location update (sent on /locs) that triggered the alert. This means for example that if the NAO Track NG service is enabled, and a Simple Button Pressed alert is configured, then location updates with trigger “monitoring” will also trigger an alert with trigger “monitoring”.
You can obtain the metadata of tags, geofences and alerts using the REST API.