Facilities

Facility object

{
"id": "bf9a037b-dacd-485f-90f1-7962e6aabd3a",
"name": "Intenseye",
"address": "Maslak, intenseye, ARl 3 Binası, İTÜ Ayazağa Kampüsü, Sarıyer/İstanbul, Turkey",
"geographicCoordinates": {
"lat": 41.10792010000001,
"lng": 29.0324974
},
"workspaceId": "be74e929-50f3-4d0c-b56d-bac612e78553",
"timeZoneId": "Europe/Istanbul",
"cameraCount": 1
}

Endpoints


Get a single facility

GET/workspaces/facilities/:facilityId

Roles:

facilities:read
PATH PARAMETERS
  • :facilityId UUID required Id of the facility to retrieve

Arguments

No arguments needed

Returns

Returns a facility object containing the id of inserted item.

{
"status": "ok",
"data": {
"id": "156bd472-07a6-4680-8e17-11816681e14a",
"name": "Intenseye",
"address": "Maslak, intenseye, ARl 3 Binası, İTÜ Ayazağa Kampüsü, Sarıyer/İstanbul, Turkey",
"geographicCoordinates": {
"lat": 41.10792010000001,
"lng": 29.0324974
},
"workspaceId": "f213e5dd-4b92-46f0-95df-0b9dfff4e588",
"timeZoneId": "Europe/Istanbul"
}
}

Delete a facility

DELETE/workspaces/facilities/:facilityId

Roles:

facilities:delete
PATH PARAMETERS
  • :facilityId UUID required Id of the facility to retrieve

Arguments

No arguments needed

Returns

Returns a facility object containing the id of inserted item.

{
"status": "ok",
"message": "Deleted facility ${facilityId}"
}

Get facilities inside the workspace

GET/workspaces/facilities

Roles:

workspaces:readfacilities:read

Arguments

No arguments needed

Returns

Returns list of facility objects for the workspace for the user that was authenticated in the request.

{
"status": "ok",
"data": [
{
"id": "156bd472-07a6-4680-8e17-11816681e14a",
"name": "Intenseye",
"address": "Maslak, intenseye, ARl 3 Binası, İTÜ Ayazağa Kampüsü, Sarıyer/İstanbul, Turkey",
"geographicCoordinates": {
"lat": 41.10792010000001,
"lng": 29.0324974
},
"workspaceId": "f213e5dd-4b92-46f0-95df-0b9dfff4e588",
"timeZoneId": "Europe/Istanbul",
"cameraCount": 1
}
]
}

Add a facility for the workspace of the user.

POST/workspaces/facilities

Roles:

facilities:write

Arguments

BODY
  • name String required Name of the facility
  • address String required Facility email address
  • timeZoneId String required Timezone of facility (ex: America/New_York)
  • geographicCoordinates Object required Geographic coordinates of the facility (lat, lng)
    • lat Float required Latitude
    • lng Float required Longitude

Returns

Returns a response with the id of the facility that has been created.

{
"status": "ok",
"insertedItem": "f4f15ac1-8083-4279-b9e0-94cdd84cf354"
}

Add/Update facility shifts

POST/facilities/:facilityId/shift

Roles:

facilities:write

Arguments

PATH PARAMETERS
  • facilityId UUID required Id of the facility
BODY
  • id UUID optional Id of the shift
  • facilityId UUID required Id of the facility
  • shifts List[Shift] required
    • Shift Object
      • start Start of the shift
      • end End of the shift
  • month Int required Month of the shift
  • year Int required Year of the shift

Returns

Returns a success message

{
"status": "ok",
"message": "Shift added"
}

Get facility shifts

GET/facilities/:facilityId/shift

Roles:

facilities:read

Arguments

PATH PARAMETERS
  • facilityId UUID required Id of the facility

Returns

Returns facility shifts

{
"status": "ok",
"data": [
{
"id": "de56c074-84a0-422b-93cb-9f2207ca7222",
"facilityId": "156bd472-07a6-4680-8e17-11816681e14a",
"shifts": [
{
"start": 8,
"end": 16
},
{
"start": 16,
"end": 0
},
{
"start": 0,
"end": 18
}
],
"month": 1,
"year": 2021
}
]
}

Add/Update facility kpi

POST/facilities/:facilityId/kpi

Roles:

facilities:write

Arguments

PATH PARAMETERS
  • facilityId UUID required Id of the facility
BODY
  • id UUID optional Id of the kpi
  • facilityId UUID required Id of the facility
  • alertKPIs List[KPI] required
    • KPI Object
      • actual optional Alert count of previous month
      • target optional Target alert count of current month
      • name required Name of the category
  • month Int required Month of the shift
  • year Int required Year of the shift

Returns

Returns a success message

{
"status": "ok",
"message": "KPI added"
}

Get facility kpis

GET/facilities/:facilityId/kpi

Roles:

facilities:read

Arguments

PATH PARAMETERS
  • facilityId UUID required Id of the facility

Returns

Returns facility kpis

{
"status": "ok",
"data": [
{
"id": "117210ae-60d1-4239-b157-6a7a4880f4b9",
"facilityId": "156bd472-07a6-4680-8e17-11816681e14a",
"alertKPIs": [
{
"actual": 10,
"target": 8,
"name": "ANOMALY"
},
{
"actual": 15,
"target": 10,
"name": "AREA_CONTROLS"
}
],
"month": 1,
"year": 2021
}
]
}

Get facility heatmaps

GET/facilities/:facilityId/heatmaps

Roles:

facilities:readcameras:read

Arguments

PATH PARAMETERS
  • facilityId UUID required Id of the facility
QUERY STRING PARAMETER
  • interval Enum required
    • daily
    • monthly
    • yearly
  • nthOfYear Int optional Number of the calendar week or month
  • year String optional Year

Returns

Returns list of heatmaps

{
"status": "ok",
"data": [
{
"cameraId": "adb84d9d-024a-4f76-96e5-7697458d415b",
"alertType": "STATIC_DELIMITATION_AREA",
"url": "https://intenseye.test/img.png",
"interval": "weekly",
"nthOfYear": 8,
"year": 2021,
"startDate": "2021-02-22T00:00:00Z",
"endDate": "2021-03-01T00:00:00Z"
}
]
}

Get connectivity facilities

POST/facilities/connectivity

Arguments

BODY
  • start Long required Start of the timestamp to get connectivity
  • end Long required End of the timestamp to get connectivity
  • aggregate Enum required
    • day
    • week
    • month Aggregation identifier

Returns

Returns connectivity report of facilities

{
"status": "ok",
"data": {
"series": [
{
"groups": [
{
"id": "156bd472-07a6-4680-8e17-11816681e14a",
"name": "Nika",
"connectivity": [
{
"state": "INPROGRESS",
"durationInMinutes": 140025.48333333334
},
{
"state": "DISCONNECTED",
"durationInMinutes": 3372.016666666667
}
]
},
{
"id": "a35b9a1e-2731-43f8-adce-54072626b849",
"name": "Videos Test",
"connectivity": [
{
"state": "INPROGRESS",
"durationInMinutes": 44648.683333333334
},
{
"state": "DISCONNECTED",
"durationInMinutes": 20664.466666666667
}
]
}
],
"comparison": [
{
"previous": [
{
"state": "INPROGRESS",
"durationInMinutes": 27227.383333333335
},
{
"state": "DISCONNECTED",
"durationInMinutes": 35749
}
],
"current": [
{
"state": "INPROGRESS",
"durationInMinutes": 37281.6
},
{
"state": "DISCONNECTED",
"durationInMinutes": 22510.1
}
],
"percentageChange": [
{
"state": "INPROGRESS",
"durationInMinutes": 0.36926856112381945
},
{
"state": "DISCONNECTED",
"durationInMinutes": -0.37032923997874073
}
],
"key": "156bd472-07a6-4680-8e17-11816681e14a"
},
{
"previous": [
{
"state": "INPROGRESS",
"durationInMinutes": 44640
}
],
"current": [
{
"state": "INPROGRESS",
"durationInMinutes": 44648.683333333334
},
{
"state": "DISCONNECTED",
"durationInMinutes": 20664.466666666667
}
],
"percentageChange": [
{
"state": "INPROGRESS",
"durationInMinutes": 0.00019451911589010536
},
{
"state": "DISCONNECTED"
}
],
"key": "a35b9a1e-2731-43f8-adce-54072626b849"
}
]
}
]
}
}

Get connectivity of a facility

POST/facilities/:facilityId/connectivity

Arguments

PATH PARAMETERS
  • :facilityId UUID required Id of the facility
BODY
  • start Long required Start of the timestamp to get connectivity
  • end Long required End of the timestamp to get connectivity
  • aggregate Enum required
    • day
    • week
    • month Aggregation identifier

Returns

Returns connectivity report of a facility

{
"status": "ok",
"data": {
"series": [
{
"groups": [
{
"cameraId": "a9714296-0891-4645-a71e-927b4f063076",
"name": "Warehouse 2",
"connectivity": [
{
"state": "INPROGRESS",
"durationInMinutes": 1439
},
{
"state": "DISCONNECTED",
"durationInMinutes": 0
}
]
}
],
"comparison": [
{
"key": "a9714296-0891-4645-a71e-927b4f06307",
"previous": [
{
"state": "INPROGRESS",
"durationInMinutes": 244
}
],
"current": [
{
"state": "INPROGRESS",
"durationInMinutes": 6184
}
],
"percentageChange": [
{
"state": "INPROGRESS",
"durationInMinutes": 24.34426229508197
}
]
}
]
}
]
}
}

Get alert rules of a facility

GET/facilities/:facilityId/alert_rules

Roles:

facilities:readcameras:read

Arguments

PATH PARAMETERS
  • :facilityId UUID required Id of the facility

Returns

Returns a list of camera and its alert rules

{
"status": "ok",
"data": [
{
"cameraId": "9693bff0-665d-40ff-9ad8-fb4d97407a82",
"alertRules": [
"UNATTENDED_OBJECT_DETECTION"
]
},
{
"cameraId": "ecfbad25-4b24-49bf-906e-f759e98c5550",
"alertRules": [
"STATIC_DELIMITATION_AREA",
"FACE_MASK",
"GLOVE",
"GLASSES"
]
}
]
}