Zone Endpoints

Each count event targets a single zone, and Zones are bound together to form Venues. Zones are the basic count container of the TallyFi system.

Zones have two critical characteristics that impact their use:

  1. A capacity: a zone’s capacity will determine how many people can be counted into a zone before the device holder is alerted (via vibration).

  2. Type (see subZone property). If a zone current capacity should be added to the capacity for a venue as a whole, it will have the subZone property set to false.

A venue’s capacity is the sum of non-subZone (== false) zones, and its current count is likewise the sum of the current count for all non-subZone zones.

Sub-zones are special containers that exist to keep parallel, but unrelated counts, for things like tracking entrances and exits to special smoking areas.

List All

GET /api/1.0/zones/
Synopsis:

Get list of all zones that the api user has access to view or edit

Response JSON Object:
  • venues – list of zones (see Zone Lookup by ID for the details of each zone object)

  • e.g. Retrieve Zone list:

GET /api/1.0/zones/ HTTP/1.1
apikey: 123456789
HTTP/1.1 200 OK
Content-Type: application/json

{
    "zones": [
        {
            "id": 2,
            "capacity": 50,
            "name": "zone 2",
            "subZone": true,
            "devices": [1],
            "venue": 1
        },
        {
            "id": 3,
            "capacity": 50,
            "name": "zone 3",
            "subZone": true,
            "devices": [],
            "venue": 1
        },
    ]
}

Zone Lookup by ID

GET /api/1.0/zones/{zone_id}
Synopsis:

Get venue object with venue_id

Request JSON Object:
  • id – unique venue identifier

  • name – Full name of the zone (specified in settings)

  • capacity – user-specified capacity (specified in settings)

  • devices – list of device ids for all devices currently associated with this zone

  • venue – Parent venue id

  • subZone – If true, this zone count is not included in the total venue capacity. False indicates that it is included.

  • e.g. Retrieve Zone 2

GET /api/1.0/zones/2 HTTP/1.1
apikey: 123456789
HTTP/1.1 200 OK
Content-Type: Application/json

{
 "zone": {
            "id": 2,
            "capacity": 50,
            "name": "zone 2",
            "subZone": false,
            "devices": [],
            "venue": 1
        },
}