Device Endpoint

Devices are the generation point for all count data. They have a lot of flexibility in terms of configuration, and can be bound to multiple zones at the same time. For example, in external mode, each button pressed will remove a count from one zone and add it to another.

List All

GET /api/1.0/devices/
Synopsis:

Get list of all devices that are associated with venues that the api user has access to view or edit

Response JSON Object:
  • e.g. Retrieve device list:

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

{
   "devices": [
       {
           "id": 1,
           "name": "Device Name",
           "MAC": 11111111,
           "mode": 0,
           "last_upload": 1536148942.749359,
           "last_contact": 1537962724.417026,
           "next_expected": null,
           "isConnected": false,
           "zone": 8,
           "zone2": null,
       },
   ]
}

Device Lookup by ID

GET /api/1.0/devices/{device_id}
Synopsis:

Get device object with device_id

Request JSON Object:
  • id – unique device identifier

  • mac – Device’s wifi MAC address

  • name – Name of device (specified in settings, and displayed on device in default mode)

  • zone – Primary Zone binding

  • zone2 – Secondary Zone binding

  • mode

    Device mode:

    • 0 indicates default mode

    • 1 indicates external count (dual zone), counts into zone, and out of zone2 (& vice-versa)

    • 2 indicates internal count (dual zone), counts in or out of to both zone, and zone2

    • 3 indicates overview mode (display zone and venue count)

    • 7 indicates device overview mode (display zone and device count)

    • 8 indicates device delta mode (display zone and unsynced count)

    • 9 indicates venue total mode (display only venue total)

    • 10 indicates left-right split mode (left controls add maleCount to zone, right ones to maleCount in zone2)

    • 11 indicates left-right split mode (left controls add femaleCount to zone, right ones to femaleCount in zone2)

    • 12 indicates male-only mode (left controls and right controls only change maleCount)

    • 13 indicates female-only mode (left controls and right controls only change femaleCount)

    • 14 indicates device-only mode (displays only this devices counts)

    • 15 indicates all-up mode (all buttons add 1 to maleCount) shows zone total

    • 16 indicates all-up mode (all buttons add 1 to maleCount) while showing device total

  • last_upload – Unix timestamp for the last upload from this device

  • last_contact – Unix timestamp for the last time this device has interacted with TallyFi servers

  • next_expected – Unix timestamp for the next time we expect the device to connect to our servers. If null, the device has been properly shut off (v6 hardware only)

  • isConnected – boolean, true if the device is currently connected to TallyFi servers

  • e.g. Retrieve Device 1

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

{
 "device": {
           "id": 1,
           "name": "Device Name",
           "MAC": 11111111,
           "mode": 0,
           "last_upload": 1536148942.749359,
           "last_contact": 1537962724.417026,
           "next_expected": null,
           "isConnected": false,
           "zone": 2,
           "zone2": null,
       }
}