User Credentials API

{ "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" ] }, "UserCredentials": { "type": "object", "properties": { "usernameAndPassword": { "type": "object", "description": "Checks whether the user is able to login using username and password.", "properties": { "userId": { "type": "integer", "description": "ID of the user." }, "email": { "type": "string", "description": "User's email.", "maxLength": 255, "minLength": 5 } }, "required": [ "enabled" ] } }, "required": [ "usernameAndPassword" ] }, "UserCredentialsUpdate": { "type": "object", "properties": { "usernameAndPassword": { "type": "object", "description": "Update the password the user is using to login with username and password.", "properties": { "password": { "type": "string", "pattern": "[\\w-.,!?@$&*^=%:/~+#\"]*", "description": "User new password.", "minLength": 8, "maxLength": 32 } } } }, "required": [ "password" ] } }, "responses": { "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/credentials": { "get": { "summary": "Get the status of user credentials.", "description": "Retrieve details for the given user if he can authenticate themselves using username and password.", "operationId": "getUserCredentials", "parameters": [ { "name": "password", "in": "query", "description": "Current password of the user who requests the credentials status.", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UserCredentials" } }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "User Credentials" ] }, "patch": { "summary": "Updates credentials for the user.", "description": "Updates user's credentials.", "operationId": "updateUserCredentials", "parameters": [ { "name": "UserCredentialsUpdate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UserCredentialsUpdate" } } ], "responses": { "204": { "description": "No content" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "User Credentials" ] } } } }

swagger-user-credentials.yaml