From c80eff63a06ddcee11b252e554e0bda667af70dc Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Thu, 27 Jul 2023 21:00:36 +0000 Subject: [PATCH] Add Code Snippets to Spec Files --- site/specs/messaging.yml | 16 ++ site/specs/numbers.yml | 342 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 344 insertions(+), 14 deletions(-) diff --git a/site/specs/messaging.yml b/site/specs/messaging.yml index 07957c12b..de4129a53 100644 --- a/site/specs/messaging.yml +++ b/site/specs/messaging.yml @@ -37,6 +37,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -224,6 +226,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -436,6 +440,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -691,6 +697,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -1091,6 +1099,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -2468,6 +2478,12 @@ components: application/json: schema: $ref: '#/components/schemas/messagingRequestError' + messagingNotAcceptableError: + description: Not Acceptable + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' createMessageBadRequestError: description: Bad Request content: diff --git a/site/specs/numbers.yml b/site/specs/numbers.yml index f6f9199ea..a198594c4 100644 --- a/site/specs/numbers.yml +++ b/site/specs/numbers.yml @@ -948,6 +948,45 @@ components: + associatedOutboundNumbersRequestExample: + value: |- + + + + +16175551212 + + + +16175551213 + + + associatedOutboundNumbersResponseGetExample: + value: |- + + + 2 + + + +16175551212 + 123 + + + +16175551213 + 124 + + + + associatedOutboundNumbersResponsePostExample: + value: |- + + + 2 + + + +16175551212 + Invalid Number Format + + + parameters: AccountIDQueryParam: description: > @@ -967,6 +1006,12 @@ components: required: true schema: type: string + AssociatedOutboundNumberIdParam: + in: path + name: associatedOutboundNumberId + required: true + schema: + type: integer BulkCoverageMatrixTaskId: description: Task id for a bulk coverage matrix update. in: path @@ -1079,6 +1124,27 @@ components: required: true schema: type: string + PaginationPageQueryParam: + description: >- + Retrievals must be paginated, using page and size indicators. The page + parameter contains the page number, e.g. "1" in the case of the first + page + example: 1 + in: query + name: page + required: true + schema: + type: integer + PaginationSizeQueryParam: + description: >- + The size parameter indicates the number of Associated Outbound Numbers + to return in the payload + example: 10 + in: query + name: size + required: true + schema: + type: integer PermissionIdPathParam: description: Permission Id example: testPermission @@ -1325,6 +1391,17 @@ components: schema: type: string requestBodies: + associatedOutboundNumbersRequest: + content: + application/xml: + examples: + requestExample: + summary: An example request + value: + $ref: '#/components/examples/associatedOutboundNumbersRequestExample' + schema: + $ref: '#/components/schemas/associatedOutboundNumbers' + description: OK shortCodeJsonPatchShortCodeRequest: content: application/json-patch+json: @@ -1396,6 +1473,59 @@ components: associated with the order, the state of the order, and a list of the successfully imported Telephone Numbers, and descriptions of any encountered errors. + associatedOutboundNumbers400Response: + content: + application/xml: + schema: + $ref: '#/components/schemas/associatedOutboundNumbersErrorResponse' + description: Bad Request + associatedOutboundNumbers401Response: + content: + application/xml: + schema: + $ref: '#/components/schemas/associatedOutboundNumbersErrorResponse' + description: Unauthorised + associatedOutboundNumbers403Response: + content: + application/xml: + schema: + $ref: '#/components/schemas/associatedOutboundNumbersErrorResponse' + description: Forbidden + associatedOutboundNumbers404Response: + content: + application/xml: + schema: + $ref: '#/components/schemas/associatedOutboundNumbersErrorResponse' + description: Not Found + associatedOutboundNumbers429Response: + content: + application/xml: + schema: + $ref: '#/components/schemas/associatedOutboundNumbersErrorResponse' + description: Too Many Requests + associatedOutboundNumbers500Response: + content: + application/xml: + schema: + $ref: '#/components/schemas/associatedOutboundNumbersErrorResponse' + description: Internal Server Error + associatedOutboundNumbersResponse: + content: + application/xml: + examples: + GetExample: + summary: An example GET response + value: + $ref: >- + #/components/examples/associatedOutboundNumbersResponseGetExample + PostExample: + summary: An example POST response + value: + $ref: >- + #/components/examples/associatedOutboundNumbersResponsePostExample + schema: + $ref: '#/components/schemas/associatedOutboundNumbersResponse' + description: OK bulkRateCenterGetResponse404Error: content: application/xml: @@ -11221,6 +11351,8 @@ components: properties: Address: $ref: '#/components/schemas/Address' + BillingIdentifier: + type: string CallVerificationEnabled: type: boolean CallingName: @@ -11425,6 +11557,8 @@ components: properties: Address: $ref: '#/components/schemas/Address' + BillingIdentifier: + type: string CallVerificationEnabled: type: boolean CallingName: @@ -14080,6 +14214,65 @@ components: - zip - url type: object + associatedOutboundNumber: + properties: + ErrorReason: + $ref: '#/components/schemas/associatedOutboundNumberErrorReason' + id: + type: integer + number: + description: |- +

An Associated Outbound Number should: +

+

+ maxLength: 16 + minLength: 3 + type: string + type: object + associatedOutboundNumberErrorReason: + description: >- +

Describes the reason an associated outbound number has failed. This + could be due to validation or business logic. + +
+ + Possible Error Reasons include: +

+

+ type: string + associatedOutboundNumbers: + items: + $ref: '#/components/schemas/associatedOutboundNumber' + maxItems: 250 + type: array + associatedOutboundNumbersErrorResponse: + properties: + AssociatedOutboundNumbersResponse: + $ref: '#/components/schemas/ResponseStatus' + type: object + associatedOutboundNumbersResponse: + properties: + AssociatedOutboundNumbers: + $ref: '#/components/schemas/associatedOutboundNumbers' + Errors: + items: + properties: + AssociatedOutboundNumbers: + $ref: '#/components/schemas/associatedOutboundNumbers' + type: object + type: array + SuccessCount: + type: integer + TotalCount: + type: integer + type: object contact: nullable: false properties: @@ -14337,8 +14530,6 @@ components: name: OrderCreateDate type: object type: object - xml: - name: Order shortCode: description: Short code registration. properties: @@ -15218,7 +15409,7 @@ info: ## Base Path - https://dashboard.bandwidth.com/api/ + https://dashboard.bandwidth.com/api/v1/ title: Numbers version: 1.0.0 openapi: 3.0.1 @@ -28120,6 +28311,19 @@ paths: request.

Please visit Guides and Tutorials to learn more.

+ + + The following are ONLY supported for ordering US and/or Canada phone + numbers: + + 1. Backorders: + - BackOrderRequested, CloseOrder + 2. Any combined search and order type. + - RateCenterSearchAndOrderType, AreaCodeSearchAndOrderType, NPANXXSearchAndOrderType, TollFreeWildCharSearchAndOrderType, TollFreeVanitySearchAndOrderType, LATASearchAndOrderType, ZIPSearchAndOrderType, CitySearchAndOrderType, StateSearchAndOrderType, CombinedSearchAndOrderType + 3. Protected numbers: + - TnAttributes > TnAttribute > Protected + 4. Reserved numbers: + - ExistingTelephoneNumberOrderType > ReservationIdList operationId: CreateOrder parameters: - $ref: '#/components/parameters/AccountIdPathParam' @@ -28247,9 +28451,9 @@ paths: Existing Number Order - 9193752369 - 9193752720 - 9193752648 + +19193752369 + +19193752720 + +19193752648 [GUID] @@ -28575,7 +28779,7 @@ paths: COMPLETE - 8042105666 + +18042105666 0 @@ -28588,7 +28792,7 @@ paths: - Orders put: description: >- - With the introduction of Backorder capabilities, new number orders may + For orders that support Backorder capabilities, new number orders may stay in backordered state while the order is filled. While in this state it is possible to update the modifiable fields in the record, as well as to request that backorder processing of the order be ended. @@ -28664,6 +28868,7 @@ paths: - Orders /accounts/{accountId}/orders/{orderId}/areaCodes: get: + deprecated: true description: >- Retrieves the area codes of the phone numbers from the specified order.

Please visit - Retrieves the Npa-Nxx of the phone numbers from the specified order.

Please visit 1 - 8042105666 + +18042105666 schema: $ref: '#/components/schemas/OrderTelephoneNumbersResponse' @@ -35637,6 +35843,7 @@ paths: - Orders /accounts/{accountId}/sites/{siteId}/orders/{orderId}: get: + deprecated: true description: Retrieves order information associated with the given Site operationId: RetrieveSiteOrder parameters: @@ -35685,7 +35892,7 @@ paths: COMPLETE - 8042105666 + +18042105666 0 @@ -35693,7 +35900,7 @@ paths: schema: $ref: '#/components/schemas/TnOrderUpdatedResponse' description: A successful result that contains the response data - summary: Retrieve Site Order + summary: Retrieve Site Order (NANPA) tags: - Orders /accounts/{accountId}/sites/{siteId}/orders/{orderId}/tns: @@ -35840,6 +36047,7 @@ paths: CNAM-TEST-778 description false + Customer-Name-00010/01 @@ -35945,6 +36153,7 @@ paths: description false uri + Customer-Name-00010/01 @@ -35977,6 +36186,7 @@ paths: description false uri + Customer-Name-00010/01 10.10.10.1 @@ -36067,6 +36277,13 @@ paths: - Zip - AddressType type: object + BillingIdentifier: + description: >- + An optional field that offers a convenient way to segment + billing report for your customers. This same value can be + used across multiple locations. + maxLength: 50 + type: string CallVerificationEnabled: type: boolean CustomerTrafficAllowed: @@ -36209,6 +36426,7 @@ paths:

  • 5251 - One of the provided origination route plan route names is too long, please ensure all names are less than 256 characters.
  • 5252 - The origination route name %s is invalid, please use only alphanumeric, whitespace, underscore, and/or dash characters
  • 5253 - Telephone number endpoints are not allowed on this account. Please contact Bandwidth support if you wish to add this feature to your account.
  • +
  • 13691 - Billing Identifier '%s' is too long. Max length 50 characters
  • '409': content: @@ -36333,6 +36551,7 @@ paths: CNAM-TEST-778 description false + Customer-Name-00010/01 @@ -36422,6 +36641,7 @@ paths: name description false + Customer-Name-00010/01 10.10.10.1 @@ -36464,6 +36684,7 @@ paths: CNAM-TEST-778 description false + Customer-Name-00010/01 @@ -36549,6 +36770,7 @@ paths:
  • 5251 - One of the provided origination route plan route names is too long, please ensure all names are less than 256 characters.
  • 5252 - The origination route name %s is invalid, please use only alphanumeric, whitespace, underscore, and/or dash characters
  • 5253 - Telephone number endpoints are not allowed on this account. Please contact Bandwidth support if you wish to add this feature to your account.
  • +
  • 13691 - Billing Identifier '%s' is too long. Max length 50 characters
  • '409': content: @@ -36586,6 +36808,98 @@ paths: summary: Update Sip Peer tags: - SipPeer Management + /accounts/{accountId}/sites/{siteId}/sippeers/{sipPeerId}/associatedOutboundNumbers: + get: + description: >- + Retrieve list of Associated Outbound Numbers associated with SIP Peer + location. If none exist, then an empty list is returned. + operationId: retrieveSipPeerAssociatedOutboundNumbers + parameters: + - $ref: '#/components/parameters/AccountIdPathParam' + - $ref: '#/components/parameters/SiteIdPathParam' + - $ref: '#/components/parameters/SipPeerIdPathParam' + - $ref: '#/components/parameters/PaginationPageQueryParam' + - $ref: '#/components/parameters/PaginationSizeQueryParam' + responses: + '200': + $ref: '#/components/responses/associatedOutboundNumbersResponse' + '400': + $ref: '#/components/responses/associatedOutboundNumbers400Response' + '401': + $ref: '#/components/responses/associatedOutboundNumbers401Response' + '403': + $ref: '#/components/responses/associatedOutboundNumbers403Response' + '404': + $ref: '#/components/responses/associatedOutboundNumbers404Response' + '429': + $ref: '#/components/responses/associatedOutboundNumbers429Response' + '500': + $ref: '#/components/responses/associatedOutboundNumbers500Response' + summary: >- + Retrieve list of Associated Outbound Numbers associated with SIP Peer + location + tags: + - SipPeer Management + post: + description: Submit a list of new Associated Outbound Numbers. + operationId: uploadSipPeerAssociatedOutboundNumbers + parameters: + - $ref: '#/components/parameters/AccountIdPathParam' + - $ref: '#/components/parameters/SiteIdPathParam' + - $ref: '#/components/parameters/SipPeerIdPathParam' + requestBody: + $ref: '#/components/requestBodies/associatedOutboundNumbersRequest' + responses: + '200': + $ref: '#/components/responses/associatedOutboundNumbersResponse' + '400': + $ref: '#/components/responses/associatedOutboundNumbers400Response' + '401': + $ref: '#/components/responses/associatedOutboundNumbers401Response' + '403': + $ref: '#/components/responses/associatedOutboundNumbers403Response' + '404': + $ref: '#/components/responses/associatedOutboundNumbers404Response' + '429': + $ref: '#/components/responses/associatedOutboundNumbers429Response' + '500': + $ref: '#/components/responses/associatedOutboundNumbers500Response' + summary: >- + Associates a list of Associated Outbound Numbers with a SIP Peer + location + tags: + - SipPeer Management + /accounts/{accountId}/sites/{siteId}/sippeers/{sipPeerId}/associatedOutboundNumbers/{associatedOutboundNumberId}: + delete: + description: Delete Associated Outbound Number from SIP Peer + operationId: deleteSipPeerAssociatedOutboundNumbers + parameters: + - $ref: '#/components/parameters/AccountIdPathParam' + - $ref: '#/components/parameters/SiteIdPathParam' + - $ref: '#/components/parameters/SipPeerIdPathParam' + - $ref: '#/components/parameters/AssociatedOutboundNumberIdParam' + responses: + '200': + content: + application/xml: {} + description: The Outbound Number has been successfully deleted + '400': + $ref: '#/components/responses/associatedOutboundNumbers400Response' + '401': + $ref: '#/components/responses/associatedOutboundNumbers401Response' + '403': + $ref: '#/components/responses/associatedOutboundNumbers403Response' + '404': + $ref: '#/components/responses/associatedOutboundNumbers404Response' + '429': + $ref: '#/components/responses/associatedOutboundNumbers429Response' + '500': + $ref: '#/components/responses/associatedOutboundNumbers500Response' + summary: >- + Provide a Associated Outbound Number Id which should be deleted from + this SIP Peer. + tags: + - SipPeer Management /accounts/{accountId}/sites/{siteId}/sippeers/{sipPeerId}/movetns: post: description: >- @@ -43884,7 +44198,7 @@ security: - httpBasic: [] servers: - description: Production - url: https://dashboard.bandwidth.com/api + url: https://dashboard.bandwidth.com/api/v1 variables: {} tags: - name: 10DLC