Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Introduction

Bluzone exposes a REST API that provides a user with the Distance Tracking and Contact Tracing data of their applicable devies. The Distance Tracking data is provided by beacons that are configured to emit Distance Tracking packets, while the Contact Tracing data can be provided by these same beacons as well as by the geofence history of a specific beacon. The various APIs for obtaining this data are provided below.

Distance Tracking Dashboard

Method

POST

URL

https://bluzone.io/portal/papis/dts/v1/api/dashboard/{projectId}

Response Content-Type

application/json

Header

bzid

Description

Get the distance tracking dashboard view for your project.

Parameters

Type

Name

Required

Description

Schema

Default

Path

projectId

YES

The ID of the project, e.g. 111

int


Body

start

YES

The start date of the desired time range, in ISO8601 RFC339Nano format

string

Body

end

YES

The end date of the desired time range, in ISO8601 RFC339Nano format

string

Sample Response

{
  "population": 46, //The number of unique devices observed by Bluzone
  "compliant": 71.73913, //The percent of unique devices that do not have an associated Distance Tracking violation
  "violations": 26, //The number of Distance Tracking violations observed
  "uniqueDevices": 13, //The number of unique devices for which Bluzone observed a Distance Tracking violation
  "recent": [
    //Each entry is an hourly report of the observed population, violations, and unique devices with violations
    {
      "interval": "HOURLY",
      "timestamp": "2020-07-16T18:00:00Z",
      "population": 41,
      "violations": 2,
      "uniqueViolations": 2
    },
    {
      "interval": "HOURLY",
      "timestamp": "2020-07-16T19:00:00Z",
      "population": 40,
      "violations": 1,
      "uniqueViolations": 1
    },
    {
      "interval": "HOURLY",
      "timestamp": "2020-07-17T17:00:00Z",
      "population": 26,
      "violations": 2,
      "uniqueViolations": 2
    }
  ],
  "todaysViolations": [
    //Each entry is a unique latitude/longitude tuple and the number of associated Distance Tracking violations at that location
    {
      "lat": 30.413098,
      "lng": -97.666902,
      "count": 1
    },
    {
      "lat": 30.412875,
      "lng": -97.666004,
      "count": 1
    },
    {
      "lat": 30.412972,
      "lng": -97.666179,
      "count": 1
    }
  ],
  "topViolatingBeacons": [
    //Each entry is a unique device id and the number of associated Distance Tracking violations for this device
    {
      "id": "1376582239814772076",
      "violationCount": 1
    },
    {
      "id": "8195029735132899180",
      "violationCount": 1
    },
    {
      "id": "14147864550494974530",
      "violationCount": 1
    },
  ],
  "topViolatingAreas": [
    //Each entry is a unique Bluzone locationId, it's name, and the number of associated Distance Tracking violations for this location
    {
      "name": "My Location",
      "locationId": "111",
      "violationCount": 26
    }
  ]
}

cURL Example

curl -X POST -H "Content-Type: application/json" -H "BZID: ABCDEFGHJILKMNOP" -d '{
	"start": "2020-05-10T14:26:26.462Z",
	"end": "2020-06-10T14:26:26.462Z"
}' "https://bluzone.io/portal/papis/dts/v1/api/dashboard/111"

Device Contact Report

Method

POST

URL

https://bluzone.io/portal/papis/dts/v1/api/deviceContactReport/{projectId}/{deviceId}

Response Content-Type

application/json

Header

bzid

Description

Get contact report for the specified device.

Parameters

Type

Name

Required

Description

Schema

Default

Path

projectId

YES

The ID of the project, e.g. 111

int


Path

deviceId

YES

The ID of the device, e.g. 14458689340104137112

string

Body

start

YES

The start date of the desired time range, in ISO8601 RFC339Nano format

string

Body

end

YES

The end date of the desired time range, in ISO8601 RFC339Nano format

string

Sample Response

{
  "violations": 6, //The number of Distance Tracking violations for this device
  "closeDevices": 2, //The number of unique devices that were associated with this device's Distance Trcking violations
  "recent": [
    //Each entry is an hourly report of the number Distance Tracking violations for this device
    {
      "interval": "HOURLY",
      "timestamp": "2020-07-17T12:00:00Z", //ISO8601 RFC3339Nano
      "violations": 1
    },
    {
      "interval": "HOURLY",
      "timestamp": "2020-07-17T11:00:00Z",
      "violations": 4
    },
    {
      "interval": "HOURLY",
      "timestamp": "2020-07-17T10:00:00Z",
      "violations": 1
    }
  ],
  "contacts": [
    //Each entry is a report of a Contact Event (either DISTANCE for Distance Violations or GEOFENCE for a shared geofence with another device at this time)
    {
      "riskLevel": "LOW", //The calculated risk level of this contact event
      "deviceId": "8445671781542985407", //The Bluzone deviceId of the device associated with this contact event
      "contactType": "GEOFENCE", //Type of contact (DISTANCE or GEOFENCE)
      "locationName": "BluFi062", //The name of the Bluzone geofence
      "locationId": "125303", //The Bluzone locationId
      "floor": "1", //The configured floor value of the Bluzone location
      "lastContact": "2020-07-17T04:19:33.809Z" //Last contact time with the associated device (ISO8601 RFC3339Nano)
    },
    {
      "riskLevel": "LOW",
      "deviceId": "17895940144574406572",
      "contactType": "GEOFENCE",
      "locationName": "BluFi062",
      "locationId": "125303",
      "floor": "1",
      "lastContact": "2020-07-17T04:19:33.809Z"
    },
    {
      "riskLevel": "LOW",
      "deviceId": "17895940144574406572",
      "contactType": "GEOFENCE",
      "locationName": "BluFi062",
      "locationId": "125303",
      "floor": "1",
      "lastContact": "2020-07-17T13:30:17.532Z"
    }
  ]
}

cURL Example

curl -X POST -H "BZID: ABCDEFGHJILKMNOP" -H "Content-Type: application/json" -d '{
	"start": "2020-06-29T22:08:18.095Z",
	"end": "2020-06-30T22:08:18.095Z"
}' "https://bluzone.io/portal/papis/dts/v1/api/deviceContactReport/111/14458689340104137112"

Distance Violation History

Method

POST

URL

https://bluzone.io/portal/papis/dts/v1/api/deviceContactReport/{projectId}/{locationId}

Response Content-Type

application/json

Header

bzid

Description

Get the distance violation history of a Bluzone location.

Parameters

Type

Name

Required

Description

Schema

Default

Path

projectId

YES

The ID of the project, e.g. 111

int


Path

locationId

YES

The ID of the location, e.g. 1443

int

Body

start

YES

The start date of the desired time range, in ISO8601 RFC339Nano format

string

Body

end

YES

The end date of the desired time range, in ISO8601 RFC339Nano format

string

Sample Response

{
  "locationId": "62", //Bluzone locationId
  "locationName": "Auto-generated", //Bluzone locationName
  "violations": 1101, //The number of Distance Tracking violations at the requested location during the requested period
  "uniqueDevices": 29, //The unique number of devices which had a Distance Tracking violation
  "recent": [
    //Each entry is an hourly report of the number Distance Tracking violations and unique number of devices for this location
    {
      "interval": "HOURLY",
      "timestamp": "2020-07-08T02:00:00Z",
      "violations": 3,
      "uniqueViolations": 3
    },
    {
      "interval": "HOURLY",
      "timestamp": "2020-07-08T00:00:00Z",
      "violations": 1,
      "uniqueViolations": 1
    },
    {
      "interval": "HOURLY",
      "timestamp": "2020-07-09T19:00:00Z",
      "violations": 2,
      "uniqueViolations": 2
    }
  ],
  "violationsMap": [
    //Each entry is a unique latitude/longitude tuple and the number of associated Distance Tracking violations at that location
    {
      "lat": 26.205577,
      "lng": -80.138385,
      "count": 470
    },
    {
      "lat": 26.205629,
      "lng": -80.138518,
      "count": 1
    }
  ],
  "devicesSummary": [
    //Each entry is a unique device id and the number of associated Distance Tracking packet violations for this device (i.e. the number of times a beaon reported it was too close to another beacon)
    {
      "deviceId": "200042",
      "violations": 1
    },
    {
      "deviceId": "200049",
      "violations": 1
    },
    {
      "deviceId": "200036",
      "violations": 53
    }
  ]
}

cURL Example

curl -X POST -H "BZID: ABCDEFGHIJKLNOP" -H "Content-Type: application/json" -d '{
	"start": "2020-06-20T14:26:26.462Z",
	"end": "2020-07-11T14:26:26.462Z"
}' "https://bluzone.io/portal/papis/dts/v1/api/distanceViolationHistory/111/62"
  • No labels