Accounts API

{ "swagger": "2.0", "info": { "version": "2.0.0", "title": "Eagle Eye CameraManager API", "description": "RESTful API for the Eagle Eye CameraManager platform. This document describes actions that can be performed on a reseller's accounts. The resource 'accounts' in this document, is referring to the end customer of a reseller." }, "host": "rest.cameramanager.com", "schemes": [ "http", "https" ], "basePath": "/rest/v2.0", "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" ] }, "ContactDetails": { "type": "object", "properties": { "firstName": { "type": "string", "pattern": "[\\p{L}0-9_\\- .&+:,;/]*", "description": "The first name of the account owner.", "maxLength": 128 }, "lastName": { "type": "string", "pattern": "[\\p{L}0-9_\\- .&+:,;/]*", "description": "The last name of the account owner.", "maxLength": 128 }, "contactEmail": { "type": "string", "description": "The account owner's contact email address.", "format": "email", "maxLength": 255 } } }, "Address": { "type": "object", "properties": { "address": { "type": "string", "description": "The account owner's address.", "maxLength": 256 }, "zipCode": { "type": "string", "description": "The account owner's zip code.", "maxLength": 16 }, "city": { "type": "string", "description": "The city where the account owner is located.", "maxLength": 256 }, "country": { "type": "string", "description": "The country where the account owner is located in the ISO 3166-1 alpha-2 format.", "pattern": "[A-Z]{2}", "minLength": 2, "maxLength": 2 } } }, "AccountUpdate": { "allOf": [ { "$ref": "#/definitions/ContactDetails" }, { "$ref": "#/definitions/Address" }, { "type": "object", "properties": { "companyName": { "type": "string", "pattern": "[\\p{L}0-9_\\- .&+:,;/]*", "description": "The account owner's company name. Max length is 128 characters.", "maxLength": 128 }, "reference": { "type": "string", "description": "The account owner's reference code." }, "accountOwnerId": { "type": "integer", "description": "ID of the user owning the account." }, "phone": { "type": "string", "description": "The account owner's phone number.", "maxLength": 255 }, "vatNumber": { "type": "string", "description": "The company's VAT number.", "maxLength": 32 }, "language": { "type": "string", "description": "The main language used by the account in the ISO_639-1 format.", "pattern": "[a-z]{2}", "default": "en", "minLength": 2, "maxLength": 2 }, "currency": { "type": "string", "description": "The currency the account should be invoiced with. ISO_4217 format. Possible values are USD, EUR, YEN, GBP. Default value is EUR.", "minLength": 3, "maxLength": 3 }, "timeZone": { "type": "string", "description": "The time zone name the account is located in according to the TZ database https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. Defaults to resellers time zone", "maxLength": 64 }, "active": { "type": "boolean", "description": "The accounts active status. True indicating that the account is active, False indicating that the account is inactive." }, "clusterType": { "type": "string", "description": "Type of cluster where the account is added to", "default": "Normal", "enum": [ "Normal", "Beta" ] }, "subscriptionId": { "type": "integer", "description": "identifier of a reseller's subscription" }, "crmId": { "type": "string", "description": "customer identifier used internally by CameraManager platform", "maxLength": 24 } } } ] }, "AccountPatchUpdate": { "allOf": [ { "$ref": "#/definitions/AccountUpdate" }, { "type": "object", "properties": { "allowsHelpdesk": { "type": "boolean", "description": "The Overwrite helpdesk status. True indicating that the helpdesk is enabled, false indicating that the helpdesk is disabled." } } } ] }, "Account": { "allOf": [ { "$ref": "#/definitions/AccountUpdate" }, { "type": "object", "properties": { "accountId": { "type": "integer", "description": "ID of the account." }, "resellerId": { "type": "integer", "description": "ID of the reseller this account is belonging to" }, "accountOwnerBlocked": { "type": "boolean", "description": "The account owner blocked status." }, "lastLogin": { "type": "string", "pattern": "[0-9]{2}-[0-9]{2}-[0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2}", "description": "last login in YYYY-MM-DD HH:MM:SS format" }, "numberOfLogins": { "type": "integer", "description": "The amount of logins" }, "dateSignup": { "type": "string", "pattern": "[0-9]{2}-[0-9]{2}-[0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2}", "description": "date signup in YYYY-MM-DD HH:MM:SS format" }, "accountOwnerAllowsHelpdesk": { "type": "boolean", "description": "True if user owning this account allows helpdesk." } } } ] }, "AccountCreate": { "type": "object", "allOf": [ { "$ref": "#/definitions/AccountUpdate" } ], "required": [ "contactEmail", "firstName", "lastName", "subscriptionId" ] }, "AccountSubscriptionUpdate": { "type": "object", "properties": { "subscriptionId": { "type": "integer", "description": "ID of a new subscription for the account." } } } }, "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" } }, "internalServerError": { "description": "Something went wrong in the server. Please try again.", "schema": { "$ref": "#/definitions/Error" } } }, "parameters": { "resellerId": { "name": "resellerId", "in": "path", "description": "ID of the reseller.", "required": true, "type": "integer" }, "accountId": { "name": "accountId", "in": "path", "description": "ID of the account.", "required": true, "type": "integer" }, "targetResellerId": { "name": "targetResellerId", "in": "path", "description": "ID of target reseller.", "required": true, "type": "integer" } }, "paths": { "/resellers/{resellerId}/accounts": { "get": { "summary": "Get a list of accounts", "description": "Retrieves a list of accounts and details about the owners in descending accountID order.", "operationId": "getAccounts", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "name": "from", "in": "query", "description": "from=%d returns \"limit\" accounts excluding specified accountId When this parameter is not given, it assumes the first \"page\".", "type": "integer", "required": false }, { "name": "limit", "in": "query", "description": "The maximum amount of accounts returned in one chunk (page)", "required": false, "type": "integer", "default": 50, "minimum": 1, "maximum": 200 }, { "name": "active", "in": "query", "description": "Using this parameter you can fetch active or inactive accounts. When the parameter is not given, it retrieves both active and inactive accounts.", "type": "boolean", "required": false } ], "responses": { "200": { "description": "OK", "headers": { "X-link": { "type": "string", "description": "A link containing the api call for the next page returning the next set of accounts." }, "X-Partial": { "type": "string", "description": "Because the accounts are retrieved from multiple server, this optional header will be added if one or multiple servers do not respond. A short description is added with a list of servers that did not provide a response. When all servers respond correctly, the header is omitted." } }, "schema": { "type": "array", "items": { "$ref": "#/definitions/Account" } } }, "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": [ "Account" ] }, "post": { "summary": "Adds an account.", "description": "Adds an account and an account owner. It returns a conflict error message in case the contact email already exists. Company VAT Number mandatory depending on countries in this list 'https://www.vatlive.com/eu-vat-rules/eu-vat-number-registration/eu-vat-number-formats/'", "operationId": "addAccount", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "name": "accountCreate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AccountCreate" } } ], "consumes": [ "application/json" ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/Account" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Account" ] } }, "/resellers/{resellerId}/accounts/{accountId}": { "get": { "summary": "Retrieves a single account and details about the account owner", "description": "Retrieves a single account. When the account does not exist a resource not found error is thrown.", "operationId": "getAccount", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Account" } }, "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": [ "Account" ] }, "patch": { "summary": "Updates an account and/or the account owner's information", "description": "Updates an account and/or the account owner's information, returns a conflict error if contact email already exists.", "operationId": "updateAccount", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" }, { "name": "AccountUpdate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AccountPatchUpdate" } } ], "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" }, "409": { "$ref": "#/responses/conflict" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Account" ] } }, "/resellers/{resellerId}/accounts/{accountId}/reseller/{targetResellerId}": { "put": { "summary": "Moves account to reseller", "description": "Moves an account from it's current reseller to the target reseller.", "operationId": "moveAccountToReseller", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" }, { "$ref": "#/parameters/targetResellerId" }, { "name": "accountSubscriptionUpdate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AccountSubscriptionUpdate" } } ], "responses": { "200": { "description": "No content" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Account" ] } } } }
Accounts API YAML Specification

swagger-reseller-accounts.yaml