Asset Tracking Streaming API (Deprecated) Follow
This API has been deprecated and replaced by the newer Asset Tracking GRPC Streaming API (Go)
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: 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
There was a previous version, v1beta1
, but all clients should be moved tov1beta2
. The only difference was thatv1beta1
required the locations
namespace to be joined and did not supports tag zones.
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: Authenticate to the API)
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 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).
Example
For a JavaScript example, please go to the Asset Tracking Streaming API Example.
Comments
0 comments
Please sign in to leave a comment.