User Rights 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" ] }, "UserRights": { "type": "object", "description": "All permissions of a user.", "properties": { "ptz": { "type": "boolean", "description": "Change the PTZ position of a camera" }, "microphone": { "type": "boolean", "description": "Listen to audio of a camera" }, "edgeStorageManagement": { "type": "boolean", "description": "Edge storage management" }, "playback": { "type": "boolean", "description": "View recordings" }, "deleteRecording": { "type": "boolean", "description": "Delete footage" }, "lockRecording": { "type": "boolean", "description": "Lock footage" }, "export": { "type": "boolean", "description": "Use export" }, "addSequence": { "type": "boolean", "description": "Add a sequence" }, "editSequence": { "type": "boolean", "description": "Edit a sequence" }, "deleteSequence": { "type": "boolean", "description": "Remove a sequence" }, "addZone": { "type": "boolean", "description": "Add a zone" }, "editZone": { "type": "boolean", "description": "Edit a zone" }, "deleteZone": { "type": "boolean", "description": "Delete a zone" }, "addCameraGroup": { "type": "boolean", "description": "Add a camera group" }, "editCameraGroup": { "type": "boolean", "description": "Edit a camera group" }, "deleteCameraGroup": { "type": "boolean", "description": "Delete a camera group" }, "addPnpCamera": { "type": "boolean", "description": "Add PnP camera" }, "addCameraManually": { "type": "boolean", "description": "Add camera manually" }, "editCamera": { "type": "boolean", "description": "Edit a camera" }, "deleteCamera": { "type": "boolean", "description": "Remove a camera" }, "editSchedule": { "type": "boolean", "description": "Edit schedule" }, "motionDetection": { "type": "boolean", "description": "Edit motion detection settings" }, "audioPIR": { "type": "boolean", "description": "Enable audio and PIR detection" }, "receiveCameraAlerts": { "type": "boolean", "description": "Receive camera MD alerts" }, "addUser": { "type": "boolean", "description": "Add user" }, "editUser": { "type": "boolean", "description": "Edit user" }, "deleteUser": { "type": "boolean", "description": "Delete user" }, "blockUser": { "type": "boolean", "description": "Block and unblock users" }, "viewUserSettings": { "type": "boolean", "description": "View sub user settings" }, "localExceptions": { "type": "boolean", "description": "Local exceptions" }, "cameraExposureControl": { "type": "boolean", "description": "Exposure control" }, "cameraPrivacyButton": { "type": "boolean", "description": "Privacy button" }, "cameraIllumination": { "type": "boolean", "description": "Light" }, "storageUsage": { "type": "boolean", "description": "Storage usage" }, "logFiles": { "type": "boolean", "description": "Log files" }, "demoUser": { "type": "boolean", "description": "Demo user" }, "cameraIds": { "type": "array", "items": { "type": "number" } }, "zoneIds": { "type": "array", "items": { "type": "number" } } } } }, "parameters": { "userId": { "name": "userId", "in": "path", "description": "ID of the user.", "required": true, "type": "integer" } }, "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" } } }, "paths": { "/users/self/rights": { "get": { "summary": "Get permissions of the current user.", "description": "Get permissions of the current user. The list consists of user permissions, cameras identifiers and zones identifiers to which the user has access to.", "operationId": "getUserRights", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UserRights" } }, "401": { "$ref": "#/responses/unauthorized" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "UserRights" ] } }, "/users/{userId}/rights": { "get": { "summary": "Get permissions of a specified user.", "description": "Get permissions of a specified user. The list consists of user permissions, cameras identifiers and zones identifiers to which the user has access to.", "operationId": "getUserRightsById", "parameters": [ { "$ref": "#/parameters/userId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UserRights" } }, "401": { "$ref": "#/responses/unauthorized" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "UserRights" ] }, "patch": { "summary": "Update permissions of a specified user.", "description": "Update permissions of a specified user. Updated can be user permissions, cameras permissions and zones permissions.", "operationId": "updateUserRightsById", "parameters": [ { "$ref": "#/parameters/userId" }, { "name": "UserRightsUpdate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UserRights" } } ], "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": [ "UserRights" ] } } } }

swagger-user-rights.yaml