Compliance Accuracy Reports

Compliance Accuracy Report Object

{
"id": "5a4bdf1a-3e76-4442-bed0-71be61422a0f",
"workspaceId": "f213e5dd-4b92-46f0-95df-0b9dfff4e588",
"facilityIds": [
"156bd472-07a6-4680-8e17-11816681e14a"
],
"jobIds": [
"d1d1b0b0-32d6-4de6-b2cc-9ab90289e6f7",
"e7aa05d3-3b6c-4419-802c-fdc726b18c0e"
],
"types": [
"COMPLIANCE_SOCIAL_DISTANCE"
],
"start": 1614546000,
"end": 1615150799,
"status": "inprogress",
"createdAt": "2021-03-15T19:39:17Z"
}

Compliance Accuracy Job Object

{
"id": "e7aa05d3-3b6c-4419-802c-fdc726b18c0e",
"reportId": "5a4bdf1a-3e76-4442-bed0-71be61422a0f",
"facilityId": "156bd472-07a6-4680-8e17-11816681e14a",
"cameraIds": [
"a066158d-26ee-4a47-80df-9869273da21d"
],
"type": "COMPLIANCE_SOCIAL_DISTANCE",
"start": 1614546000,
"end": 1615150799,
"totalItemCount": 12,
"sampleSize": 5,
"flaggedCount": 1,
"marginOfError": 0.11519105437339393,
"confidenceLevel": 0.5,
"createdAt": "2021-03-15T20:04:41Z",
"status": "done"
}

Compliance Image Object

{
"id": "350bdd7d-8a59-449c-a0c6-3bb6915f3c0c",
"cameraId": "a066158d-26ee-4a47-80df-9869273da21d",
"metric": "COMPLIANCE_SOCIAL_DISTANCE",
"image": "",
"bbox": [],
"createdAt": "2021-03-15T19:36:28Z",
"localCreatedAt": "2021-03-05T20:51:53Z",
"jobId": "d1d1b0b0-32d6-4de6-b2cc-9ab90289e6f7",
"sortingNumber": 1615827060223
}

Endpoints


Create report

POST/compliance_accuracy_check

Roles:

accuracycheck:write

Arguments

BODY
  • start Long required Start time of report in Unix time
  • end Long required End time of report in Unix time

Response

Returns created accuracy check report

{
"status": "ok",
"data": {
"id": "cba63348-2d94-4dfe-a15f-c3b34b502e9a",
"workspaceId": "f213e5dd-4b92-46f0-95df-0b9dfff4e588",
"facilityIds": [],
"jobIds": [],
"types": [],
"start": 1614546000,
"end": 1615150799,
"status": "inprogress",
"createdAt": "2021-03-16T12:44:11Z"
}
}

Get reports

GET/compliance_accuracy_check

Roles:

accuracycheck:read

Arguments

QUERY STRING PARAMETERS
  • facilityId Array[UUID] optional Facility ids
  • start Long required Start time of report in Unix time
  • end Long required End time of report in Unix time
  • type Array[String] optional Type of compliance metrics
  • status String optional Report status
  • page Int optional Requested result page
  • count Int optional Requested result count in a page

Response

Returns accuracy check reports in given time range with paging

{
"status": "ok",
"data": {
"page": 1,
"count": 10,
"total": 2,
"reports": [
{
"id": "cba63348-2d94-4dfe-a15f-c3b34b502e9a",
"workspaceId": "f213e5dd-4b92-46f0-95df-0b9dfff4e588",
"facilityIds": [],
"jobIds": [],
"types": [],
"start": 1614546000,
"end": 1615150799,
"status": "done",
"createdAt": "2021-03-16T12:44:11Z"
},
{
"id": "5a4bdf1a-3e76-4442-bed0-71be61422a0f",
"workspaceId": "f213e5dd-4b92-46f0-95df-0b9dfff4e588",
"facilityIds": [
"156bd472-07a6-4680-8e17-11816681e14a"
],
"jobIds": [
"d1d1b0b0-32d6-4de6-b2cc-9ab90289e6f7",
"71d66feb-11a1-4f93-a08f-70a816705ea8"
],
"types": [
"COMPLIANCE_SOCIAL_DISTANCE"
],
"start": 1614546000,
"end": 1615150799,
"status": "inprogress",
"createdAt": "2021-03-15T19:39:17Z"
}
]
}
}

Get report

GET/compliance_accuracy_check/:reportId

Roles:

accuracycheck:read

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report

Response

Returns accuracy check report

{
"status": "ok",
"data": {
"id": "5a4bdf1a-3e76-4442-bed0-71be61422a0f",
"workspaceId": "f213e5dd-4b92-46f0-95df-0b9dfff4e588",
"facilityIds": [
"156bd472-07a6-4680-8e17-11816681e14a"
],
"jobIds": [
"d1d1b0b0-32d6-4de6-b2cc-9ab90289e6f7",
"e7aa05d3-3b6c-4419-802c-fdc726b18c0e"
],
"types": [
"COMPLIANCE_SOCIAL_DISTANCE"
],
"start": 1614546000,
"end": 1615150799,
"status": "inprogress",
"createdAt": "2021-03-15T19:39:17Z"
}
}

Update report

PATCH/compliance_accuracy_check/:reportId

Roles:

accuracycheck:write

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report
BODY
  • status String required Report status. Can be one of inprogress, done.

Response

Returns updated accuracy check report

{
"status": "ok",
"data": {
"id": "cba63348-2d94-4dfe-a15f-c3b34b502e9a",
"workspaceId": "f213e5dd-4b92-46f0-95df-0b9dfff4e588",
"facilityIds": [],
"jobIds": [],
"types": [],
"start": 1614546000,
"end": 1615150799,
"status": "done",
"createdAt": "2021-03-16T12:44:11Z"
}
}

Delete report

DELETE/compliance_accuracy_check/:reportId

Roles:

accuracycheck:delete

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report

Response

Returns deleted report count.

{
"status": "ok",
"data": 1
}

Get sample size

GET/compliance_accuracy_check/sample_size

Roles:

accuracycheck:read

Arguments

QUERY STRING PARAMETERS
  • facilityId UUID required Facility id
  • cameraIds Array[UUID] required Camera ids
  • start Long required Start time of report in Unix time
  • end Long required End time of report in Unix time
  • type String required Type of compliance metric
  • confidenceLevel Double required Confidence level
  • marginOfError Double required Margin of error

Response

Returns sample size

{
"status": "ok",
"data": 12
}

Create job

POST/compliance_accuracy_check/:reportId/jobs

Roles:

accuracycheck:write

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report
BODY
  • facilityId UUID required Facility id
  • cameraIds Array[UUID] required Camera ids
  • start Long required Start time of report in Unix time
  • end Long required End time of report in Unix time
  • type String required Type of compliance metric
  • confidenceLevel Double required Confidence level
  • marginOfError Double required Margin of error

Response

Returns created accuracy check job

{
"status": "ok",
"data": {
"id": "71d66feb-11a1-4f93-a08f-70a816705ea8",
"reportId": "5a4bdf1a-3e76-4442-bed0-71be61422a0f",
"facilityId": "156bd472-07a6-4680-8e17-11816681e14a",
"cameraIds": [
"a066158d-26ee-4a47-80df-9869273da21d"
],
"type": "COMPLIANCE_SOCIAL_DISTANCE",
"start": 1614546000,
"end": 1615150799,
"totalItemCount": 7,
"sampleSize": 4,
"flaggedCount": 0,
"marginOfError": 0.11038929770519285,
"confidenceLevel": 0.5,
"createdAt": "2021-03-16T13:25:55Z",
"status": "inprogress"
}
}

Get jobs in a report

GET/compliance_accuracy_check/:reportId/jobs

Roles:

accuracycheck:read

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report

Response

Returns accuracy jobs in report

{
"status": "ok",
"data": [
{
"id": "d1d1b0b0-32d6-4de6-b2cc-9ab90289e6f7",
"reportId": "5a4bdf1a-3e76-4442-bed0-71be61422a0f",
"facilityId": "156bd472-07a6-4680-8e17-11816681e14a",
"cameraIds": [
"a066158d-26ee-4a47-80df-9869273da21d"
],
"type": "COMPLIANCE_SOCIAL_DISTANCE",
"start": 1614546000,
"end": 1615150799,
"totalItemCount": 21,
"sampleSize": 9,
"flaggedCount": 2,
"marginOfError": 0.0849777209943291,
"confidenceLevel": 0.5,
"createdAt": "2021-03-15T19:51:00Z",
"status": "done"
},
{
"id": "e7aa05d3-3b6c-4419-802c-fdc726b18c0e",
"reportId": "5a4bdf1a-3e76-4442-bed0-71be61422a0f",
"facilityId": "156bd472-07a6-4680-8e17-11816681e14a",
"cameraIds": [
"a066158d-26ee-4a47-80df-9869273da21d"
],
"type": "COMPLIANCE_SOCIAL_DISTANCE",
"start": 1614546000,
"end": 1615150799,
"totalItemCount": 12,
"sampleSize": 5,
"flaggedCount": 1,
"marginOfError": 0.11519105437339393,
"confidenceLevel": 0.5,
"createdAt": "2021-03-15T20:04:41Z",
"status": "done"
}
]
}

Get job in a report

GET/compliance_accuracy_check/:reportId/jobs/:jobId

Roles:

accuracycheck:read

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report
  • jobId UUID required Id of accuracy check job

Response

Returns accuracy job in report

{
"status": "ok",
"data": {
"id": "e7aa05d3-3b6c-4419-802c-fdc726b18c0e",
"reportId": "5a4bdf1a-3e76-4442-bed0-71be61422a0f",
"facilityId": "156bd472-07a6-4680-8e17-11816681e14a",
"cameraIds": [
"a066158d-26ee-4a47-80df-9869273da21d"
],
"type": "COMPLIANCE_SOCIAL_DISTANCE",
"start": 1614546000,
"end": 1615150799,
"totalItemCount": 12,
"sampleSize": 5,
"flaggedCount": 1,
"marginOfError": 0.11519105437339393,
"confidenceLevel": 0.5,
"createdAt": "2021-03-15T20:04:41Z",
"status": "done"
}
}

Update job in a report

PATCH/compliance_accuracy_check/:reportId/jobs/:jobId

Roles:

accuracycheck:write

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report
  • jobId UUID required Id of accuracy check job
BODY
  • status String required Report status. Can be one of inprogress, done.

Response

Returns updated accuracy job in report

{
"status": "ok",
"data": {
"id": "e7aa05d3-3b6c-4419-802c-fdc726b18c0e",
"reportId": "5a4bdf1a-3e76-4442-bed0-71be61422a0f",
"facilityId": "156bd472-07a6-4680-8e17-11816681e14a",
"cameraIds": [
"a066158d-26ee-4a47-80df-9869273da21d"
],
"type": "COMPLIANCE_SOCIAL_DISTANCE",
"start": 1614546000,
"end": 1615150799,
"totalItemCount": 12,
"sampleSize": 5,
"flaggedCount": 1,
"marginOfError": 0.11519105437339393,
"confidenceLevel": 0.5,
"createdAt": "2021-03-15T20:04:41Z",
"status": "done"
}
}

Delete job in a report

DELETE/compliance_accuracy_check/:reportId/jobs/:jobId

Roles:

accuracycheck:delete

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report
  • jobId UUID required Id of accuracy check job

Response

Returns deleted job count.

{
"status": "ok",
"data": 1
}

Get images in a job

GET/compliance_accuracy_check/:reportId/jobs/:jobId/images

Roles:

accuracycheck:read

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report
  • jobId UUID required Id of accuracy check job

Response

Returns accuracy job in report

{
"status": "ok",
"data": {
"page": 1,
"count": 2,
"total": 11,
"images": [
{
"id": "dffe6484-eb19-491a-8ef3-0a3f9e1cb7ce",
"cameraId": "a066158d-26ee-4a47-80df-9869273da21d",
"metric": "COMPLIANCE_SOCIAL_DISTANCE",
"image": "",
"bbox": [],
"createdAt": "2021-03-15T19:36:34Z",
"localCreatedAt": "2021-03-05T20:51:53Z",
"jobId": "d1d1b0b0-32d6-4de6-b2cc-9ab90289e6f7",
"sortingNumber": 1615827060220
},
{
"id": "8294249b-b300-4331-9320-ffebb26d21ee",
"cameraId": "a066158d-26ee-4a47-80df-9869273da21d",
"metric": "COMPLIANCE_SOCIAL_DISTANCE",
"image": "",
"bbox": [],
"createdAt": "2021-03-15T19:36:35Z",
"localCreatedAt": "2021-03-05T20:51:53Z",
"jobId": "d1d1b0b0-32d6-4de6-b2cc-9ab90289e6f7",
"sortingNumber": 1615827060221
}
]
}
}

Add more image samples to a job

PUT/compliance_accuracy_check/:reportId/jobs/:jobId/samples

Roles:

accuracycheck:write

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report
  • jobId UUID required Id of accuracy check job
QUERY STRING PARAMETERS
  • nMoreSamples Int required Sample count

Response

Returns updated job

{
"status": "ok",
"data": {
"id": "d1d1b0b0-32d6-4de6-b2cc-9ab90289e6f7",
"reportId": "5a4bdf1a-3e76-4442-bed0-71be61422a0f",
"facilityId": "156bd472-07a6-4680-8e17-11816681e14a",
"cameraIds": [
"a066158d-26ee-4a47-80df-9869273da21d"
],
"type": "COMPLIANCE_SOCIAL_DISTANCE",
"start": 1614546000,
"end": 1615150799,
"totalItemCount": 21,
"sampleSize": 12,
"flaggedCount": 2,
"marginOfError": 0.06373329074574682,
"confidenceLevel": 0.5,
"createdAt": "2021-03-15T19:51:00Z",
"status": "done"
}
}

Mark image in a job

PATCH/compliance_accuracy_check/:reportId/jobs/:jobId/images/:imageId

Roles:

accuracycheck:write

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report
  • jobId UUID required Id of accuracy check job
  • imageId UUID required Id of accuracy check image
QUERY STRING PARAMETERS
  • status Boolean required Image status.

Response

Returns marked image count.

{
"status": "ok",
"data": 1
}

Delete image from a job

DELETE/compliance_accuracy_check/:reportId/jobs/:jobId/images/:imageId

Roles:

accuracycheck:delete

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report
  • jobId UUID required Id of accuracy check job
  • imageId UUID required Id of accuracy check image

Response

Returns deleted image count.

{
"status": "ok",
"data": 1
}

Resample an image in a job

POST/compliance_accuracy_check/:reportId/jobs/:jobId/images/:imageId/resample

Roles:

accuracycheck:write

Arguments

PATH PARAMETERS
  • reportId UUID required Id of accuracy check report
  • jobId UUID required Id of accuracy check job
  • imageId UUID required Id of accuracy check image

Response

Returns added image.

{
"status": "ok",
"data": {
"id": "350bdd7d-8a59-449c-a0c6-3bb6915f3c0c",
"cameraId": "a066158d-26ee-4a47-80df-9869273da21d",
"metric": "COMPLIANCE_SOCIAL_DISTANCE",
"image": "",
"bbox": [],
"createdAt": "2021-03-15T19:36:28Z",
"localCreatedAt": "2021-03-05T20:51:53Z",
"jobId": "d1d1b0b0-32d6-4de6-b2cc-9ab90289e6f7",
"sortingNumber": 1615827060223
}
}

Get total flagged count

GET/compliance_accuracy_check/total_flagged_count

Roles:

accuracycheck:read

Arguments

QUERY STRING PARAMETERS
  • start Long required Start time of report in Unix time
  • end Long required End time of report in Unix time

Response

Returns total flagged count images grouped by same ranges

{
"status": "ok",
"data": [
{
"start": 1614546000,
"end": 1615150799,
"count": 3
},
{
"start": 1612546000,
"end": 1613150799,
"count": 1
}
]
}

Get weighted accuracy rates

GET/compliance_accuracy_check/weighted_accuracy_rates

Roles:

accuracycheck:read

Arguments

QUERY STRING PARAMETERS
  • start Long required Start time of report in Unix time
  • end Long required End time of report in Unix time

Response

Returns weighted accuracy rates grouped by same ranges

{
"status": "ok",
"data": [
{
"start": 1614546000,
"end": 1615150799,
"rate": 0.6666666666666666
},
{
"start": 1612546000,
"end": 1613150799,
"rate": 0.4
}
]
}

Get weighted accuracy rates per type

GET/compliance_accuracy_check/weighted_accuracy_rates_per_type

Roles:

accuracycheck:read

Arguments

QUERY STRING PARAMETERS
  • start Long required Start time of report in Unix time
  • end Long required End time of report in Unix time

Response

Returns weighted accuracy rates grouped by same ranges

{
"status": "ok",
"data": [
{
"start": 1614546000,
"end": 1615150799,
"data": [
{
"start": 1614546000,
"end": 1615150799,
"type": "COMPLIANCE_SOCIAL_DISTANCE",
"rate": 0.6666666666666666
},
{
"start": 1614546000,
"end": 1615150799,
"type": "COMPLIANCE_FACE_MASK",
"rate": 0.8
}
]
},
{
"start": 1612546000,
"end": 1613150799,
"data": [
{
"start": 1614546000,
"end": 1615150799,
"type": "COMPLIANCE_SOCIAL_DISTANCE",
"rate": 0.4
},
{
"start": 1614546000,
"end": 1615150799,
"type": "COMPLIANCE_FACE_MASK",
"rate": 0.6
}
]
}
]
}