Camera status API

REST API for retrieving the status of one or all cameras.

{ "swagger": "2.0", "info": { "version": "2.3.0", "title": "Eagle Eye CameraManager API", "description": "RESTful API for the Eagle Eye CameraManager platform." }, "host": "rest.cameramanager.com", "schemes": [ "http", "https" ], "basePath": "/rest/v2.3", "produces": [ "application/json" ], "definitions": { "Error": { "type": "object", "description": "Generic error response, modelled after RFC 7807.", "properties": { "code": { "type": "integer", "description": "Error code within the system." }, "title": { "type": "string", "description": "This title is not meant to be shown to users and is not guaranteed to stay the same. Please use the code to parse the error." }, "detail": { "type": "string", "description": "Error details, to help developers detect what went wrong." } }, "required": [ "code", "title" ] }, "OAuth2Error": { "type": "object", "description": "Generic OAuth2 error response when there is something wrong with the OAuth2 authentication. Defined at RFC 6749.", "properties": { "error": { "type": "string", "description": "A single ASCII error code conforming the pattern." }, "error_description": { "type": "string", "description": "Human-readable ASCII text providing additional information, used to assist the client developer in understanding the error that occurred." } }, "required": [ "error" ] }, "CurrentFirmwareStatus": { "type": "string", "description": "Current status of the camera's firmware", "enum": [ "upgradable", "up-to-date", "upgrading", "unknown" ] }, "CameraPasswordStatus": { "type": "string", "description": "State of the camera's credentials", "enum": [ "resetting", "unknown", "verified", "incorrect", "lookupError", "unchecked" ] }, "LastConnectionResult": { "type": "string", "description": "Result of the last attempt to connect to the camera", "enum": [ "neverConnected", "errorOnConnect", "successfulConnection" ] }, "CameraStatus": { "type": "object", "properties": { "cameraId": { "type": "integer", "description": "ID of the respective camera." }, "online": { "type": "boolean", "description": "Indicates whether the camera is online or not." }, "recordingOnCloud": { "type": "boolean", "description": "Indicates whether the camera is recording or not." }, "recordingOnSd": { "type": "boolean", "description": "Indicates whether the camera is recording on SD card or not." }, "audioEnabled": { "type": "boolean", "description": "Indicates whether audio is enabled or not for this camera." }, "passwordKnown": { "type": "boolean", "description": "Indicates whether the password is known or not for this camera." }, "passwordStatus": { "$ref": "#/definitions/CameraPasswordStatus" }, "firmwareStatus": { "$ref": "#/definitions/CurrentFirmwareStatus" }, "connectionType": { "$ref": "#/definitions/ConnectionType" }, "lastConnectionResult": { "$ref": "#/definitions/LastConnectionResult" } }, "required": [ "cameraId", "online", "recordingOnCloud", "recordingOnSd", "audioEnabled", "passwordKnown" ] }, "ConnectionType": { "description": "Indicates the current way the camera is connected to the internet. The following connection types are supported:\n * Ethernet: The camera is connected using a cable to an Ethernet network.\n * Wifi: The camera is connected to a Wi-Fi network.\n * Mobile: The camera is connected using a mobile network connection.\n * Unknown: It is currently unknown how the camera is connected.\n\nIt is only supported by some specific cameras (e.g. Mobile cameras). It is null for the cameras which do not support it. \n", "type": "string", "enum": [ "Ethernet", "Wifi", "Mobile", "Unknown" ] }, "CameraStatusUpdate": { "type": "object", "properties": { "online": { "type": "boolean", "description": "Indicates whether the camera is online or not." } } } }, "responses": { "resourceNotFound": { "description": "Referenced resource could not be found.", "schema": { "$ref": "#/definitions/Error" } }, "unauthorized": { "description": "You are not authenticated. Please authenticate and try again.", "schema": { "$ref": "#/definitions/OAuth2Error" } }, "forbidden": { "description": "You have no permission to access the specified resource.", "schema": { "$ref": "#/definitions/Error" } }, "validationError": { "description": "The supplied object is invalid. Error detail will contain the validation error.", "schema": { "$ref": "#/definitions/Error" } }, "notAcceptableError": { "description": "The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.", "schema": { "$ref": "#/definitions/Error" } }, "internalServerError": { "description": "Something went wrong in the server. Please try again.", "schema": { "$ref": "#/definitions/Error" } }, "timeout": { "description": "Your request has timed out.", "schema": { "$ref": "#/definitions/Error" } } }, "parameters": { "cameraId": { "name": "cameraId", "in": "path", "description": "ID of the camera.", "required": true, "type": "integer" }, "targetState": { "name": "targetState", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CameraStatusUpdate" } } }, "paths": { "/cameras/{cameraId}/status": { "get": { "summary": "Get the status of the camera.", "description": "Retrieves the status of a specific camera.", "operationId": "getCameraStatus", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/CameraStatus" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "CameraStatus" ] }, "put": { "summary": "Wait till camera is in given state.", "description": "As a client can't really set these values, instead we will waits until the camera is in the given state.", "operationId": "waitForCameraStatus", "deprecated": true, "parameters": [ { "$ref": "#/parameters/cameraId" }, { "$ref": "#/parameters/targetState" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/CameraStatus" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" }, "504": { "$ref": "#/responses/timeout" } }, "tags": [ "CameraStatus" ] } }, "/cameras/all/status": { "get": { "summary": "Get the status of all cameras.", "description": "Retrieves the status of all cameras the user has access to.", "operationId": "getAllCamerasStatus", "responses": { "200": { "description": "OK", "schema": { "title": "CamerasStatus", "type": "array", "items": { "$ref": "#/definitions/CameraStatus" } } }, "401": { "$ref": "#/responses/unauthorized" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "CameraStatus" ] } } } }

Camera Status API YAML specification
swagger-camera-status.yaml