User status 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" ] }, "UserStatusUpdate": { "type": "object", "properties": { "allowsHelpdeskExpirationDate": { "type": "string", "format": "date-time", "description": "Date and time till the user allows support team and his reseller to start the client application on behalf of the user. The time is expressed in UTC." } }, "required": [ "allowsHelpdeskExpirationDate" ] }, "UserStatus": { "allOf": [ { "$ref": "#/definitions/UserStatusUpdate" }, { "type": "object", "properties": { "allowsHelpdesk": { "type": "boolean", "description": "True indicates that the user allows support and user's partner to start the client application on behalf of the user. False indicates only the user can start the client application." }, "blocked": { "type": "boolean", "description": "Indicates whether the user is currently blocked from using CameraManager." }, "scheduled": { "type": "boolean", "description": "Indicates whether the user is currently allowed to use Eagle Eye CameraManager based on their log-in schedule." } } } ] } }, "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/status": { "get": { "summary": "Get the status of the current user.", "description": "Check whether the user is allowed to use CameraManager. You will get information about access to the account, if it is blocked, if it allows access according to schedule, or if allow helpdesk access is enabled (right with the expiration date with information when it will be disabled again).", "operationId": "getUserStatus", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UserStatus" } }, "401": { "$ref": "#/responses/unauthorized" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Users" ] }, "patch": { "summary": "Updates the status of the current user.", "description": "Updates expiration flag for allows support to open client application via helpdesk. You can specify how long the support access is enabled, or you can just disable it. To enable helpdesk for infinite time you can set the `allowsHelpdeskExpirationDate` to `9999-12-31T23:59:59.000+0000`. To disable helpdesk you can either set the `allowsHelpdeskExpirationDate` to current time or `1000-01-01T00:00:00.000+0000`.", "operationId": "updateUserStatus", "parameters": [ { "name": "UserStatusUpdate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UserStatusUpdate" } } ], "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": [ "Users" ] } } } }

swagger-user-status.yaml