Reseller Account Subscriptions

{ "swagger": "2.0", "info": { "version": "2.3.0", "title": "Eagle Eye CameraManager API", "description": "RESTful API for the Eagle Eye CameraManager platform. A partner can use this APIs to manage the subscription instances of their accounts. At the moment only subscriptions of group type 'Mobile' can be fully managed with this endpoints. Viewing is possible for 'Cloud' subscription group type too.\n" }, "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" ] }, "SubscriptionGroupType": { "type": "string", "description": "Identifies a group of subscription types, a subset among the complete set of subscription types. Not to be confused with a subscriptionId, which identifies a specific subscription instance. Possible values:\n * cloud: group for cloud subscription types. The instances of those subscription types are each tied to a specific account.\n * mobile: group for all the mobile data subscription types. The instances of those subscription types are each tied to a specific SIM card.\n", "enum": [ "cloud", "mobile" ] }, "AccountSubscriptionDetailsCreation": { "type": "object", "description": "extra fields that are needed to create a subscription instance. The fields of this object are different depending on the subscription group type." }, "AccountMobileSubscriptionDetailsCreation": { "description": "Object containing the details needed to create an instance of a mobile data subscription.", "allOf": [ { "$ref": "#/definitions/AccountSubscriptionDetailsCreation" }, { "type": "object", "properties": { "iccid": { "type": "string", "description": "ICCID that uniquely identifies the SIM card assigned to the subscription instance." } }, "required": [ "iccid" ] } ] }, "AccountSubscriptionDetailsUpdate": { "type": "object", "description": "extra fields that are used to change a subscription instance. The fields of this object are different depending on the subscription group type." }, "AccountSubscriptionDetails": { "type": "object", "description": "extra fields specific to the subscription instance. The fields of this object are different depending on the subscription group type. If group type is \"cloud\", this object is empty. If the group type is \"mobile\", it will contain iccid of the sim which is mapped to the mobile subscription." }, "AccountMobileSubscriptionDetails": { "description": "details object returned when the subscription is of group type \"mobile\".", "allOf": [ { "$ref": "#/definitions/AccountSubscriptionDetails" }, { "type": "object", "properties": { "iccid": { "type": "string", "description": "ICCID that uniquely identifies the SIM card assigned to the subscription instance." } }, "required": [ "iccid" ] } ] }, "Sku": { "type": "string", "description": "identifier of a product as in the price list." }, "AccountSubscriptionCreation": { "type": "object", "description": "Object to be provided when a new subscription instance is created. If you want to create:\n * A mobile data subscription: then set type=mobile and a AccountSubscriptionDetailsCreation object for the subscriptionDetails field.\n", "properties": { "sku": { "$ref": "#/definitions/Sku" }, "groupType": { "$ref": "#/definitions/SubscriptionGroupType" }, "subscriptionDetails": { "$ref": "#/definitions/AccountSubscriptionDetailsCreation" } }, "required": [ "sku", "groupType", "subscriptionDetails" ] }, "AccountSubscriptionUpdate": { "type": "object", "description": "Object to be provided when you want to change a subscription. If you want to:\n * Deactivate a subscription: then set sku field to 'unassigned'.\n * Activate a deactivated subscription: the set a valid SKU for the sku field.\n * Change the subscription: set a valid SKU for the sku field.\n * Assign or change the SIM card tied to the subscription: set the iccid field in the subscriptionDetails object.\n", "properties": { "sku": { "$ref": "#/definitions/Sku" }, "groupType": { "$ref": "#/definitions/SubscriptionGroupType" }, "subscriptionDetails": { "$ref": "#/definitions/AccountSubscriptionDetailsUpdate" } } }, "AccountSubscription": { "type": "object", "properties": { "subscriptionId": { "type": "string", "description": "ID of the subscription instance." }, "accountId": { "type": "integer", "description": "ID of the account that owns the subscription instance." }, "sku": { "$ref": "#/definitions/Sku" }, "groupType": { "$ref": "#/definitions/SubscriptionGroupType" }, "subscriptionDetails": { "$ref": "#/definitions/AccountSubscriptionDetails" } }, "required": [ "subscriptionId", "accountId", "sku", "groupType", "subscriptionDetails" ] } }, "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" } }, "overloadedServerError": { "description": "The server is currently busy and cannot process 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": "identifier of the owner of the subscription instance.", "required": true, "type": "integer" }, "subscriptionId": { "name": "subscriptionId", "in": "path", "description": "identifier of the subscription instance.", "required": true, "type": "string" } }, "paths": { "/resellers/{resellerId}/accounts/{accountId}/subscriptions": { "get": { "summary": "get the list of subscription instances for the given account. The subscription group type of each item can be different.", "operationId": "getAccountSubscriptions", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/AccountSubscription" } } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "AccountSubscriptions" ] }, "post": { "summary": "create a new subscription instance for the given account.", "description": "Create a new subscription instance for the given account and the given reseller.", "operationId": "createAccountSubscription", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" }, { "name": "subscription", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AccountSubscriptionCreation" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/AccountSubscription" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "500": { "$ref": "#/responses/internalServerError" }, "503": { "$ref": "#/responses/overloadedServerError" } }, "tags": [ "AccountSubscriptions" ] } }, "/resellers/{resellerId}/accounts/{accountId}/subscriptions/{subscriptionId}": { "get": { "summary": "get the subscription instance identified by the given subscriptionId.", "operationId": "getAccountSubscription", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" }, { "$ref": "#/parameters/subscriptionId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/AccountSubscription" } }, "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": [ "AccountSubscriptions" ] }, "delete": { "summary": "delete the subscription instance identified by the given subscriptionId.", "operationId": "deleteAccountSubscription", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" }, { "$ref": "#/parameters/subscriptionId" } ], "responses": { "204": { "description": "OK" }, "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" }, "503": { "$ref": "#/responses/overloadedServerError" } }, "tags": [ "AccountSubscriptions" ] }, "patch": { "summary": "change the subscription instance identified by the given subscriptionId.", "description": "Change the subscription. That can mean performing one of the following operations:\n<ul>\n <li>Change the SKU of the subscription. If the provided value is 'unassigned', that means deactivating the subscription.</li>\n <li>Change the SIM card tied to the subscription.</li>\n</ul>\n<p>The server will return a 409 if the caller tries:\n<ul>\n <li>to perform the two operations simultaneously.</li>\n <li>to set a new SKU that is not valid for the given account</li>\n <li>to set a new SIM card that cannot be assigned to the given account.</li>\n</ul>", "operationId": "updateAccountSubscription", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" }, { "$ref": "#/parameters/subscriptionId" }, { "name": "subscription", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AccountSubscriptionUpdate" } } ], "responses": { "204": { "description": "OK" }, "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" }, "503": { "$ref": "#/responses/overloadedServerError" } }, "tags": [ "AccountSubscriptions" ] } } } }

swagger-resellers-accounts-subscriptions.yaml