Tag Tracking API

Using the Meridian Tag Tracker API, you can listen for Tags entering a Proximity or Tag Zone.

To do this, you'll need the following:

  • Aruba Access Point Beacons and controllers configured to report to a specific Meridian location (For more on doing this, go to: http://docs.meridianapps.com/article/502-remote-beacons-management).
  • A valid Meridian Editor Location ID.
  • Aruba Tags deployed to your location.
  • An authenticated websocket connection to Meridian.
  • For Tag Zones: a Tag Zone drawn on a map in the Meridian Editor.

Connecting

The connection URL is: wss://tags.meridianapps.com/

The websocket is located at this path: /streams/v1beta2/tracking/websocket

Authenticating

To authenticate, send a socket event titled authenticate.

socket.emit('authenticate', [{token: $myAuthToken, locationID: $locationID}]);

If you receive the authenticated event, you've been authenticated. If you receive the unauthenticated event, something went wrong and you're not authenticated.

(For more on authenticating, go to: http://docs.meridianapps.com/article/374-token-authentication)

Subscribing

Once you've been authenticated, you can create a subscription to listen to specific events.

In general, this takes the form: socket.emit('subscribe', [{locationID: $locationID}]);

This would subscribe to events for an entire location, which is not recommended.

Subscribing to Proximity Zones

A proximity zone reports to the Editor whenever it observes a Tag. The Tag observer is most likely an APB. To subscribe to a proximity zone, you need to know its proxZoneID.

The proxZoneID is the observer's BLE MAC address, and not its Wi-Fi MAC address.

You can find an APB's BLE MAC address on its Beacons Detail page in the Meridian Editor if it's been placed on a map.

To subscribe to a specific proximity zone:

socket.emit('subscribe', [{proxZoneID: $proxZoneID, locationID: $locationID}]);

Subscribing to Area Zones

An area zone is a shape drawn on a map in the Meridian Editor. When a Tag is observed entering and exiting that area, that information is reported to the Editor. The Tag observer is most likely an APB. To subscribe to a zone, you need to know its areaZoneID.

The areaZoneID is the shape's unique ID in the Meridian Editor.

To subscribe to a specific zone:

socket.emit('subscribe', [{areaZoneID: $areaZoneID, locationID: $locationID}]);

Subscriptions and Data

Events data generated by subscriptions isn't stored. When you begin a subscription, you'll only receive events starting from that point in time.

Getting Zone Update Events

You'll get zone_update events if you subscribe to MAC, zoneID, mapID, or locationID. When you do, you'll get both asset_update and zone_update events.

You can handle these events as a socket listener with:

    socket.on('asset_update` function(data){//do_something})
    socket.on('zone_update` function(data){//do_something})

Triggering Zone Updates

The zone_update event is triggered when a Tag is first observed (on enter) or when a Tag isn't observed again after being observed (on exit).

The data returned is:

    {"zone_id":$zoneID, "tag_id":$tagId, "action": "enter", "timestamp": 1507917459356}
    {"zone_id":$zoneID, "tag_id":$tagId, "action": "exit", "timestamp":
    1507917492411}

The exit event is a timeout created when an observer has first observed a Tag and then not observed it for a certain amount of time.

Performance Expectations

The median time for on enter events to be triggered is ~17 seconds. The median time for on exit events is ~154 seconds (~2.5 minutes).

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.