From 0bc13963a5337b52fab94bb184e4f53210355994 Mon Sep 17 00:00:00 2001 From: Ivan Chesnov Date: Fri, 19 Aug 2022 16:19:58 +0300 Subject: [PATCH] Api spec for import to account order (#672) * response schema's for sites/{id}/inserviceNumbers|orders|orders/{id}|totalTns|portins * Api spec for importToAccount order * small fix * fix after review * fix after review * fix after review Co-authored-by: ichesnov --- site/specs-temp/numbers.json | 505 ++++++++++++++++++++++++++++++++++- 1 file changed, 504 insertions(+), 1 deletion(-) diff --git a/site/specs-temp/numbers.json b/site/specs-temp/numbers.json index 4036e4467..6c0849538 100644 --- a/site/specs-temp/numbers.json +++ b/site/specs-temp/numbers.json @@ -7296,6 +7296,222 @@ } } }, + "/accounts/{accountId}/importToAccount": { + "get": { + "tags": [ + "/accounts" + ], + "description": "Retrieve a list of the Import to Account orders that have previously performed on the account. The query must always specify pagination parameters (size, page). The results can also be optionally limited with start date and end date .\n", + "summary": "List Import to Account orders", + "operationId": "ReadImportToAccountOrders", + "parameters": [ + { + "$ref": "#/components/parameters/AccountIdPathParam" + }, + { + "name": "page", + "description": "All Order retrievals must be paginated, using page and size indicators. The page parameter contains the `` that is to start the page, or \"1\" in the case of the first page", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "example": "cbdcfc94-81b1-4ce9-8b6d-f8d6b85381ba" + }, + { + "name": "size", + "description": "The size parameter indicates the number of orders to return in the payload", + "in": "query", + "required": true, + "schema": { + "type": "integer" + }, + "example": 20 + }, + { + "name": "startdate", + "description": "Checks the order's creation date against this value. Orders that have a creation date after this date will be included. Format is yyyy-MM-dd", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "2013-10-22" + }, + { + "name": "enddate", + "description": "Checks the order's creation date against this value. Orders that have a creation date before this date will be included. Format is yyyy-MM-dd", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "2013-10-25" + } + ], + "responses": { + "200": { + "description": "The response provides a list of all of the orders in the date range that have been issued against the account.\n", + "content": { + "application/xml": { + "examples": { + "example": { + "description": "example", + "value": "\n\n \n 3\n \n 14\n 2\n team_ua\n 2014-07-07T10:06:43.427Z\n import_to_account\n 2014-07-07T10:06:43.427Z\n 37a6447c-1a0b-4be9-ba89-3f5cb0aea142\n FAILED\n \n \n 14\n 2\n team_ua\n 2014-07-07T10:05:56.595Z\n import_to_account\n 2014-07-07T10:05:56.595Z\n 743b0e64-3350-42e4-baa6-406dac7f4a85\n RECEIVED\n \n \n 14\n 2\n team_ua\n 2014-07-07T09:32:17.234Z\n import_to_account\n 2014-07-07T09:32:17.234Z\n f71eb4d2-bfef-4384-957f-45cd6321185e\n RECEIVED\n \n \n" + } + }, + "schema": { + "$ref": "#/components/schemas/ResponseSelectWrapper" + } + } + } + } + } + }, + "post": { + "tags": [ + "/accounts" + ], + "description": "Import a large number of previously ported or otherwise acquired numbers into the account\n", + "summary": "Import to Account order", + "operationId": "CreateImportToAccountOrder", + "parameters": [ + { + "$ref": "#/components/parameters/AccountIdPathParam" + } + ], + "requestBody": { + "content": { + "application/xml": { + "schema": { + "$ref": "#/components/schemas/ImportToAccountOrderRequest" + }, + "examples": { + "example": { + "value": "\n\n\t\n\t\t10D\n\t\t\n\t\t\t4158714244\n\t\t\t6105330709\n\t\t\n\t\tNOCHARGE\n\t\tAvailable\n\t\t\n\t\t\tProtected\n\t\t\n\t\tLevel 3\n\t\tTestId1234\n\t\t2\n\t\n\t1\n\t12345\n\t" + } + } + } + } + }, + "responses": { + "201": { + "description": "The order has been created and an order ID will be specified in the payload and in the header.", + "content": { + "application/xml": { + "examples": { + "example": { + "value": "\n\n\t\n\t\tc5986599-3a7c-4eed-a5c4-9121c17d54ab\n\t\t2014-04-01T21:54:18.796Z\n\t\t\n\t\t\tSJM00001\n\t\t\t2\n\t\t\tNOCHARGE\n\t\t\t10D\n\t\t\tAvailable\n\t\t\t\n\t\t\t\tProtected\n\t\t\t\n\t\t\t\n\t\t\t\t4158714245\n\t\t\t\t6105330710\n\t\t\t\n\t\t\tLevel 3\n\t\t\n\t\t743\n\t\t12345\n\t\n\t" + } + }, + "schema": { + "$ref": "#/components/schemas/ImportToAccountNumberOrderResponse" + } + } + } + }, + "400": { + "description": "The order failed; one of the input parameters is invalid. The error text and an error code will be provided in the ErrorList element.

", + "content": { + "application/xml": { + "examples": { + "example": { + "value": "\n\n\t \n\t\t \n\t\t\t 7309\n\t\t\t The site id was not supplied or is invalid.\n\t\t \n\t\t \n\t\t\t 7312\n\t\t\t The sippeer id is invalid.\n\t\t \n\t \n \n" + } + }, + "schema": { + "$ref": "#/components/schemas/ImportToAccountNumberOrderErrorResponse" + } + } + } + } + } + } + }, + "/accounts/{accountId}/importToAccount/{orderId}": { + "get": { + "tags": [ + "/accounts" + ], + "description": "Retrieve information about a import to account order with specified ID.", + "summary": "Fetch Import To Account order status", + "operationId": "ReadImportToAccountOrder", + "parameters": [ + { + "$ref": "#/components/parameters/AccountIdPathParam" + }, + { + "name": "orderId", + "description": "Import To Account order's ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "example": "093a9f9b-1a78-4e47-b6e2-776a484596f4" + } + ], + "responses": { + "200": { + "description": "The information has been successfully retrieved and displayed in the payload.", + "content": { + "application/xml": { + "examples": { + "example": { + "value": "\n\n\t\n\t\n\t\t9199918393\n\t\t9199918394\n\t\n\t\n\t\t2014-04-18T16:38:05.001Z\n\t\t303716\n\t\t\n\t\t\tTestId1234\n\t\t\t2\n\t\t\tfalse\n\t\t\tfalse\n\t\t\tAvailable\n\t\t\t\n\t\t\t\tProtected\n\t\t\t\n\t\t\t\n\t\t\t\t9199918393\n\t\t\t\t9199918394\n\t\t\t\n\t\t\tBandwidth CLEC\n\t\t\n\t\t743\n\t\n\tCOMPLETE\n\t\n\t\t\n\t\t\t9199918393\n\t\t\n\t\t\n\t\t\t9199918394\n\t\t\n\t\n" + } + }, + "schema": { + "$ref": "#/components/schemas/ImportToAccountNumberOrderResponseForGet" + } + } + } + } + } + } + }, + "/accounts/{accountId}/importToAccount/{orderId}/history": { + "get": { + "tags": [ + "/accounts" + ], + "description": "Retrieves the history of the specified importToAccount order.", + "summary": "Fetch Import to Account order history", + "operationId": "ReadImportToAccountOrderHistory", + "parameters": [ + { + "$ref": "#/components/parameters/AccountIdPathParam" + }, + { + "name": "orderId", + "description": "Import to Account order's ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "example": "093a9f9b-1a78-4e47-b6e2-776a484596f4" + } + ], + "responses": { + "200": { + "description": "The history has been successfully retrieved and displayed in the payload.", + "content": { + "application/xml": { + "examples": { + "example": { + "value": "\n\n\t \n\t\t 2015-06-16T14:03:10.225Z\n\t\t Import to Account is received.\n\t\t admin\n\t\t RECEIVED\n\t \n\t \n\t \n\t\t 2015-06-16T14:03:10.789Z\n\t\t Import to Account is partial.\n\t\t admin\n\t\t PARTIAL\n\t \n \n" + } + }, + "schema": { + "$ref": "#/components/schemas/OrderHistoryWrapper" + } + } + } + } + } + } + }, "/accounts/{accountId}/inserviceNumbers": { "get": { "tags": [ @@ -29203,7 +29419,7 @@ "lastModifiedDate": { "type": "string" }, - "OrderId": { + "orderId": { "type": "string" }, "OrderType": { @@ -30653,6 +30869,293 @@ } } } + }, + "SiteOrdersResponse": { + "type": "object", + "properties": { + "ResponseSelectWrapper": { + "type": "object", + "properties": { + "ListOrderIdUserIdDate": { + "type": "object", + "properties": { + "TotalCount": { + "type": "integer" + }, + "OrderIdUserIdDate": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderSummary" + } + } + } + } + } + } + } + }, + "SiteTNsResponse": { + "type": "object", + "properties": { + "SiteTNs": { + "type": "object", + "properties": { + "TotalCount": { + "type": "integer" + } + } + } + } + }, + "ImportToAccountOrderRequest": { + "title": "ImportTnAccountOrder", + "properties": { + "ImportToAccountNumberOrder": { + "type": "object", + "required": [ + "ImportToAccountNumberOrderType", + "SiteId" + ], + "properties": { + "ImportToAccountNumberOrderType": { + "$ref": "#/components/schemas/ImportToAccountNumberOrderType" + }, + "SiteId": { + "description": "A site id to which telephone number will be imported", + "type": "integer" + }, + "PeerId": { + "description": "A sippeer id of provided site to which telephone number will be imported", + "type": "integer" + } + } + } + } + }, + "ImportToAccountOrderResponseOrderRequest": { + "title": "orderRequest", + "properties": { + "ImportToAccountNumberOrderType": { + "$ref": "#/components/schemas/ImportToAccountNumberOrderType" + }, + "SiteId": { + "description": "A site id to which telephone number will be imported", + "type": "integer" + }, + "PeerId": { + "description": "A sippeer id of provided site to which telephone number will be imported", + "type": "integer" + }, + "OrderCreatedDate": { + "$ref": "#/components/schemas/OrderCreatedDate" + } + } + }, + "ImportToAccountNumberOrderResponse": { + "title": "ImportToAccountNumberOrderResponse", + "properties": { + "OrderRequest": { + "type": "object", + "properties": { + "ImportToAccountNumberOrderType": { + "$ref": "#/components/schemas/ImportToAccountNumberOrderType" + }, + "id": { + "description": "Assigned order id.", + "type": "integer" + }, + "OrderCreatedDate": { + "$ref": "#/components/schemas/OrderCreatedDate" + }, + "SiteId": { + "description": "A site id to which telephone number will be imported", + "type": "integer" + }, + "PeerId": { + "description": "A sippeer id of provided site to which telephone number will be imported", + "type": "integer" + }, + "ErrorList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + }, + "ImportToAccountNumberOrderErrorResponse": { + "title": "ImportToAccountNumberOrderErrorResponse", + "properties": { + "OrderRequest": { + "type": "object", + "properties": { + "ErrorList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + }, + "ImportToAccountNumberOrderResponseForGet": { + "title": "ImportToAccountNumberOrderResponse", + "properties": { + "OrderRequest": { + "type": "object", + "properties": { + "ImportedTelephoneNumberList": { + "$ref": "#/components/schemas/ImportedTelephoneNumberList" + }, + "orderRequest": { + "$ref": "#/components/schemas/ImportToAccountOrderResponseOrderRequest" + }, + "OrderStatus": { + "type": "string" + }, + "ImportedTelephoneNumberDetailList": { + "$ref": "#/components/schemas/ImportedTelephoneNumberDetailList" + }, + "ErrorList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + }, + "ImportToAccountNumberOrderType": { + "type": "object", + "required": [ + "TelephoneNumberList", + "BillingType", + "VendorName" + ], + "properties": { + "TelephoneNumberList": { + "$ref": "#/components/schemas/TelephoneNumberList" + }, + "BatchId": { + "$ref": "#/components/schemas/BatchId" + }, + "BatchSize": { + "$ref": "#/components/schemas/BatchSize" + }, + "VendorName": { + "$ref": "#/components/schemas/VendorName" + }, + "BillingType": { + "$ref": "#/components/schemas/BillingType" + }, + "TnAttributes": { + "$ref": "#/components/schemas/TnAttributes" + }, + "InitialStatus": { + "$ref": "#/components/schemas/InitialStatus" + } + } + }, + "TelephoneNumberList": { + "description": "List of telephone numbers to be imported", + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "TelephoneNumber": { + "description": "Ten digit phone number with no dots or dashes", + "type": "integer" + } + } + } + }, + "ImportedTelephoneNumberList": { + "description": "List of telephone numbers that were imported", + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "TelephoneNumber": { + "description": "Ten digit phone number with no dots or dashes", + "type": "integer" + } + } + } + }, + "ImportedTelephoneNumberDetailList": { + "description": "List of telephone numbers details that were imported", + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "TelephoneNumberDetail": { + "type": "object", + "properties": { + "FullNumber": { + "description": "Ten digit phone number with no dots or dashes", + "type": "integer" + } + } + } + } + } + }, + "BatchId": { + "description": "A user-chosen id for the batch of phone numbers. This Batch ID can span multiple number submissions. Up to 10 alphanumeric characters. If the submission is not intended to be grouped into a batch of submissions then the Batch ID must be globally unique. It is recommended that the batch ids be globally unique, and that imports not be grouped together in batches by use of a common batch id.", + "type": "string" + }, + "BatchSize": { + "description": "The number of TNs in the batch, aggregated across all of the orders in the batch. This total spans API Calls, so if 3 calls are necessary to import 15000 numbers, this value would be 15000. It is recommended to use a batch size equal to the number of telephone numbers in the API call, and use a different batch name for each API call - essentially limiting a batch to a single API call.", + "type": "integer" + }, + "VendorName": { + "description": "The vendor that owns the number that is being ported in. If the number is manually ported to a partner’s network then this would reflect that partner.", + "type": "string" + }, + "BillingType": { + "description": "Type of billing rules to be applied.", + "type": "string", + "enum": [ + "NOCHARGE", + "PORTIN", + "NEWNUMBER", + "PROJECTPORT" + ] + }, + "NumberFormat": { + "description": "Format of TNs to import.", + "type": "string", + "enum": [ + "10D", + "E164", + "USMOBILESC" + ] + }, + "TnAttributes": { + "description": "List of phone number attributes to be assigned.", + "type": "object", + "properties": { + "TnAttribute": { + "type": "string", + "enum": [ + "Protected" + ] + } + } + }, + "InitialStatus": { + "description": "TN status that be assigned to imported telephone numbers. Required existence of \"Protected\" TnAttribute.", + "type": "string", + "enum": [ + "Available" + ] } }, "parameters": {