OpenCamera API Reference
Open Camera APIs to provide a secure / open security camera solution.
Version: 1.0.0
Authentication
basicAuth
key
device
Everything about device itself, such as firmware version, health status
Get device information
Get device information
Success
Access token is missing or invalid
Response Content-Types: application/json
Response Example (200 OK)
{
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"uptime": "integer (int64)",
"resolution": "1920×1080",
"fps": 30,
"video_codec": "H.265",
"audio_codec": "G.711"
}
user
User to manage the camera
Create user
Only one user is supported.
Created user object
Request Example
{
"id": 10,
"firstName": "John",
"lastName": "James",
"email": "john@email.com",
"password": 12345,
"phone": "12345"
}
successful operation
Response Content-Types: application/json
Logs user into the system and obtain token
Encoded token
Invalid username/password supplied
Response Example (200 OK)
{
"access_token": "string (string)",
"valid_until": "2022-02-02T00:00:00.000Z"
}
Refresh token
New extend date
Invalid username/password supplied
Response Example (200 OK)
{
"valid_until": "2022-02-02T00:00:00.000Z"
}
Logs out current logged in user session
successful operation
Access token is missing or invalid
Reset user password
Created user object
Request Example
123456
successful operation
Response Content-Types: application/json
media
Camera audio and video operation
Update live session configuration
Update live session configuration, such as ice servers
Live session configuration
Request Content-Types: application/json
Request Example
{
"ice_servers": [
"stun.l.google.com:19302"
]
}
successful operation
bad request
internal server error
Start live media session
Start media session to view camera live status
sdp data of peer connect data
Request Content-Types: application/json
Request Example
{
"type": "offer",
"sdp": "",
"valid_until": "2022-02-02T00:00:00.000Z"
}
successful operation
bad request
internal server error
Response Content-Types: application/json
Response Example (200 OK)
{
"type": "offer",
"sdp": "",
"valid_until": "2022-02-02T00:00:00.000Z"
}
Download recorded videos
Download record videos
recording start time
recording end time
successful operation
Response Content-Types: application/json
system
Get system information
Get system information
Success
Access token is missing or invalid
Response Content-Types: application/json
Response Example (200 OK)
{
"firmwareVersion": "1.0.1",
"sdcard_free": 10,
"sdcard_total": 10,
"live_session_config": {
"ice_servers": [
"stun.l.google.com:19302"
]
}
}
Upgrade system firmware with uploaded file
Upgrade system firmware
The firmware image to upload.
Success
Access token is missing or invalid
Schema Definitions
DeviceInfo: object
- uuid: string
- uptime: integer (int64)
-
device uptime in unix time
- resolution: string
-
camera resolution. Its format is "widthxheight"
- fps: integer
-
frame per second
- video_codec: string , x ∈ { H.264 , H.265 }
-
video codec
- audio_codec: string , x ∈ { G.711 }
-
audio codec
Example
{
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"uptime": "integer (int64)",
"resolution": "1920×1080",
"fps": 30,
"video_codec": "H.265",
"audio_codec": "G.711"
}
SDP: object
- type: string
- sdp: string
- valid_until: string (date)
-
data is valid until this specified date in UTC.
Example
{
"type": "offer",
"sdp": "",
"valid_until": "2022-02-02T00:00:00.000Z"
}
LiveSessionConfig: object
- ice_servers: string[]
Example
{
"ice_servers": [
"stun.l.google.com:19302"
]
}
SystemInfo: object
- firmwareVersion: string
- sdcard_free: integer
-
free sd card disk in GB
- sdcard_total: integer
-
total sd card disk in GB
- live_session_config: LiveSessionConfig
Example
{
"firmwareVersion": "1.0.1",
"sdcard_free": 10,
"sdcard_total": 10,
"live_session_config": {
"ice_servers": [
"stun.l.google.com:19302"
]
}
}