Camera Location API

{ "swagger": "2.0", "info": { "version": "2.4.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.4", "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" ] }, "CameraLocationUpdate": { "type": "object", "properties": { "timeZone": { "type": "string", "description": "The time zone name the camera is located in (e.g. Europe/Amsterdam). This timezone will be from the list returned by \"timeZones\" api. This list is same as the TZ database https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. It is advisable to ensure that timezone is from this \"camera timeZones\" api instead of TZ database directly because in future we might use/support subset or superset of the TZ database. Hence this api will always provide the updated list of timezones the system supports." }, "latitude": { "type": "number", "format": "double", "minimum": -90, "maximum": 90, "description": "latitude of the physical camera location in decimal degrees according to https://en.wikipedia.org/wiki/Decimal_degrees)" }, "longitude": { "type": "number", "format": "double", "description": "longitude of the physical camera location in decimal degrees according to https://en.wikipedia.org/wiki/Decimal_degrees)", "minimum": -180, "maximum": 180 } } }, "CameraLocation": { "allOf": [ { "$ref": "#/definitions/CameraLocationUpdate" }, { "type": "object", "properties": { "cameraId": { "type": "integer", "description": "unique identifier of the camera." } }, "required": [ "cameraId", "timeZone", "latitude", "longitude" ] } ] } }, "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" } }, "validationError": { "description": "The supplied object is invalid. Error detail will contain the validation error.", "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": "Unique identifier of the camera.", "required": true, "type": "integer" } }, "paths": { "/cameras/all/location": { "get": { "summary": "Get location of all the cameras in the account.", "description": "Retrieves the geo location of all the cameras in the account.", "operationId": "getAccountCameraLocations", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/CameraLocation" } } }, "401": { "$ref": "#/responses/unauthorized" }, "404": { "$ref": "#/responses/resourceNotFound" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "CameraLocation" ] } }, "/cameras/{cameraId}/location": { "get": { "summary": "Get location of a specific camera.", "description": "Retrieves the location of a specific camera. Currently it is used to fetch the timezone of the camera", "operationId": "getCameraTimezone", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/CameraLocation" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "404": { "$ref": "#/responses/resourceNotFound" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "CameraLocation" ] }, "patch": { "summary": "Update location a specific camera.", "description": "Updates location of a camera. For now, this is used to update the timezone of the camera.", "operationId": "updateCameraTimezone", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "cameraTimezone", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CameraLocationUpdate" } } ], "responses": { "204": { "description": "No Content" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "404": { "$ref": "#/responses/resourceNotFound" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "CameraLocation" ] } } } }

swagger-camera-location.yaml