This article will guide you through viewing doors' status via BioStar 2 API. 



The following API is used to view various door status information such as the door status, alarm and time of last event. 


POST        /api/doors/status


Body Parameter: 

{

  "monitoring_permission": true

}


Postman Request Example:


A successful API call would return with a 200 OK status code with information on door status such as below. 


Postman Response Example:


What do the values mean in the response? 


"door_id" - Id of the door.


"opened"Whether the door is opened or closed. 

false - closed

true - opened


"unlocked" - Whether the door is locked or unlocked. 
0 : locked 
1 : unlocked

"last_open_time" - Timestamp of when the door was last opened. 

"alarm" (first) - Status of door alarm. 
0 : no alarm
1 : held opened
2 : forced opened

"status" - 
0 : STATUS_NORMAL
1 : STATUS_LOCKED
2 : STATUS_UNLOCKED
4 : STATUS_FORCED_OPEN_ALARM
8 : STATUS_HELD_OPEN_ALARM
16 : STATUS_APB_FAILED
32 : STATUS_DISCONNECTED
64 : STATUS_SCHEDULE_LOCKED
128 : STATUS_SCHEDULE_UNLOCKED
256 : STATUS_EMERGENCY_LOCKED
512 : STATUS_EMERGENCY_UNLOCKED
1024 : STATUS_OPERATOR_LOCKED
2048 : STATUS_OPERATOR_UNLOCKED

"alarm" (second) - Status of door + status of door alarm. 
How to calculate: "status" (bitwise OR) "alarm"(first) = "alarm" (second) 
ex) 

"status" = 2048

"alarm" (first) = 0

"alarm" (second) = 2048 | 0 = 2048

ex) 
"status" = 1024
"alarm" (first) = 1
"alarm" (second) = 1024 | 1 = 1025