Reseller Subscription Types API

{ "swagger": "2.0", "info": { "version": "2.0.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.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" ] }, "Subscription": { "type": "object", "properties": { "subscriptionId": { "type": "integer", "format": "int32" }, "quality": { "$ref": "#/definitions/Quality" }, "retention": { "type": "integer", "format": "int32", "description": "Number of hours" }, "invoicePeriod": { "$ref": "#/definitions/InvoicePeriod" }, "maxAmountOfCameras": { "type": "integer", "format": "int32", "description": "From 1 to 200" }, "name": { "type": "string", "maxLength": 255 }, "sku": { "type": "string", "maxLength": 255 }, "available": { "type": "boolean", "description": "False indicates that the subscriptions isn't available anymore, but it might still be in use." } } }, "SubscriptionStatistics": { "type": "object", "properties": { "camerasPerSubscriptionType": { "type": "integer", "format": "int32" }, "usersPerSubscriptionType": { "type": "integer", "format": "int32" }, "quality": { "$ref": "#/definitions/Quality" }, "retention": { "type": "integer", "format": "int32", "description": "Number of hours" }, "invoicePeriod": { "$ref": "#/definitions/InvoicePeriod" }, "name": { "type": "string", "maxLength": 255 } } }, "Quality": { "type": "string", "enum": [ "SD1", "HD1", "HD2", "CM10" ] }, "InvoicePeriod": { "type": "string", "enum": [ "Yearly", "Monthly" ] } }, "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 partner (reseller).", "required": true, "type": "integer" }, "subscriptionId": { "name": "subscriptionId", "in": "path", "description": "ID of the subscription.", "required": true, "type": "integer" } }, "paths": { "/resellers/{resellerId}/subscriptions/{subscriptionId}": { "get": { "summary": "Get single subscription of a reseller", "description": "Retrieves a single subscription of a reseller. When the partner is not a reseller,\n a resource not found error is thrown.", "operationId": "getSubscription", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/subscriptionId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Subscription" } }, "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": [ "ResellerSubscription" ] } }, "/resellers/{resellerId}/subscriptions": { "get": { "summary": "Get all reseller subscriptions", "description": "Retrieves all reseller subscriptions. When the partner is not a reseller,\n a resource not found error is thrown.", "operationId": "getSubscriptions", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "name": "onlyAvailable", "type": "boolean", "in": "query", "description": "If true, returns only available subscriptions. Otherwise returns all subscriptions.", "required": false } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/Subscription" } } }, "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": [ "ResellerSubscription" ] } }, "/resellers/{resellerId}/statistics/subscriptions": { "get": { "summary": "Get subscription statistics of a single reseller", "description": "Retrieves subscription statistics of a single reseller. When the partner is not a reseller,\n a resource not found error is thrown.", "operationId": "getSubscriptionStatistics", "parameters": [ { "$ref": "#/parameters/resellerId" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/SubscriptionStatistics" } } }, "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": [ "ResellerSubscription" ] } } } }

swagger-subscriptions.yaml