Data collected from the VidiGates instances and collated is available through an HTTP API using JSON payload.

Get instance data

API point (GET):

http://<ip address>:8080/api/v1/instances

A sample response:

{
  "instances": [
    {
      "gates": [
        {
          "id": 1,
          "in": 0,
          "out": 0
        }
      ],
      "boxid": 74117,
      "name": "Box #74117",
      "state": "not_configured",
      "restricted": true,
      "enabled": true,
      "stable": false,
      "host": "192.168.1.94",
      "number": 1,
      "gate_type": "both"
    },
    {
      "gates": [
        {
          "id": 1,
          "in": 10,
          "out": 30
        },
        {
          "id": 2,
          "in": 30,
          "out": 20
        }
      ],
      "boxid": 52190,
      "name": "Box #52190",
      "host": "192.168.1.94",
      "number": 0,
      "gate_type": "in",
      "status": "ok"
    }
  ],
  "current": 40,
  "threshold": 50,
  "reset_time": { "hour": 23, "minute": 0 },
  "status": "ok"
}

Detailed meaning of the response fields:

  • current (int): The current occupancy

  • threshold (int): The current occupancy threshold

  • reset_time: (object): The time of day when counters are reset to 0. This may be null for no reset.

  • status (str): “ok” if the occupancy is below the threshold, “ko” if not

  • instances (list): List of instances. Elements are objects with the following fields:

    • gate_type (str): Gate type for this instance. May be “in”, “out” or “both”. The type applies to all gates defined for this instance.

    • number (int): The instance’s numeric identifier.

    • host (str): The IPv4 address of the computer on which the instance runs.

    • name (str): The instance’s name, as set in its Control Center

    • boxid (int): The instance’s BoxID

    • gates (list): A list of the gates defined for this instance, with their numeric ID and in/out counts.

    • status (str): The current status; may be one of

      • not-capturing: Capture doesn’t work. Check the camera

      • disabled: Instance is disabled; contact Quividi support

      • restricted: Instance is restricted; contact Quividi support

      • no-gates: Instance does not have any gate configured. Add a gate.

      • unstable: The background is not stable yet. This happens after VidiGates startup and may last a minute or two.

      • ok: Everything’s fine.

Set instance type

API point (POST):

http://<ip address>:8080/api/v1/set_type

The caller should send a JSON payload with the following keys:

  • boxid (int): The BoxID of the instance to configure

  • number (int): The number of said instance

  • gate_type (str): The gate type (“in”, “out” or “both”)

The response is an empty JSON object.

Set occupancy and/or threshold

API point (POST):

http://<ip address>:8080/api/v1/set

The caller should send a JSON payload with the following keys:

  • occupancy (int): Value to set the current occupancy to

  • threshold (int): Occupancy threshold to set

  • reset_time (object): Counters reset time of day, in the form {hour: <number>, minute: <number>}. May be null if no reset has to happen.

All keys are optional, and the associated value will not be changed it it’s omitted.

The response has the followin keys:

  • current: Current occupancy.

  • threshold: Current threshold.

  • reset_time: Current reset time.