-
Notifications
You must be signed in to change notification settings - Fork 1
API Endpoints
When using the current NodeJS processing server with other front-end user interfaces or when implementing other processing servers for the devices this document can serve as a guide to the current API endpoints saturated by the device and by users.
NOTE: All endpoints are relative to the root of the processing server. Currently an example implementation of a processing server is available at app.beebithive.com.
| API Endpoint | Function | Parameters | Responds With |
|---|---|---|---|
| /bee/update/ | Send a device update for a UUID and respond with state changes. | Information available here | Detailed here |
| /bee/manufacture/ | Retrieve and register a new device UUID | Requires an authorization header in the form 'Bearer {token}' |
200 Response The registered token |
| /bee/avg/day/:day | Get the average detection for all devices (total) on a specific day | day: Given in YYYY-mm-dd format |
JSON Response { 'day':1572169623, 'average': 27.65 }
|
| /bee/avg/week/:day | Get the average detection for all devices (total) for a week before the given day | day: Given in YYYY-mm-dd format |
JSON Response { 'endDate':1572169623, 'average': 27.65 }
|
| /bee/status/total | Total detections for all devices of logged in user | None |
JSON Response { 'count': 27 }
|
| /bee/stats/:endDate/:days | Get stats for all user devices starting on the endDate - days and ending on the endDate |
endDate: Date to end stats days: Days before the endDate to start the stats |
See 'JSON Responses' section |
| /bee/boxes/counts/:deviceId/:rtime | Gets the tracker count for each tracking box |
deviceId: UUID of the device to get counts rtime: Recorded time to get counts for |
See 'JSON Responses' section |
| /bee/boxes/set/:deviceId | Sets boxes for a device | deviceId: Device UUID | 200 Response |
| /bee/boxes/get/:deviceId | Gets boxes for a device | deviceId: Device UUID | See 'JSON Responses' section |
| /bee/img/fetch/:deviceId | Fetch the latest image for a device | deviceId: Device UUID | See 'JSON Responses' section |
| /bee/img/request/:deviceId | Request an update for a device captured image | deviceId: Device UUID | 200 Response |
| /bee/:deviceId/config/:json | Configure a device's json |
deviceId: Device UUID json: JSON Containing new config values |
See here for further information. |
Longer JSON Response strings that do not fit in the markdown table.
An array of all the devices owned by the current user and their current detection status.
[
{
"username": "user",
"uuid": "0dba...",
"description": "Living Room",
"reg_date": "2019-0-21",
"time": 1572169623,
"people": 20,
"status": "Good"
}
]An array of every device owned by the current user and their statistics, starting and ending on the given day.
[
{
"uuid": "aadf3v...",
"description": "Living Room",
"average": 27.5,
"max": 54
}
]The box names, and their tracker count, for a given detection identified by a unique time.
[
{
"name": "Entrance",
"count": 5
}
]The boxes present in the frame for a particular device, configured on the 'Configure Boxes' page.
[
{
"name": "Box #1",
"x": 0,
"y": 0,
"width": 1,
"height": 1
}
]A JPEG-encoded base64 string representing an image that can be placed on a HTML page.
{
"image": "ndaUYmndwoXCM...",
"rtime": 239481205
}