Account Subscriptions 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" ] }, "ResellerAccountSubscription": { "type": "object", "properties": { "subscriptionId": { "type": "integer", "format": "int32", "description": "identifier of the ongoing subscription" }, "startDate": { "type": "string", "description": "Subscription start date. Formatting according to ISO 8601's full-date format: yyyy-mm-dd.", "format": "date" }, "endDate": { "type": "string", "description": "Subscription end date. Formatting according to ISO 8601's full-date format: yyyy-mm-dd.", "format": "date" }, "nextSubscriptionId": { "type": "integer", "format": "int32", "description": "identifier of the subscription that will become effective from next billing period. Contains value '-1' if subscription is scheduled for deactivation." } } }, "ResellerAccountSubscriptionUpdate": { "type": "object", "properties": { "nextSubscriptionId": { "type": "integer", "format": "int32", "description": "A subscription identifier from one of those available to the account's reseller. The change will take effect depending on whether this value belongs to a subscription that represents an upgrade of the current subscription or a downgrade. Upgrade will be effective immediately. Downgrade will be effective from next billing period. This field is ignored if 'deactivate' is True. " }, "deactivate": { "type": "boolean", "default": false, "description": "if True current subscription will be scheduled for deactivation which will be effective at the end of billing period." }, "effectiveToday": { "type": "boolean", "default": false, "description": "If True change will become effective immediately. This field's usage is restricted to platform admin." } } } }, "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" } } }, "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" } }, "paths": { "/resellers/{resellerId}/accounts/{accountId}/subscriptions/current": { "get": { "summary": "Get details of currently active subscription", "description": "Retrieves subscription ID together with start and end date. Also retrieves next subscription ID. Next subscription ID is the same if no downgrade is scheduled. Next subscription ID is different from subscription ID if downgrade is scheduled. Next subscription ID is -1 if subscription is scheduled for deactivation.", "operationId": "getResellerAccountSubscription", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ResellerAccountSubscription" } }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "ResellerAccountSubscription" ] }, "patch": { "summary": "Update a specific subscription", "description": "Allows to do one of the following changed to the subscription: - upgrade currently active subscription - downgrade currently active subscription - undo scheduling of downgrade", "operationId": "updateResellerAccountSubscription", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" }, { "name": "resellerAccountSubscription", "in": "body", "description": "Changes to apply", "schema": { "$ref": "#/definitions/ResellerAccountSubscriptionUpdate" } } ], "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": [ "ResellerAccountSubscription" ] } } } }
Subscription API YAML Specification
swagger-reseller-account-subscription.yaml