Alerts API

Alerts API

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:

1[
2    {
3 
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
16    }
17]

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.


    • Related Articles

    • Location API

      Overview Location API can be used to receive location information about all tags of a given site. Once subscribed to a topic, your application will receive MQTT messages. Each message contains a topic and a payload. Refer ot the “Connection and ...
    • Getting meta-data on tags, zones and alerts

      Tags The meta-data of tags can be retrieved via the REST API. Only users with one of the following roles can access the tracking REST API: Site creator Site admin Tracking manager The API authentication token is used for authentication, it can be ...
    • Duress Call API

      NAOSDK – Duress Call API An interface that allows you to send a duress call to NAOCloud with the alert level. NAOSDK API Android - boolean fireButtonPressedAlert(Context context, String alertName, TALERTLEVEL level) iOS - BOOL ...
    • Getting maps metadata

      Each NAO Cloud site has 1 or more buildings. Each building has 1 or more floors. The metadata of each site, building and floor can be retrieved via the REST API. Buildings To get information of all the buildings of the site, use the following API: ...
    • API Reference

      Android API Reference