Cameras API

The cameras API allows the user to retrieve their cameras and update the information.

{ "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" ] }, "Camera": { "type": "object", "properties": { "cameraId": { "type": "integer", "description": "Unique identifier for the camera." }, "name": { "type": "string", "minLength": 1, "maxLength": 32, "description": "Name the user has given to this camera." }, "deviceTypeId": { "type": "integer", "description": "ID of the device type" }, "ethMacAddress": { "type": "string", "description": "Mac-address of the device (Not to be confused with the wireless Mac-address)." }, "zoneId": { "type": "integer", "description": "ID of the zone where the camera is assigned." }, "accountId": { "type": "integer", "description": "ID of the account where the camera is registered." } }, "required": [ "cameraId", "name", "deviceTypeId", "zoneId", "accountId" ] }, "CameraOnCreation": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 32, "description": "Name the user has given to this camera." }, "deviceTypeId": { "type": "integer", "description": "ID of the device type." }, "zoneId": { "type": "integer", "description": "ID of the zone where the camera is located." }, "hardwareId": { "$ref": "#/definitions/HardwareId" }, "isPnP": { "type": "boolean", "description": "Flag informing if the camera should be automatically connected using Plug-and-Play or with manual settings." }, "globalUrl": { "type": "string", "description": "Global URL of the camera for manual-connect." }, "localUrl": { "type": "string", "description": "Local URL of the camera for manual-connect." }, "username": { "type": "string", "description": "Username needed to connect to the camera. Mandatory for non-CloudCameras. Not needed for CloudCameras and the DB11 as they should be added using the default username." }, "password": { "type": "string", "description": "Password to connect to the camera. Mandatory for non-CloudCameras. Not needed for CloudCameras and the DB11 as they should be added using the default password." } }, "required": [ "name", "deviceTypeId", "zoneId", "hardwareId", "isPnP" ] }, "CameraUpdate": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 32, "description": "Name the user has given to this camera." } } }, "HardwareId": { "type": "object", "description": "Hardware id, a map contains ids like mac addresses and serials", "additionalProperties": { "type": "string" } } }, "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" } }, "conflict": { "description": "There was a conflict while trying to perform your request. See error details for more information.", "schema": { "$ref": "#/definitions/Error" } }, "unsupportedMediaType": { "description": "The requested resource does not understand the media type sent in the request.", "schema": { "$ref": "#/definitions/Error" } }, "internalServerError": { "description": "Something went wrong in the server. Please try again.", "schema": { "$ref": "#/definitions/Error" } } }, "parameters": { "cameraId": { "name": "cameraId", "in": "path", "description": "ID of the camera.", "required": true, "type": "integer" } }, "paths": { "/cameras": { "get": { "summary": "Get the list of all cameras the user has access to.", "description": "Retrieves the list of all cameras the requesting user has access to. If the parameter accountId is provided, all the cameras of that account is returned. Cameras are returned as a list of Camera object.", "operationId": "getCameras", "parameters": [ { "name": "accountId", "in": "query", "description": "ID of the account of the desired cameras.", "required": false, "type": "integer" } ], "responses": { "200": { "description": "OK", "schema": { "title": "Cameras", "type": "array", "items": { "$ref": "#/definitions/Camera" } } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Camera" ] }, "post": { "summary": "Adds a camera.", "description": "Adds a camera to the requesting users account. It returns a resource not found error message in case the zone where the camera should be added does not exist.", "operationId": "addCamera", "parameters": [ { "name": "camera", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CameraOnCreation" } } ], "consumes": [ "application/json" ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/Camera" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "415": { "$ref": "#/responses/unsupportedMediaType" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Camera" ] } }, "/cameras/{cameraId}": { "get": { "summary": "Get info of a specific camera.", "description": "Retrieves information of a specific camera.", "operationId": "getCamera", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Camera" } }, "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": [ "Camera" ] }, "patch": { "summary": "Modify the details of a specific camera.", "description": "Updates certain fields of a camera.", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "cameraUpdate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CameraUpdate" } } ], "responses": { "204": { "description": "No Content" }, "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": [ "Camera" ] }, "delete": { "summary": "Deletes a specific camera.", "description": "Removes a specific camera from the system. Do not try to add the same camera within 1 minute of its deletion.", "operationId": "deleteCamera", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "password", "in": "query", "description": "Password of the user who requests the deletion of the camera.", "required": false, "type": "string" } ], "responses": { "204": { "description": "OK" }, "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": [ "Camera" ] } } } }

swagger-camera.yaml