From b962ced11ac2bbd84db4386844992399277c9b32 Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Wed, 14 Jan 2026 14:03:02 -0500 Subject: [PATCH 01/10] Add SIP credentials model and related documentation - Introduced `SipCredentials` model for managing SIP connection credentials. - Added documentation for `CreateEndpointRequestBase`, `CreateEndpointResponse`, `CreateEndpointResponseObject`, `CreateWebRtcConnectionRequest`, `Device`, `DeviceStatusEnum`, `Endpoint`, `EndpointDirectionEnum`, `EndpointEvent`, `EndpointEventTypeEnum`, `EndpointResponse`, `EndpointStatusEnum`, `EndpointTypeEnum`, `Endpoints`, `EndpointsApi`, `ErrorResponse`, `ListEndpointsResponse`, `Page`, `SipConnectionMetadata`, and `SipCredentials`. - Implemented example usage in the documentation for each model. --- .gitignore | 2 + .openapi-generator/FILES | 40 + README.md | 24 + bandwidth.yml | 8585 +---------------- bandwidth/__init__.py | 40 + bandwidth/api/__init__.py | 1 + bandwidth/api/endpoints_api.py | 1659 ++++ bandwidth/models/__init__.py | 19 + .../models/create_endpoint_request_base.py | 112 + bandwidth/models/create_endpoint_response.py | 125 + .../models/create_endpoint_response_object.py | 127 + .../create_web_rtc_connection_request.py | 114 + bandwidth/models/device.py | 110 + bandwidth/models/device_status_enum.py | 38 + bandwidth/models/endpoint.py | 125 + bandwidth/models/endpoint_direction_enum.py | 39 + bandwidth/models/endpoint_event.py | 126 + bandwidth/models/endpoint_event_type_enum.py | 38 + bandwidth/models/endpoint_response.py | 125 + bandwidth/models/endpoint_status_enum.py | 38 + bandwidth/models/endpoint_type_enum.py | 37 + bandwidth/models/endpoints.py | 115 + bandwidth/models/error_response.py | 126 + bandwidth/models/list_endpoints_response.py | 135 + bandwidth/models/page.py | 108 + bandwidth/models/sip_connection_metadata.py | 111 + bandwidth/models/sip_credentials.py | 103 + docs/Callback.md | 4 +- docs/CreateCall.md | 2 +- docs/CreateEndpointRequestBase.md | 33 + docs/CreateEndpointResponse.md | 31 + docs/CreateEndpointResponseObject.md | 36 + docs/CreateWebRtcConnectionRequest.md | 34 + docs/Device.md | 32 + docs/DeviceStatusEnum.md | 12 + docs/Endpoint.md | 35 + docs/EndpointDirectionEnum.md | 14 + docs/EndpointEvent.md | 38 + docs/EndpointEventTypeEnum.md | 12 + docs/EndpointResponse.md | 31 + docs/EndpointStatusEnum.md | 12 + docs/EndpointTypeEnum.md | 10 + docs/Endpoints.md | 34 + docs/EndpointsApi.md | 498 + docs/ErrorResponse.md | 31 + docs/InboundCallback.md | 4 +- docs/InboundCallbackTypeEnum.md | 2 +- docs/ListEndpointsResponse.md | 32 + docs/LookupResult.md | 4 +- docs/MachineDetectionConfiguration.md | 2 +- docs/MessageRequest.md | 2 +- docs/Page.md | 32 + docs/SipConnectionMetadata.md | 32 + docs/SipCredentials.md | 30 + 54 files changed, 4667 insertions(+), 8594 deletions(-) mode change 100644 => 120000 bandwidth.yml create mode 100644 bandwidth/api/endpoints_api.py create mode 100644 bandwidth/models/create_endpoint_request_base.py create mode 100644 bandwidth/models/create_endpoint_response.py create mode 100644 bandwidth/models/create_endpoint_response_object.py create mode 100644 bandwidth/models/create_web_rtc_connection_request.py create mode 100644 bandwidth/models/device.py create mode 100644 bandwidth/models/device_status_enum.py create mode 100644 bandwidth/models/endpoint.py create mode 100644 bandwidth/models/endpoint_direction_enum.py create mode 100644 bandwidth/models/endpoint_event.py create mode 100644 bandwidth/models/endpoint_event_type_enum.py create mode 100644 bandwidth/models/endpoint_response.py create mode 100644 bandwidth/models/endpoint_status_enum.py create mode 100644 bandwidth/models/endpoint_type_enum.py create mode 100644 bandwidth/models/endpoints.py create mode 100644 bandwidth/models/error_response.py create mode 100644 bandwidth/models/list_endpoints_response.py create mode 100644 bandwidth/models/page.py create mode 100644 bandwidth/models/sip_connection_metadata.py create mode 100644 bandwidth/models/sip_credentials.py create mode 100644 docs/CreateEndpointRequestBase.md create mode 100644 docs/CreateEndpointResponse.md create mode 100644 docs/CreateEndpointResponseObject.md create mode 100644 docs/CreateWebRtcConnectionRequest.md create mode 100644 docs/Device.md create mode 100644 docs/DeviceStatusEnum.md create mode 100644 docs/Endpoint.md create mode 100644 docs/EndpointDirectionEnum.md create mode 100644 docs/EndpointEvent.md create mode 100644 docs/EndpointEventTypeEnum.md create mode 100644 docs/EndpointResponse.md create mode 100644 docs/EndpointStatusEnum.md create mode 100644 docs/EndpointTypeEnum.md create mode 100644 docs/Endpoints.md create mode 100644 docs/EndpointsApi.md create mode 100644 docs/ErrorResponse.md create mode 100644 docs/ListEndpointsResponse.md create mode 100644 docs/Page.md create mode 100644 docs/SipConnectionMetadata.md create mode 100644 docs/SipCredentials.md diff --git a/.gitignore b/.gitignore index e7aa7b90..048da015 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,5 @@ target/ # Test Fixtures test/fixtures/ + +.env \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 1380f48c..6ae9ca0f 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -5,6 +5,7 @@ bandwidth/__init__.py bandwidth/api/__init__.py bandwidth/api/calls_api.py bandwidth/api/conferences_api.py +bandwidth/api/endpoints_api.py bandwidth/api/media_api.py bandwidth/api/messages_api.py bandwidth/api/mfa_api.py @@ -58,16 +59,31 @@ bandwidth/models/create_async_bulk_lookup_response.py bandwidth/models/create_async_bulk_lookup_response_data.py bandwidth/models/create_call.py bandwidth/models/create_call_response.py +bandwidth/models/create_endpoint_request_base.py +bandwidth/models/create_endpoint_response.py +bandwidth/models/create_endpoint_response_object.py bandwidth/models/create_message_request_error.py bandwidth/models/create_multi_channel_message_response.py bandwidth/models/create_sync_lookup_response.py bandwidth/models/create_sync_lookup_response_data.py +bandwidth/models/create_web_rtc_connection_request.py bandwidth/models/deactivation_event_enum.py +bandwidth/models/device.py +bandwidth/models/device_status_enum.py bandwidth/models/disconnect_callback.py bandwidth/models/diversion.py bandwidth/models/dtmf_callback.py +bandwidth/models/endpoint.py +bandwidth/models/endpoint_direction_enum.py +bandwidth/models/endpoint_event.py +bandwidth/models/endpoint_event_type_enum.py +bandwidth/models/endpoint_response.py +bandwidth/models/endpoint_status_enum.py +bandwidth/models/endpoint_type_enum.py +bandwidth/models/endpoints.py bandwidth/models/error.py bandwidth/models/error_object.py +bandwidth/models/error_response.py bandwidth/models/error_source.py bandwidth/models/failure_webhook.py bandwidth/models/field_error.py @@ -85,6 +101,7 @@ bandwidth/models/line_type_enum.py bandwidth/models/link.py bandwidth/models/link_schema.py bandwidth/models/links_object.py +bandwidth/models/list_endpoints_response.py bandwidth/models/list_message_direction_enum.py bandwidth/models/list_message_item.py bandwidth/models/lookup_error_response.py @@ -128,6 +145,7 @@ bandwidth/models/multi_channel_message_content.py bandwidth/models/multi_channel_message_request.py bandwidth/models/multi_channel_message_response_data.py bandwidth/models/opt_in_workflow.py +bandwidth/models/page.py bandwidth/models/page_info.py bandwidth/models/priority_enum.py bandwidth/models/product_type_enum.py @@ -156,6 +174,8 @@ bandwidth/models/recording_transcription_metadata.py bandwidth/models/recording_transcriptions.py bandwidth/models/redirect_callback.py bandwidth/models/redirect_method_enum.py +bandwidth/models/sip_connection_metadata.py +bandwidth/models/sip_credentials.py bandwidth/models/sms_message_content.py bandwidth/models/standalone_card_orientation_enum.py bandwidth/models/status_callback.py @@ -238,16 +258,32 @@ docs/CreateAsyncBulkLookupResponse.md docs/CreateAsyncBulkLookupResponseData.md docs/CreateCall.md docs/CreateCallResponse.md +docs/CreateEndpointRequestBase.md +docs/CreateEndpointResponse.md +docs/CreateEndpointResponseObject.md docs/CreateMessageRequestError.md docs/CreateMultiChannelMessageResponse.md docs/CreateSyncLookupResponse.md docs/CreateSyncLookupResponseData.md +docs/CreateWebRtcConnectionRequest.md docs/DeactivationEventEnum.md +docs/Device.md +docs/DeviceStatusEnum.md docs/DisconnectCallback.md docs/Diversion.md docs/DtmfCallback.md +docs/Endpoint.md +docs/EndpointDirectionEnum.md +docs/EndpointEvent.md +docs/EndpointEventTypeEnum.md +docs/EndpointResponse.md +docs/EndpointStatusEnum.md +docs/EndpointTypeEnum.md +docs/Endpoints.md +docs/EndpointsApi.md docs/Error.md docs/ErrorObject.md +docs/ErrorResponse.md docs/ErrorSource.md docs/FailureWebhook.md docs/FieldError.md @@ -265,6 +301,7 @@ docs/LineTypeEnum.md docs/Link.md docs/LinkSchema.md docs/LinksObject.md +docs/ListEndpointsResponse.md docs/ListMessageDirectionEnum.md docs/ListMessageItem.md docs/LookupErrorResponse.md @@ -312,6 +349,7 @@ docs/MultiChannelMessageContent.md docs/MultiChannelMessageRequest.md docs/MultiChannelMessageResponseData.md docs/OptInWorkflow.md +docs/Page.md docs/PageInfo.md docs/PhoneNumberLookupApi.md docs/PriorityEnum.md @@ -342,6 +380,8 @@ docs/RecordingTranscriptions.md docs/RecordingsApi.md docs/RedirectCallback.md docs/RedirectMethodEnum.md +docs/SipConnectionMetadata.md +docs/SipCredentials.md docs/SmsMessageContent.md docs/StandaloneCardOrientationEnum.md docs/StatisticsApi.md diff --git a/README.md b/README.md index 1a9d687d..9f44fa9f 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,11 @@ Class | Method | HTTP request | Description *ConferencesApi* | [**update_conference**](docs/ConferencesApi.md#update_conference) | **POST** /accounts/{accountId}/conferences/{conferenceId} | Update Conference *ConferencesApi* | [**update_conference_bxml**](docs/ConferencesApi.md#update_conference_bxml) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/bxml | Update Conference BXML *ConferencesApi* | [**update_conference_member**](docs/ConferencesApi.md#update_conference_member) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Update Conference Member +*EndpointsApi* | [**create_endpoint**](docs/EndpointsApi.md#create_endpoint) | **POST** /accounts/{accountId}/endpoints | Create Endpoint +*EndpointsApi* | [**delete_endpoint**](docs/EndpointsApi.md#delete_endpoint) | **DELETE** /accounts/{accountId}/endpoints/{endpointId} | Delete Endpoint +*EndpointsApi* | [**get_endpoint**](docs/EndpointsApi.md#get_endpoint) | **GET** /accounts/{accountId}/endpoints/{endpointId} | Get Endpoint +*EndpointsApi* | [**list_endpoints**](docs/EndpointsApi.md#list_endpoints) | **GET** /accounts/{accountId}/endpoints | List Endpoints +*EndpointsApi* | [**update_endpoint_bxml**](docs/EndpointsApi.md#update_endpoint_bxml) | **PUT** /accounts/{accountId}/endpoints/{endpointId}/bxml | Update Endpoint BXML *MFAApi* | [**generate_messaging_code**](docs/MFAApi.md#generate_messaging_code) | **POST** /accounts/{accountId}/code/messaging | Messaging Authentication Code *MFAApi* | [**generate_voice_code**](docs/MFAApi.md#generate_voice_code) | **POST** /accounts/{accountId}/code/voice | Voice Authentication Code *MFAApi* | [**verify_code**](docs/MFAApi.md#verify_code) | **POST** /accounts/{accountId}/code/verify | Verify Authentication Code @@ -196,16 +201,31 @@ Class | Method | HTTP request | Description - [CreateAsyncBulkLookupResponseData](docs/CreateAsyncBulkLookupResponseData.md) - [CreateCall](docs/CreateCall.md) - [CreateCallResponse](docs/CreateCallResponse.md) + - [CreateEndpointRequestBase](docs/CreateEndpointRequestBase.md) + - [CreateEndpointResponse](docs/CreateEndpointResponse.md) + - [CreateEndpointResponseObject](docs/CreateEndpointResponseObject.md) - [CreateMessageRequestError](docs/CreateMessageRequestError.md) - [CreateMultiChannelMessageResponse](docs/CreateMultiChannelMessageResponse.md) - [CreateSyncLookupResponse](docs/CreateSyncLookupResponse.md) - [CreateSyncLookupResponseData](docs/CreateSyncLookupResponseData.md) + - [CreateWebRtcConnectionRequest](docs/CreateWebRtcConnectionRequest.md) - [DeactivationEventEnum](docs/DeactivationEventEnum.md) + - [Device](docs/Device.md) + - [DeviceStatusEnum](docs/DeviceStatusEnum.md) - [DisconnectCallback](docs/DisconnectCallback.md) - [Diversion](docs/Diversion.md) - [DtmfCallback](docs/DtmfCallback.md) + - [Endpoint](docs/Endpoint.md) + - [EndpointDirectionEnum](docs/EndpointDirectionEnum.md) + - [EndpointEvent](docs/EndpointEvent.md) + - [EndpointEventTypeEnum](docs/EndpointEventTypeEnum.md) + - [EndpointResponse](docs/EndpointResponse.md) + - [EndpointStatusEnum](docs/EndpointStatusEnum.md) + - [EndpointTypeEnum](docs/EndpointTypeEnum.md) + - [Endpoints](docs/Endpoints.md) - [Error](docs/Error.md) - [ErrorObject](docs/ErrorObject.md) + - [ErrorResponse](docs/ErrorResponse.md) - [ErrorSource](docs/ErrorSource.md) - [FailureWebhook](docs/FailureWebhook.md) - [FieldError](docs/FieldError.md) @@ -223,6 +243,7 @@ Class | Method | HTTP request | Description - [Link](docs/Link.md) - [LinkSchema](docs/LinkSchema.md) - [LinksObject](docs/LinksObject.md) + - [ListEndpointsResponse](docs/ListEndpointsResponse.md) - [ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md) - [ListMessageItem](docs/ListMessageItem.md) - [LookupErrorResponse](docs/LookupErrorResponse.md) @@ -266,6 +287,7 @@ Class | Method | HTTP request | Description - [MultiChannelMessageRequest](docs/MultiChannelMessageRequest.md) - [MultiChannelMessageResponseData](docs/MultiChannelMessageResponseData.md) - [OptInWorkflow](docs/OptInWorkflow.md) + - [Page](docs/Page.md) - [PageInfo](docs/PageInfo.md) - [PriorityEnum](docs/PriorityEnum.md) - [ProductTypeEnum](docs/ProductTypeEnum.md) @@ -294,6 +316,8 @@ Class | Method | HTTP request | Description - [RecordingTranscriptions](docs/RecordingTranscriptions.md) - [RedirectCallback](docs/RedirectCallback.md) - [RedirectMethodEnum](docs/RedirectMethodEnum.md) + - [SipConnectionMetadata](docs/SipConnectionMetadata.md) + - [SipCredentials](docs/SipCredentials.md) - [SmsMessageContent](docs/SmsMessageContent.md) - [StandaloneCardOrientationEnum](docs/StandaloneCardOrientationEnum.md) - [StatusCallback](docs/StatusCallback.md) diff --git a/bandwidth.yml b/bandwidth.yml deleted file mode 100644 index d7c32953..00000000 --- a/bandwidth.yml +++ /dev/null @@ -1,8584 +0,0 @@ -openapi: 3.0.3 -info: - title: Bandwidth - description: Bandwidth's Communication APIs - contact: - name: Bandwidth - url: https://dev.bandwidth.com - email: letstalk@bandwidth.com - version: 1.0.0 -security: - - Basic: [] - - OAuth2: [] -tags: - - name: Messages - - name: Media - - name: Multi-Channel - - name: Calls - - name: Conferences - - name: Recordings - - name: Statistics - - name: Transcriptions - - name: MFA - - name: Phone Number Lookup - - name: Toll-Free Verification -paths: - /users/{accountId}/media: - get: - summary: List Media - description: Gets a list of your media files. No query parameters are supported. - operationId: listMedia - tags: - - Media - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/continuationToken' - responses: - '200': - $ref: '#/components/responses/listMediaResponse' - '400': - $ref: '#/components/responses/messagingBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '406': - $ref: '#/components/responses/messagingNotAcceptableError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - servers: &ref_0 - - url: https://messaging.bandwidth.com/api/v2 - description: Production - /users/{accountId}/media/{mediaId}: - get: - summary: Get Media - description: Downloads a media file you previously uploaded. - operationId: getMedia - tags: - - Media - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/mediaId' - responses: - '200': - $ref: '#/components/responses/getMediaResponse' - '400': - $ref: '#/components/responses/messagingBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '406': - $ref: '#/components/responses/messagingNotAcceptableError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - put: - summary: Upload Media - description: >- - Upload a file. You may add headers to the request in order to provide - some control to your media file. - - - If a file is uploaded with the same name as a file that already exists - under this account, the previous file will be overwritten. - - - A list of supported media types can be found - [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). - operationId: uploadMedia - tags: - - Media - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/mediaId' - - $ref: '#/components/parameters/contentType' - - $ref: '#/components/parameters/cacheControl' - requestBody: - $ref: '#/components/requestBodies/uploadMediaRequest' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/messagingBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '406': - $ref: '#/components/responses/messagingNotAcceptableError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - delete: - summary: Delete Media - description: |- - Deletes a media file from Bandwidth API server. Make sure you don't have - any application scripts still using the media before you delete. - - If you accidentally delete a media file you can immediately upload a new - file with the same name. - operationId: deleteMedia - tags: - - Media - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/mediaId' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/messagingBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '406': - $ref: '#/components/responses/messagingNotAcceptableError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - servers: *ref_0 - /users/{accountId}/messages: - get: - summary: List Messages - description: Returns a list of messages based on query parameters. - operationId: listMessages - tags: - - Messages - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/messageId' - - $ref: '#/components/parameters/sourceTn' - - $ref: '#/components/parameters/destinationTn' - - $ref: '#/components/parameters/messageStatus' - - $ref: '#/components/parameters/messageDirection' - - $ref: '#/components/parameters/carrierName' - - $ref: '#/components/parameters/messageType' - - $ref: '#/components/parameters/errorCode' - - $ref: '#/components/parameters/fromDateTime' - - $ref: '#/components/parameters/toDateTime' - - $ref: '#/components/parameters/campaignId' - - $ref: '#/components/parameters/fromBwLatency' - - $ref: '#/components/parameters/bwQueued' - - $ref: '#/components/parameters/product' - - $ref: '#/components/parameters/location' - - $ref: '#/components/parameters/carrierQueued' - - $ref: '#/components/parameters/fromCarrierLatency' - - $ref: '#/components/parameters/callingNumberCountryA3' - - $ref: '#/components/parameters/calledNumberCountryA3' - - $ref: '#/components/parameters/fromSegmentCount' - - $ref: '#/components/parameters/toSegmentCount' - - $ref: '#/components/parameters/fromMessageSize' - - $ref: '#/components/parameters/toMessageSize' - - $ref: '#/components/parameters/sort' - - $ref: '#/components/parameters/pageToken' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/limitTotalCount' - responses: - '200': - $ref: '#/components/responses/listMessagesResponse' - '400': - $ref: '#/components/responses/messagingBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - post: - summary: Create Message - description: >- - Endpoint for sending text messages and picture messages using V2 - messaging. - operationId: createMessage - tags: - - Messages - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/createMessageRequest' - responses: - '202': - $ref: '#/components/responses/createMessageResponse' - '400': - $ref: '#/components/responses/createMessageBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '405': - $ref: '#/components/responses/messagingMethodNotAllowedError' - '406': - $ref: '#/components/responses/messagingNotAcceptableError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - callbacks: - statusCallback: - $ref: '#/components/callbacks/statusCallback' - servers: *ref_0 - /users/{accountId}/messages/multiChannel: - post: - summary: Create Multi-Channel Message - description: Endpoint for sending Multi-Channel messages. - operationId: createMultiChannelMessage - parameters: - - $ref: '#/components/parameters/accountId' - tags: - - Multi-Channel - requestBody: - $ref: '#/components/requestBodies/createMultiChannelMessageRequest' - responses: - '202': - $ref: '#/components/responses/createMultiChannelMessageResponse' - '400': - $ref: '#/components/responses/multiChannelBadRequestError' - '401': - $ref: '#/components/responses/multiChannelUnauthorizedError' - '403': - $ref: '#/components/responses/multiChannelForbiddenError' - '404': - $ref: '#/components/responses/multiChannelNotFoundError' - '405': - $ref: '#/components/responses/multiChannelMethodNotAllowedError' - '406': - $ref: '#/components/responses/multiChannelNotAcceptableError' - '415': - $ref: '#/components/responses/multiChannelInvalidMediaTypeError' - '429': - $ref: '#/components/responses/multiChannelTooManyRequestsError' - '500': - $ref: '#/components/responses/multiChannelInternalServerError' - callbacks: - statusCallback: - $ref: '#/components/callbacks/statusCallback' - x-badges: - - name: Beta - color: '#076EA8' - servers: *ref_0 - /accounts/{accountId}/calls: - post: - tags: - - Calls - summary: Create Call - description: >- - Creates an outbound phone call. - - - All calls are initially queued. Your outbound calls will initiated at a - specific dequeueing rate, enabling your application to "fire and forget" - when creating calls. Queued calls may not be modified until they are - dequeued and placed, but may be removed from your queue on demand. - - - Please note: Calls submitted to your queue will be placed - approximately in order, but exact ordering is not guaranteed. - operationId: createCall - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/createCallRequest' - responses: - '201': - $ref: '#/components/responses/createCallResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - get: - tags: - - Calls - summary: Get Calls - description: >- - Returns a max of 10000 calls, sorted by `createdTime` from oldest to - newest. - - - **NOTE:** If the number of calls in the account is bigger than - `pageSize`, a `Link` header (with format `<{url}>; rel="next"`) will be - returned in the response. The url can be used to retrieve the next page - of call records. - - Also, call information is kept for 7 days after the calls are hung up. - If you attempt to retrieve information for a call that is older than 7 - days, you will get an empty array [] in response. - operationId: listCalls - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/to' - - $ref: '#/components/parameters/from' - - $ref: '#/components/parameters/minStartTimeCalls' - - $ref: '#/components/parameters/maxStartTimeCalls' - - $ref: '#/components/parameters/disconnectCause' - - $ref: '#/components/parameters/pageSizeCalls' - - $ref: '#/components/parameters/pageToken1' - responses: - '200': - $ref: '#/components/responses/listCallsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: &ref_1 - - url: https://voice.bandwidth.com/api/v2 - description: Production - /accounts/{accountId}/calls/{callId}: - get: - tags: - - Calls - summary: Get Call State Information - description: >- - Retrieve the current state of a specific call. This information is - near-realtime, so it may take a few minutes for your call to be - accessible using this endpoint. - - - **Note**: Call information is kept for 7 days after the calls are hung - up. If you attempt to retrieve information for a call that is older than - 7 days, you will get an HTTP 404 response. - operationId: getCallState - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - responses: - '200': - $ref: '#/components/responses/getCallStateResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - post: - tags: - - Calls - summary: Update Call - description: >- - Interrupts and redirects a call to a different URL that should return a - BXML document. - operationId: updateCall - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - requestBody: - $ref: '#/components/requestBodies/updateCallRequest' - responses: - '200': - $ref: '#/components/responses/updateCallResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '409': - $ref: '#/components/responses/voiceConflictError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/bxml: - put: - tags: - - Calls - summary: Update Call BXML - description: Interrupts and replaces an active call's BXML document. - operationId: updateCallBxml - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - requestBody: - $ref: '#/components/requestBodies/updateCallBxmlRequest' - responses: - '204': - description: Call BXML was successfully replaced. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '409': - $ref: '#/components/responses/voiceConflictError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences: - get: - tags: - - Conferences - summary: Get Conferences - description: >- - Returns a max of 1000 conferences, sorted by `createdTime` from oldest - to newest. - - - **NOTE:** If the number of conferences in the account is bigger than - `pageSize`, a `Link` header (with format `<{url}>; rel="next"`) will be - returned in the response. The url can be used to retrieve the next page - of conference records. - operationId: listConferences - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/name' - - $ref: '#/components/parameters/minCreatedTime' - - $ref: '#/components/parameters/maxCreatedTime' - - $ref: '#/components/parameters/pageSize' - - $ref: '#/components/parameters/pageToken1' - responses: - '200': - $ref: '#/components/responses/listConferencesResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}: - get: - tags: - - Conferences - summary: Get Conference Information - description: Returns information about the specified conference. - operationId: getConference - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - responses: - '200': - $ref: '#/components/responses/getConferenceResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - post: - tags: - - Conferences - summary: Update Conference - description: Update the conference state. - operationId: updateConference - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - requestBody: - $ref: '#/components/requestBodies/updateConferenceRequest' - responses: - '204': - description: Conference was successfully modified. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}/bxml: - put: - tags: - - Conferences - summary: Update Conference BXML - description: Update the conference BXML document. - operationId: updateConferenceBxml - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - requestBody: - $ref: '#/components/requestBodies/updateConferenceBxmlRequest' - responses: - '204': - description: Conference successfully modified. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}/members/{memberId}: - get: - tags: - - Conferences - summary: Get Conference Member - description: Returns information about the specified conference member. - operationId: getConferenceMember - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - - $ref: '#/components/parameters/memberId' - responses: - '200': - $ref: '#/components/responses/getConferenceMemberResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - put: - tags: - - Conferences - summary: Update Conference Member - description: Updates settings for a particular conference member. - operationId: updateConferenceMember - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - - $ref: '#/components/parameters/memberId' - requestBody: - $ref: '#/components/requestBodies/updateConferenceMemberRequest' - responses: - '204': - description: Conference member was successfully modified. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}/recordings: - get: - tags: - - Conferences - summary: Get Conference Recordings - description: >- - Returns a (potentially empty) list of metadata for the recordings that - took place during the specified conference. - operationId: listConferenceRecordings - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - responses: - '200': - $ref: '#/components/responses/listConferenceRecordingsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}: - get: - tags: - - Conferences - summary: Get Conference Recording Information - description: Returns metadata for the specified recording. - operationId: getConferenceRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - - $ref: '#/components/parameters/recordingId' - responses: - '200': - $ref: '#/components/responses/getConferenceRecordingResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media: - get: - tags: - - Conferences - summary: Download Conference Recording - description: Downloads the specified recording file. - operationId: downloadConferenceRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - - $ref: '#/components/parameters/recordingId' - responses: - '200': - $ref: '#/components/responses/downloadRecordingMediaResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/recordings: - get: - tags: - - Recordings - summary: Get Call Recordings - description: >- - Returns a list of metadata for the recordings associated with the - - specified account. The list can be filtered by the optional from, to, - minStartTime, - - and maxStartTime arguments. The list is capped at 1000 entries and may - be - - empty if no recordings match the specified criteria. - operationId: listAccountCallRecordings - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/to' - - $ref: '#/components/parameters/from' - - $ref: '#/components/parameters/minStartTime' - - $ref: '#/components/parameters/maxStartTime' - responses: - '200': - $ref: '#/components/responses/listCallRecordingsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/recording: - put: - tags: - - Recordings - summary: Update Recording - description: Pause or resume a recording on an active phone call. - operationId: updateCallRecordingState - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - requestBody: - $ref: '#/components/requestBodies/updateCallRecordingRequest' - responses: - '200': - $ref: '#/components/responses/updateRecordingResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/recordings: - get: - tags: - - Recordings - summary: List Call Recordings - description: |- - Returns a (potentially empty) list of metadata for the recordings - that took place during the specified call. - operationId: listCallRecordings - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - responses: - '200': - $ref: '#/components/responses/listCallRecordingsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/recordings/{recordingId}: - get: - tags: - - Recordings - summary: Get Call Recording - description: Returns metadata for the specified recording. - operationId: getCallRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '200': - $ref: '#/components/responses/getCallRecordingResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - delete: - tags: - - Recordings - summary: Delete Recording - description: >- - Delete the recording information, media and transcription. - - - Note: After the deletion is requested and a `204` is returned, neither - the recording metadata nor the actual media nor its transcription will - be accessible anymore. However, the media of the specified recording is - not deleted immediately. This deletion process, while transparent and - irreversible, can take an additional 24 to 48 hours. - operationId: deleteRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '204': - description: Recording was deleted. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media: - get: - tags: - - Recordings - summary: Download Recording - description: Downloads the specified recording. - operationId: downloadCallRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '200': - $ref: '#/components/responses/downloadRecordingMediaResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - delete: - tags: - - Recordings - summary: Delete Recording Media - description: Deletes the specified recording's media. - operationId: deleteRecordingMedia - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '204': - description: The recording media was successfully deleted. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription: - get: - tags: - - Recordings - summary: Get Transcription - description: >- - Downloads the specified transcription. - - If the recording was multi-channel, then there will be 2 transcripts. - - The caller/called party transcript will be the first item while - [``](/docs/voice/bxml/playAudio) and - [``](/docs/voice/bxml/speakSentence) transcript will be - the second item. - - During a [``](/docs/voice/bxml/transfer) the A-leg transcript - will be the first item while the B-leg transcript will be the second - item. - operationId: getRecordingTranscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '200': - $ref: '#/components/responses/getRecordingTranscriptionResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - post: - tags: - - Recordings - summary: Create Transcription Request - description: >- - Generate the transcription for a specific recording. Transcription - - can succeed only for recordings of length greater than 500 milliseconds - and - - less than 4 hours. - operationId: transcribeCallRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - requestBody: - $ref: '#/components/requestBodies/transcribeRecordingRequest' - responses: - '204': - description: Transcription was successfully requested. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - delete: - tags: - - Recordings - summary: Delete Transcription - description: >- - Deletes the specified recording's transcription. - - - Note: After the deletion is requested and a `204` is returned, the - transcription will not be accessible anymore. However, it is not deleted - immediately. This deletion process, while transparent and irreversible, - can take an additional 24 to 48 hours. - operationId: deleteRecordingTranscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '204': - description: The transcription was successfully deleted. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/statistics: - get: - tags: - - Statistics - summary: Get Account Statistics - description: Returns details about the current state of the account. - operationId: getStatistics - parameters: - - $ref: '#/components/parameters/accountId' - responses: - '200': - $ref: '#/components/responses/getStatisticsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/transcriptions: - get: - tags: - - Transcriptions - summary: List Real-time Transcriptions - description: >- - List the transcriptions created on this call via - [startTranscription](/docs/voice/bxml/startTranscription). - operationId: listRealTimeTranscriptions - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - responses: - '200': - $ref: '#/components/responses/listTranscriptionsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}: - get: - tags: - - Transcriptions - summary: Get Real-time Transcription - description: >- - Retrieve the specified transcription that was created on this call via - [startTranscription](/docs/voice/bxml/startTranscription). - operationId: getRealTimeTranscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/transcriptionId' - responses: - '200': - $ref: '#/components/responses/getCallTranscriptionResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - delete: - tags: - - Transcriptions - summary: Delete Real-time Transcription - description: >- - Delete the specified transcription that was created on this call via - [startTranscription](/docs/voice/bxml/startTranscription). - - - Note: After the deletion is requested and a `200` is returned, the - transcription will not be accessible anymore. However, it is not deleted - immediately. This deletion process, while transparent and irreversible, - can take an additional 24 to 48 hours. - operationId: deleteRealTimeTranscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/transcriptionId' - responses: - '200': - $ref: '#/components/responses/deleteCallTranscriptionResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/code/voice: - post: - tags: - - MFA - summary: Voice Authentication Code - description: Send an MFA Code via a phone call. - operationId: generateVoiceCode - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/codeRequest' - responses: - '200': - $ref: '#/components/responses/voiceCodeResponse' - '400': - $ref: '#/components/responses/mfaBadRequestError' - '401': - $ref: '#/components/responses/mfaUnauthorizedError' - '403': - $ref: '#/components/responses/mfaForbiddenError' - '500': - $ref: '#/components/responses/mfaInternalServerError' - servers: &ref_2 - - url: https://mfa.bandwidth.com/api/v1 - description: Production - /accounts/{accountId}/code/messaging: - post: - tags: - - MFA - summary: Messaging Authentication Code - description: Send an MFA code via text message (SMS). - operationId: generateMessagingCode - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/codeRequest' - responses: - '200': - $ref: '#/components/responses/messagingCodeResponse' - '400': - $ref: '#/components/responses/mfaBadRequestError' - '401': - $ref: '#/components/responses/mfaUnauthorizedError' - '403': - $ref: '#/components/responses/mfaForbiddenError' - '500': - $ref: '#/components/responses/mfaInternalServerError' - servers: *ref_2 - /accounts/{accountId}/code/verify: - post: - tags: - - MFA - summary: Verify Authentication Code - description: Verify a previously sent MFA code. - operationId: verifyCode - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/codeVerify' - responses: - '200': - $ref: '#/components/responses/verifyCodeResponse' - '400': - $ref: '#/components/responses/mfaBadRequestError' - '401': - $ref: '#/components/responses/mfaUnauthorizedError' - '403': - $ref: '#/components/responses/mfaForbiddenError' - '429': - $ref: '#/components/responses/mfaTooManyRequestsError' - '500': - $ref: '#/components/responses/mfaInternalServerError' - servers: *ref_2 - /accounts/{accountId}/phoneNumberLookup: - post: - summary: Create Synchronous Number Lookup - description: >- - Creates a synchronous phone number lookup request. Maximum of 100 - telephone numbers per request. - operationId: createSyncLookup - tags: - - Phone Number Lookup - parameters: - - $ref: '#/components/parameters/accountId1' - requestBody: - $ref: '#/components/requestBodies/createSyncLookupRequest' - responses: - '200': - $ref: '#/components/responses/createSyncLookupResponse' - default: - $ref: '#/components/responses/tnLookupDefaultResponse' - servers: &ref_3 - - url: https://api.bandwidth.com/v2 - description: Production - /accounts/{accountId}/phoneNumberLookup/bulk: - post: - summary: Create Asynchronous Bulk Number Lookup - description: >- - Creates an asynchronous bulk phone number lookup request. Maximum of - 15,000 telephone numbers per request. Use the [Get Asynchronous Bulk - Number Lookup](#tag/Phone-Number-Lookup/operation/getAsyncBulkLookup) - endpoint to check the status of the request and view the results. - operationId: createAsyncBulkLookup - tags: - - Phone Number Lookup - parameters: - - $ref: '#/components/parameters/accountId1' - requestBody: - $ref: '#/components/requestBodies/createAsyncBulkLookupRequest' - responses: - '202': - $ref: '#/components/responses/createAsyncBulkLookupResponse' - default: - $ref: '#/components/responses/tnLookupDefaultResponse' - servers: *ref_3 - /accounts/{accountId}/phoneNumberLookup/bulk/{requestId}: - get: - summary: Get Asynchronous Bulk Number Lookup - description: >- - Get an existing [Asynchronous Bulk Number - Lookup](#tag/Phone-Number-Lookup/operation/createAsyncBulkLookup). Use - this endpoint to check the status of the request and view the results. - operationId: getAsyncBulkLookup - tags: - - Phone Number Lookup - parameters: - - $ref: '#/components/parameters/accountId1' - - $ref: '#/components/parameters/requestId' - responses: - '200': - $ref: '#/components/responses/getAsyncBulkLookupResponse' - default: - $ref: '#/components/responses/tnLookupDefaultResponse' - servers: *ref_3 - /accounts/{accountId}/tollFreeVerification: - post: - tags: - - Toll-Free Verification - summary: Request Toll-Free Verification - description: Submit a request for verification of a toll-free phone number. - operationId: requestTollFreeVerification - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/requestTollFreeVerificationRequest' - responses: - '202': - description: Accepted - '400': - $ref: '#/components/responses/tfvPostBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - callbacks: - tfVerificationStatus: - $ref: '#/components/callbacks/tfVerificationStatus' - servers: &ref_4 - - url: https://api.bandwidth.com/api/v2 - description: Production - /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification: - get: - tags: - - Toll-Free Verification - summary: Get Toll-Free Verification Status - description: >- - Gets the verification status for a phone number that is provisioned to - your account. - - Submission information will be appended to the response if it is - available. - operationId: getTollFreeVerificationStatus - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/tfPhoneNumberPathParam' - responses: - '200': - $ref: '#/components/responses/getTollFreeVerificationStatusResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - put: - tags: - - Toll-Free Verification - summary: Update Toll-Free Verification Request - description: >- - Updates a toll-free verification request. - - Submissions are only eligible for resubmission for 7 days within being - processed and if resubmission is allowed (resubmitAllowed field is - true). - operationId: updateTollFreeVerificationRequest - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/tfPhoneNumberPathParam' - requestBody: - $ref: '#/components/requestBodies/updateTollFreeVerificationRequestRequest' - responses: - '202': - description: Accepted - '400': - $ref: '#/components/responses/tfvPostBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - callbacks: - tfVerificationStatus: - $ref: '#/components/callbacks/tfVerificationStatus' - delete: - description: Delete a toll-free verification submission for a toll-free number. - operationId: deleteVerificationRequest - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/tfPhoneNumberPathParam' - responses: - '204': - $ref: '#/components/responses/noContentResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - summary: Delete a Toll-Free Verification Submission - tags: - - Toll-Free Verification - servers: *ref_4 - /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions: - get: - tags: - - Toll-Free Verification - summary: List Webhook Subscriptions - description: >- - Lists all webhook subscriptions that are registered to receive status - updates for the toll-free verification requests submitted under this - account (password will not be returned through this API - - If `basicAuthentication` is defined, the `password` property of that - object will be null). - operationId: listWebhookSubscriptions - parameters: - - $ref: '#/components/parameters/accountId' - responses: - '200': - $ref: '#/components/responses/listWebhookSubscriptionsResponse' - '400': - $ref: '#/components/responses/tfvPostBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - post: - tags: - - Toll-Free Verification - summary: Create Webhook Subscription - description: >- - Create a new webhook subscription (this webhook will be called for every - update on every submission). - - In addition to a `callbackUrl`, this subscription can provide optional - HTTP basic authentication credentials (a username and a password). - - The returned subscription object will contain an ID that can be used to - modify or delete the subscription at a later time. - operationId: createWebhookSubscription - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/webhookSubscriptionRequest' - responses: - '201': - $ref: '#/components/responses/createWebhookSubscriptionResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - servers: *ref_4 - /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}: - delete: - tags: - - Toll-Free Verification - summary: Delete Webhook Subscription - description: Delete a webhook subscription by ID. - operationId: deleteWebhookSubscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/webhookSubscriptionIdPathParam' - responses: - '204': - $ref: '#/components/responses/noContentResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - put: - tags: - - Toll-Free Verification - summary: Update Webhook Subscription - description: >- - Update an existing webhook subscription (`callbackUrl` and - `basicAuthentication` can be updated). - operationId: updateWebhookSubscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/webhookSubscriptionIdPathParam' - requestBody: - $ref: '#/components/requestBodies/webhookSubscriptionRequest' - responses: - '200': - $ref: '#/components/responses/updateWebhookSubscriptionResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - servers: *ref_4 - /tollFreeVerification/useCases: - get: - tags: - - Toll-Free Verification - summary: List Toll-Free Use Cases - description: Lists valid toll-free use cases. - operationId: listTollFreeUseCases - responses: - '200': - $ref: '#/components/responses/listTollFreeUseCasesResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - servers: *ref_4 -components: - schemas: - applicationId: - type: string - description: >- - The ID of the Application your from number or senderId is associated - with in the Bandwidth Phone Number Dashboard. - example: 93de2206-9669-4e07-948d-329f4b722ee2 - priorityEnum: - type: string - description: >- - Specifies the message's sending priority with respect to other messages - in your account. For best results and optimal throughput, reserve the - 'high' priority setting for critical messages only. - enum: - - default - - high - example: default - messageStatusEnum: - type: string - description: >- - The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED - DELIVERED ACCEPTED UNDELIVERED. - enum: - - RECEIVED - - QUEUED - - SENDING - - SENT - - FAILED - - DELIVERED - - ACCEPTED - - UNDELIVERED - example: RECEIVED - listMessageDirectionEnum: - type: string - description: The direction of the message. One of INBOUND OUTBOUND. - enum: - - INBOUND - - OUTBOUND - example: INBOUND - messageDirectionEnum: - type: string - description: The direction of the message. One of in out. - enum: - - in - - out - example: in - messageTypeEnum: - type: string - description: The type of message. Either SMS or MMS. - enum: - - sms - - mms - - rcs - example: sms - productTypeEnum: - type: string - description: The type of product associated with the message. - enum: - - LOCAL_A2P - - P2P - - SHORT_CODE_REACH - - TOLL_FREE - - HOSTED_SHORT_CODE - - ALPHA_NUMERIC - - RBM_MEDIA - - RBM_RICH - - RBM_CONVERSATIONAL - example: P2P - fieldError: - type: object - properties: - fieldName: - type: string - description: The name of the field that contains the error - example: from - description: - type: string - description: The error associated with the field - example: >- - '+invalid' must be replaced with a valid E164 formatted telephone - number - messagesList: - title: MessagesList - type: object - properties: - totalCount: - type: integer - description: >- - The total number of messages matched by the search. When the request - has limitTotalCount set to true this value is limited to 10,000. - example: 100 - pageInfo: - $ref: '#/components/schemas/pageInfo' - messages: - type: array - items: - $ref: '#/components/schemas/listMessageItem' - listMessageItem: - title: listMessageItem - type: object - properties: - messageId: - type: string - description: The message id - example: 1589228074636lm4k2je7j7jklbn2 - accountId: - type: string - description: The account id associated with this message. - example: '9900000' - sourceTn: - type: string - description: The source phone number of the message. - example: '+15554443333' - destinationTn: - type: string - description: The recipient phone number of the message. - example: '+15554442222' - messageStatus: - $ref: '#/components/schemas/messageStatusEnum' - messageDirection: - $ref: '#/components/schemas/listMessageDirectionEnum' - messageType: - $ref: '#/components/schemas/messageTypeEnum' - segmentCount: - $ref: '#/components/schemas/segmentCount' - errorCode: - type: integer - description: The numeric error code of the message. - example: 9902 - receiveTime: - type: string - format: date-time - description: The ISO 8601 datetime of the message. - example: 2020-04-07T14:03:07.000Z - carrierName: - type: string - nullable: true - description: >- - The name of the carrier. Not currently supported for MMS coming - soon. - example: other - messageSize: - type: integer - description: The size of the message including message content and headers. - nullable: true - example: 27 - messageLength: - type: integer - description: The length of the message content. - example: 18 - attachmentCount: - type: integer - description: The number of attachments the message has. - nullable: true - example: 1 - recipientCount: - type: integer - description: The number of recipients the message has. - nullable: true - example: 1 - campaignClass: - type: string - description: The campaign class of the message if it has one. - nullable: true - example: T - campaignId: - type: string - description: The campaign ID of the message if it has one. - nullable: true - example: CJEUMDK - bwLatency: - type: integer - description: >- - The Bandwidth latency of the message in seconds. Only available for - accounts with the Advanced Quality Metrics feature enabled. - nullable: true - example: 20 - carrierLatency: - type: integer - description: >- - The carrier latency of the message in seconds. Only available for - OUTBOUND messages from accounts with the Advanced Quality Metrics - feature enabled. - nullable: true - example: 20 - callingNumberCountryA3: - type: string - description: The A3 country code of the calling number. - nullable: true - example: USA - calledNumberCountryA3: - type: string - description: The A3 country code of the called number. - nullable: true - example: USA - product: - type: string - description: The messaging product associated with the message. - nullable: true - example: P2P - location: - type: string - description: The location ID associated with this message. - nullable: true - example: 123ID - pageInfo: - title: PageInfo - type: object - properties: - prevPage: - type: string - description: The link to the previous page for pagination. - example: >- - https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902 - nextPage: - type: string - description: The link to the next page for pagination. - example: >- - https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C - prevPageToken: - type: string - description: The isolated pagination token for the previous page. - example: DLAPE902 - nextPageToken: - type: string - description: The isolated pagination token for the next page. - example: GL83PD3C - messagingRequestError: - title: MessagingRequestError - type: object - properties: - type: - type: string - description: - type: string - required: - - type - - description - createMessageRequestError: - title: CreateMessageRequestError - type: object - properties: - type: - type: string - description: - type: string - fieldErrors: - type: array - items: - $ref: '#/components/schemas/fieldError' - required: - - type - - description - id: - type: string - description: The ID of the message. - example: 1589228074636lm4k2je7j7jklbn2 - media: - title: Media - type: object - properties: - content: - type: string - contentLength: - type: integer - mediaName: - type: string - segmentCount: - type: integer - description: >- - The number of segments the user's message is broken into before sending - over carrier networks. - example: 1 - tag: - title: Tag - type: string - description: >- - A custom string that will be included in callback events of the message. - Max 1024 characters. - example: custom string - expiration: - type: string - format: date-time - description: >- - A string with the date/time value that the message will automatically - expire by. This must be a valid RFC-3339 value, e.g., - 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time - in the future. - example: '2021-02-01T11:29:18-05:00' - carrierName: - type: string - description: >- - The name of the Authorized Message Provider (AMP) that handled this - message. - - In the US, this is the carrier that the message was sent to. - - This field is present only when this account feature has been enabled. - example: AT&T - message: - title: Message - type: object - properties: - id: - type: string - description: The id of the message. - example: 1589228074636lm4k2je7j7jklbn2 - owner: - type: string - description: The Bandwidth phone number associated with the message. - example: '+15554443333' - applicationId: - $ref: '#/components/schemas/applicationId' - time: - type: string - format: date-time - description: The datetime stamp of the message in ISO 8601 - example: 2024-12-02T20:15:57.278Z - segmentCount: - $ref: '#/components/schemas/segmentCount' - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - uniqueItems: true - type: array - items: - type: string - description: The phone number recipients of the message. - example: - - '+15552223333' - from: - type: string - description: The phone number the message was sent from. - example: '+15553332222' - media: - uniqueItems: true - type: array - items: - type: string - description: >- - The list of media URLs sent in the message. Including a `filename` - field in the `Content-Disposition` header of the media linked with a - URL will set the displayed file name. This is a best practice to - ensure that your media has a readable file name. - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - text: - type: string - description: The contents of the message. - example: Hello world - tag: - $ref: '#/components/schemas/tag' - priority: - $ref: '#/components/schemas/priorityEnum' - expiration: - $ref: '#/components/schemas/expiration' - messageRequest: - title: MessageRequest - type: object - required: - - applicationId - - to - - from - properties: - applicationId: - $ref: '#/components/schemas/applicationId' - to: - uniqueItems: true - type: array - description: The phone number(s) the message should be sent to in E164 format. - example: - - '+15554443333' - - '+15552223333' - items: - type: string - from: - type: string - description: >- - Either an alphanumeric sender ID or the sender's Bandwidth phone - number in E.164 format, which must be hosted within Bandwidth and - linked to the account that is generating the message. - - Alphanumeric Sender IDs can contain up to 11 characters, upper-case - letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, - plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must - contain at least one letter. - example: '+15551113333' - text: - $ref: '#/components/schemas/messageText' - media: - $ref: '#/components/schemas/messageMedia' - tag: - $ref: '#/components/schemas/tag' - priority: - $ref: '#/components/schemas/priorityEnum' - expiration: - $ref: '#/components/schemas/expiration' - messageText: - type: string - description: The contents of the text message. Must be 2048 characters or less. - maxLength: 2048 - example: Hello world - messageMedia: - type: array - items: - type: string - format: uri - maxLength: 4096 - description: |- - A list of URLs to include as media attachments as part of the message. - Each URL can be at most 4096 characters. - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png - createMultiChannelMessageResponse: - type: object - properties: - links: - type: array - items: - $ref: '#/components/schemas/link' - example: [] - data: - $ref: '#/components/schemas/multiChannelMessageResponseData' - errors: - type: array - items: - $ref: '#/components/schemas/errorObject' - example: [] - multiChannelError: - type: object - properties: - links: - type: array - items: - $ref: '#/components/schemas/link' - example: [] - data: - type: object - nullable: true - example: null - errors: - type: array - items: - $ref: '#/components/schemas/errorObject' - link: - type: object - properties: - rel: - type: string - href: - type: string - errorObject: - type: object - properties: - type: - description: A concise summary of the error used for categorization. - type: string - description: - description: A detailed explanation of the error. - type: string - source: - $ref: '#/components/schemas/errorSource' - required: - - type - - description - - source - errorSource: - title: Error Source - type: object - description: Specifies relevant sources of the error, if any. - properties: - parameter: - type: string - description: The relevant URI query parameter causing the error - field: - type: string - description: The request body field that led to the error - header: - type: string - description: The header field that contributed to the error - reference: - type: string - description: A resource ID or path linked to the error - multiChannelMessageChannelEnum: - description: The channel of the multi-channel message. - type: string - enum: - - RBM - - SMS - - MMS - example: RBM - multiChannelSenderId: - type: string - description: The sender ID of the message. This could be an alphanumeric sender ID. - example: BandwidthRBM - multiChannelDestination: - type: string - description: The phone number the message should be sent to in E164 format. - example: '+15552223333' - multiChannelDestinations: - uniqueItems: true - type: array - description: The destination phone number(s) of the message, in E164 format. - example: - - '+15554443333' - items: - type: string - rbmMessageContentText: - title: RBM Text - type: object - properties: - text: - type: string - description: >- - The text associated with the message. Must be 3270 characters or - less - maxLength: 3270 - example: Hello world - suggestions: - $ref: '#/components/schemas/multiChannelFullActions' - required: - - text - rbmMediaHeightEnum: - type: string - description: The height of the media. - enum: - - SHORT - - MEDIUM - - TALL - example: SHORT - rbmMessageContentFile: - title: RBM Rich Media File - type: object - properties: - fileUrl: - type: string - format: uri - description: The URL of the media file. 100MB is the maximum file size. - example: https://dev.bandwidth.com/images/bandwidth-logo.png - maxLength: 1000 - thumbnailUrl: - type: string - format: uri - description: The URL of the thumbnail image. Applies only to video file media. - example: https://dev.bandwidth.com/images/bandwidth-logo.png - maxLength: 1000 - required: - - fileUrl - mmsMessageContentFile: - title: MMS Media File - type: object - properties: - fileUrl: - type: string - format: uri - description: >- - The URL of a media attachment. - - - For MMS, the API limits file size to 3.5MB. Specific carriers and - channels may have a smaller limit that could cause a large file to - fail, see - [here](https://support.bandwidth.com/hc/en-us/articles/360014235473-What-are-the-MMS-file-size-limits) - for more details. - example: https://dev.bandwidth.com/images/bandwidth-logo.png - maxLength: 1000 - required: - - fileUrl - rbmMessageMedia: - title: RBM Media - type: object - properties: - media: - $ref: '#/components/schemas/rbmMessageContentFile' - suggestions: - $ref: '#/components/schemas/multiChannelFullActions' - required: - - media - rbmCardContent: - type: object - properties: - title: - type: string - description: The title of the card. Must be 200 characters or less. - maxLength: 200 - example: Bandwidth - description: - type: string - description: The description of the card. Must be 2000 characters or less. - maxLength: 2000 - example: Bandwidth is a communications platform as a service (CPaaS) company. - media: - allOf: - - $ref: '#/components/schemas/rbmMessageContentFile' - - type: object - properties: - height: - $ref: '#/components/schemas/rbmMediaHeightEnum' - required: - - height - suggestions: - description: >- - An array of suggested actions for the recipient that will be - displayed on the rich card. - type: array - items: - $ref: '#/components/schemas/multiChannelAction' - maxItems: 4 - rbmStandaloneCard: - title: Standalone Card - type: object - properties: - orientation: - $ref: '#/components/schemas/standaloneCardOrientationEnum' - thumbnailImageAlignment: - $ref: '#/components/schemas/thumbnailAlignmentEnum' - cardContent: - $ref: '#/components/schemas/rbmCardContent' - suggestions: - $ref: '#/components/schemas/multiChannelFullActions' - required: - - orientation - - thumbnailImageAlignment - - cardContent - standaloneCardOrientationEnum: - type: string - enum: - - HORIZONTAL - - VERTICAL - example: VERTICAL - thumbnailAlignmentEnum: - type: string - description: >- - The alignment of the thumbnail image in the card. Only applicable if the - card using horizontal orientation. - enum: - - LEFT - - RIGHT - example: LEFT - rbmMessageCarouselCard: - title: Carousel - type: object - properties: - cardWidth: - $ref: '#/components/schemas/cardWidthEnum' - cardContents: - type: array - items: - $ref: '#/components/schemas/rbmCardContent' - maxItems: 10 - suggestions: - $ref: '#/components/schemas/multiChannelFullActions' - required: - - cardContents - - cardWidth - cardWidthEnum: - type: string - enum: - - SMALL - - MEDIUM - example: SMALL - smsMessageContent: - title: SMS Text - type: object - properties: - text: - $ref: '#/components/schemas/messageText' - required: - - text - mmsMessageContent: - title: MMS Message - type: object - properties: - text: - $ref: '#/components/schemas/messageText' - media: - type: array - items: - $ref: '#/components/schemas/mmsMessageContentFile' - rbmMessageContentRichCard: - title: RBM Rich Card - oneOf: - - $ref: '#/components/schemas/rbmStandaloneCard' - - $ref: '#/components/schemas/rbmMessageCarouselCard' - rbmActionTypeEnum: - type: string - enum: - - REPLY - - DIAL_PHONE - - SHOW_LOCATION - - CREATE_CALENDAR_EVENT - - OPEN_URL - - REQUEST_LOCATION - example: REPLY - rbmOpenUrlEnum: - type: string - description: >- - Specifies how the URL should be opened on a mobile device. - - - `BROWSER` Opens the URL in the device's default browser. If - application is not set or the device doesn’t support WebView, this - option is used by default. - - - `WEBVIEW` Opens the URL in an in-app WebView. - enum: - - BROWSER - - WEBVIEW - example: WEBVIEW - rbmWebViewEnum: - type: string - description: >- - Defines the layout of the WebView on a mobile device. It must be defined - when application is set to `WEBVIEW` - - - `FULL` WebView takes the full screen. - - - `HALF` WebView takes half of the screen. - - - `TALL` WebView takes three-quarters of the screen. - enum: - - FULL - - HALF - - TALL - rbmActionText: - title: Text - type: string - description: Displayed text for user to click - maxLength: 25 - example: Hello world - rbmActionPostbackData: - title: Post Back Data - type: string - format: byte - description: Base64 payload the customer receives when the reply is clicked. - maxLength: 2048 - example: SGVsbG8gd29ybGQ= - rbmActionBase: - type: object - properties: - type: - $ref: '#/components/schemas/rbmActionTypeEnum' - text: - $ref: '#/components/schemas/rbmActionText' - postbackData: - $ref: '#/components/schemas/rbmActionPostbackData' - required: - - text - - postbackData - - type - rbmActionDial: - allOf: - - $ref: '#/components/schemas/rbmActionBase' - - title: Dial Phone - type: object - properties: - phoneNumber: - type: string - description: The phone number to dial. Must be E164 format. - example: '+15552223333' - required: - - phoneNumber - rbmActionViewLocation: - allOf: - - $ref: '#/components/schemas/rbmActionBase' - - title: Show Location - type: object - properties: - latitude: - type: string - format: double - description: The latitude of the location. - example: '37.7749' - longitude: - type: string - format: double - description: The longitude of the location. - example: '-122.4194' - label: - type: string - description: The label of the location. - example: San Francisco - maxLength: 100 - required: - - latitude - - longitude - multiChannelActionCalendarEvent: - allOf: - - $ref: '#/components/schemas/rbmActionBase' - - title: Calendar Event - type: object - properties: - title: - type: string - description: The title of the event. - example: Meeting with John - maxLength: 100 - startTime: - type: string - format: date-time - description: The start time of the event. - example: 2022-09-14T18:20:16.000Z - endTime: - type: string - format: date-time - description: The end time of the event. - example: 2022-09-14T18:20:16.000Z - description: - type: string - description: The description of the event. - example: Discuss the new project - maxLength: 500 - required: - - title - - startTime - - endTime - rbmActionOpenUrl: - allOf: - - $ref: '#/components/schemas/rbmActionBase' - - title: Open URL - type: object - properties: - url: - type: string - format: uri - description: The URL to open in browser. - example: https://dev.bandwidth.com - maxLength: 2048 - application: - $ref: '#/components/schemas/rbmOpenUrlEnum' - webviewViewMode: - $ref: '#/components/schemas/rbmWebViewEnum' - required: - - url - multiChannelFullActions: - type: array - description: An array of suggested actions for the recipient. - items: - $ref: '#/components/schemas/multiChannelAction' - maxItems: 11 - multiChannelAction: - anyOf: - - $ref: '#/components/schemas/rbmActionBase' - - $ref: '#/components/schemas/rbmActionDial' - - $ref: '#/components/schemas/rbmActionViewLocation' - - $ref: '#/components/schemas/multiChannelActionCalendarEvent' - - $ref: '#/components/schemas/rbmActionOpenUrl' - discriminator: - propertyName: type - mapping: - REPLY: '#/components/schemas/rbmActionBase' - DIAL_PHONE: '#/components/schemas/rbmActionDial' - SHOW_LOCATION: '#/components/schemas/rbmActionViewLocation' - CREATE_CALENDAR_EVENT: '#/components/schemas/multiChannelActionCalendarEvent' - OPEN_URL: '#/components/schemas/rbmActionOpenUrl' - REQUEST_LOCATION: '#/components/schemas/rbmActionBase' - multiChannelChannelListObjectBase: - type: object - properties: - from: - $ref: '#/components/schemas/multiChannelSenderId' - applicationId: - $ref: '#/components/schemas/applicationId' - channel: - $ref: '#/components/schemas/multiChannelMessageChannelEnum' - required: - - from - - applicationId - - channel - multiChannelChannelListRBMObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListObjectBase' - - type: object - properties: - content: - description: The content of the message. - oneOf: - - $ref: '#/components/schemas/rbmMessageContentText' - - $ref: '#/components/schemas/rbmMessageMedia' - - $ref: '#/components/schemas/rbmMessageContentRichCard' - required: - - content - multiChannelChannelListSMSObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListObjectBase' - - type: object - properties: - content: - $ref: '#/components/schemas/smsMessageContent' - required: - - content - multiChannelChannelListMMSObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListObjectBase' - - type: object - properties: - content: - $ref: '#/components/schemas/mmsMessageContent' - required: - - content - multiChannelChannelListRBMResponseObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListRBMObject' - - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' - multiChannelChannelListSMSResponseObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListSMSObject' - - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' - multiChannelChannelListMMSResponseObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListMMSObject' - - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' - multiChannelChannelListRequestObject: - anyOf: - - $ref: '#/components/schemas/multiChannelChannelListRBMObject' - - $ref: '#/components/schemas/multiChannelChannelListSMSObject' - - $ref: '#/components/schemas/multiChannelChannelListMMSObject' - discriminator: - propertyName: channel - mapping: - RBM: '#/components/schemas/multiChannelChannelListRBMObject' - SMS: '#/components/schemas/multiChannelChannelListSMSObject' - MMS: '#/components/schemas/multiChannelChannelListMMSObject' - multiChannelChannelListOwnerObject: - type: object - properties: - owner: - type: string - description: >- - The Bandwidth senderId associated with the message. Identical to - 'from'. - required: - - owner - multiChannelChannelListResponseObject: - anyOf: - - $ref: '#/components/schemas/multiChannelChannelListRBMResponseObject' - - $ref: '#/components/schemas/multiChannelChannelListSMSResponseObject' - - $ref: '#/components/schemas/multiChannelChannelListMMSResponseObject' - discriminator: - propertyName: channel - mapping: - RBM: '#/components/schemas/multiChannelChannelListRBMResponseObject' - SMS: '#/components/schemas/multiChannelChannelListSMSResponseObject' - MMS: '#/components/schemas/multiChannelChannelListMMSResponseObject' - multiChannelMessageRequest: - description: Multi-Channel Message Request - type: object - properties: - to: - $ref: '#/components/schemas/multiChannelDestination' - channelList: - type: array - description: >- - A list of message bodies. The messages will be attempted in the - order they are listed. Once a message sends successfully, the others - will be ignored. - items: - $ref: '#/components/schemas/multiChannelChannelListRequestObject' - maxItems: 4 - tag: - $ref: '#/components/schemas/tag' - priority: - $ref: '#/components/schemas/priorityEnum' - expiration: - $ref: '#/components/schemas/expiration' - required: - - to - - channelList - multiChannelMessageResponseData: - description: The data returned in a multichannel message response. - type: object - properties: - id: - $ref: '#/components/schemas/id' - time: - description: The time the message was received by the Bandwidth API. - type: string - format: date-time - example: 2025-01-01T18:20:16.000Z - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - $ref: '#/components/schemas/multiChannelDestinations' - channelList: - type: array - description: >- - A list of message bodies. The messages will be attempted in the - order they are listed. Once a message sends successfully, the others - will be ignored. - items: - $ref: '#/components/schemas/multiChannelChannelListResponseObject' - maxItems: 4 - tag: - $ref: '#/components/schemas/tag' - priority: - $ref: '#/components/schemas/priorityEnum' - expiration: - $ref: '#/components/schemas/expiration' - required: - - id - - time - - direction - - to - - channelList - multiChannelMessageContent: - description: The structure of the content field of a multichannel message. - type: object - properties: - text: - type: string - media: - $ref: '#/components/schemas/rbmMessageContentFile' - rbmSuggestionResponse: - type: object - properties: - text: - type: string - description: The text associated with the suggestion response. - example: Yes, I would like to proceed - postbackData: - $ref: '#/components/schemas/rbmActionPostbackData' - rbmLocationResponse: - type: object - properties: - latitude: - type: string - format: double - description: The latitude of the client's location. - example: '37.7749' - longitude: - type: string - format: double - description: The longitude of the client's location. - example: '-122.4194' - callback: - description: >- - Callbacks are divided into two types based on direction of the related - message: - - - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM - message. - - - `inboundCallback` indicates an inbound MO message or a multichannel - message client's response to a suggestion or location request. - type: object - oneOf: - - $ref: '#/components/schemas/statusCallback' - - $ref: '#/components/schemas/inboundCallback' - discriminator: - propertyName: type - mapping: - message-sent: '#/components/schemas/statusCallback' - message-delivered: '#/components/schemas/statusCallback' - message-failed: '#/components/schemas/statusCallback' - message-read: '#/components/schemas/statusCallback' - message-received: '#/components/schemas/inboundCallback' - request-location-response: '#/components/schemas/inboundCallback' - suggestion-response: '#/components/schemas/inboundCallback' - statusCallback: - type: object - description: >- - Represents a status callback for an outbound MT SMS or MMS or RBM - message. - properties: - time: - type: string - format: date-time - example: 2024-12-02T20:15:57.278Z - eventTime: - type: string - description: >- - Represents the time at which the message was read, for - `message-read` callbacks. - format: date-time - example: 2024-12-02T20:15:58.278Z - type: - $ref: '#/components/schemas/statusCallbackTypeEnum' - to: - type: string - description: >- - The destination phone number the message was sent to. - - For status callbacks, this the the Bandwidth user's client phone - number. - example: '+15552223333' - description: - type: string - description: A detailed description of the event described by the callback. - example: Message delivered to carrier. - message: - $ref: '#/components/schemas/statusCallbackMessage' - errorCode: - type: integer - description: Optional error code, applicable only when type is `message-failed`. - example: 4405 - carrierName: - $ref: '#/components/schemas/carrierName' - required: - - time - - type - - to - - description - - message - inboundCallback: - type: object - description: Represents an inbound callback. - properties: - time: - type: string - format: date-time - example: 2024-12-02T20:15:57.278Z - type: - $ref: '#/components/schemas/inboundCallbackTypeEnum' - to: - type: string - description: > - The destination phone number the message was sent to. - - For inbound callbacks, this is the Bandwidth number or alphanumeric - identifier that received the message. - example: '+15552223333' - description: - type: string - description: A detailed description of the event described by the callback. - example: Incoming message received - message: - $ref: '#/components/schemas/inboundCallbackMessage' - carrierName: - $ref: '#/components/schemas/carrierName' - required: - - time - - type - - to - - description - - message - statusCallbackTypeEnum: - type: string - description: >- - The possible status callbacks when sending an MT SMS or MMS or RBM - message: - - - `message-sending` indicates that Bandwidth is sending the message to - the upstream provider. - - - `message-delivered` indicates that the message was successfully sent. - - - `message-failed` indicates that the message could not be sent to the - intended recipient. - - - `message-read` indicates that the RBM message was read by the - recipient. - enum: - - message-sending - - message-delivered - - message-failed - - message-read - example: message-delivered - inboundCallbackTypeEnum: - type: string - description: >- - The possible inbound callback types originating from MO messages or - multichannel message client responses: - - - `message-received` indicates an MO message from a Bandwidth user's - client to a Bandwidth number. - - - `request-location-response` indicates a response to a location request - sent by the Bandwidth user's client after receiving an RBM message. - - - `suggestion-response` indicates a response to a suggestion sent by the - Bandwidth user's client after receiving an RBM message. - enum: - - message-received - - request-location-response - - suggestion-response - example: message-received - statusCallbackMessage: - description: Message payload schema within a callback - type: object - properties: - id: - type: string - description: A unique identifier of the message. - example: 1661365814859loidf7mcwd4qacn7 - owner: - type: string - description: >- - The Bandwidth phone number or alphanumeric identifier associated - with the message. - example: '+15553332222' - applicationId: - $ref: '#/components/schemas/applicationId' - time: - type: string - format: date-time - example: 2024-12-02T20:15:57.666Z - segmentCount: - $ref: '#/components/schemas/segmentCount' - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - description: The phone number recipients of the message. - uniqueItems: true - type: array - items: - type: string - example: - - '+15552223333' - from: - type: string - description: >- - The Bandwidth phone number or alphanumeric identifier the message - was sent from. - example: '+15553332222' - text: - type: string - example: Hello world - tag: - $ref: '#/components/schemas/tag' - media: - type: array - description: Optional media, not applicable for sms - items: - type: string - format: uri - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png - priority: - $ref: '#/components/schemas/priorityEnum' - channel: - $ref: '#/components/schemas/multiChannelMessageChannelEnum' - required: - - id - - owner - - applicationId - - time - - segmentCount - - direction - - to - - from - inboundCallbackMessage: - allOf: - - $ref: '#/components/schemas/statusCallbackMessage' - - type: object - properties: - content: - $ref: '#/components/schemas/multiChannelMessageContent' - suggestionResponse: - $ref: '#/components/schemas/rbmSuggestionResponse' - locationResponse: - $ref: '#/components/schemas/rbmLocationResponse' - required: - - id - - owner - - applicationId - - time - - segmentCount - - direction - - to - - from - callbackMethodEnum: - type: string - nullable: true - default: POST - enum: - - GET - - POST - description: >- - The HTTP method to use to deliver the callback. GET or POST. Default - value is POST. - example: POST - redirectMethodEnum: - type: string - nullable: true - default: POST - enum: - - GET - - POST - description: >- - The HTTP method to use for the request to `redirectUrl`. GET - - or POST. Default value is POST.

Not allowed if `state` is - `completed`. - example: POST - recordingStateEnum: - type: string - enum: - - paused - - recording - description: |- - The recording state. Possible values: - - `paused` to pause an active recording - - `recording` to resume a paused recording - example: paused - callDirectionEnum: - type: string - enum: - - inbound - - outbound - description: The direction of the call. - example: inbound - fileFormatEnum: - type: string - enum: - - mp3 - - wav - description: The format that the recording is stored in. - example: wav - callStateEnum: - nullable: true - type: string - default: active - enum: - - active - - completed - description: >- - The call state. Possible values:
`active` to redirect the - - call (default)
`completed` to hang up the call if it is answered, - cancel - - it if it is an unanswered outbound call, or reject it if it an - unanswered - - inbound call - example: completed - conferenceStateEnum: - nullable: true - type: string - default: active - enum: - - active - - completed - description: >- - Setting the conference state to `completed` ends the conference and - ejects all members. - example: completed - machineDetectionModeEnum: - type: string - default: async - enum: - - sync - - async - description: >- - The machine detection mode. If set to 'async', the detection - - result will be sent in a 'machineDetectionComplete' callback. If set to - - 'sync', the 'answer' callback will wait for the machine detection to - complete - - and will include its result. - example: async - callTranscriptionDetectedLanguageEnum: - type: string - enum: - - en-US - - es-US - - fr-FR - description: The detected language for this transcription. - example: en-US - callTranscriptionTrackEnum: - type: string - enum: - - inbound - - outbound - description: Which `track` this transcription is derived from. - example: inbound - createCall: - type: object - required: - - answerUrl - - applicationId - - from - - to - properties: - to: - type: string - description: >- - The destination to call (must be an E.164 formatted number - - (e.g. `+15555551212`) or a SIP URI (e.g. - `sip:user@server.example`)). - example: '+19195551234' - from: - type: string - description: >- - A Bandwidth phone number on your account the call should come - - from (must be in E.164 format, like `+15555551212`) even if - `privacy` is set to true. - example: '+15555551212' - privacy: - nullable: true - type: boolean - description: >- - Hide the calling number. The `displayName` field can be used to - customize the displayed name. - example: false - displayName: - nullable: true - type: string - description: >- - The caller display name to use when the call is created. - - May not exceed 256 characters nor contain control characters such as - new lines. - - If `privacy` is true, only the following values are valid: - `Restricted`, `Anonymous`, `Private`, or `Unavailable`. - maxLength: 256 - example: John Doe - uui: - nullable: true - type: string - example: >- - eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64 - description: >- - A comma-separated list of 'User-To-User' headers to be sent - - in the INVITE when calling a SIP URI. Each value must end with an - 'encoding' - - parameter as described in RFC - - 7433. Only 'jwt', 'base64' and 'hex' encodings are allowed. The - entire value - - cannot exceed 350 characters, including parameters and separators. - applicationId: - type: string - description: The id of the application associated with the `from` number. - example: 1234-qwer-5679-tyui - answerUrl: - type: string - format: uri - description: >- - The full URL to send the Answer - - event to when the called party answers. This endpoint should return - the - - first BXML document to be executed in - the - - call. - - - Must use `https` if specifying `username` and `password`. - maxLength: 2048 - example: https://www.myCallbackServer.example/webhooks/answer - answerMethod: - $ref: '#/components/schemas/callbackMethodEnum' - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - answerFallbackUrl: - nullable: true - type: string - format: uri - description: >- - A fallback url which, if provided, will be used to retry the - - `answer` webhook delivery in case `answerUrl` fails to respond - - - Must use `https` if specifying `fallbackUsername` and - `fallbackPassword`. - maxLength: 2048 - example: https://www.myFallbackServer.example/webhooks/answer - answerFallbackMethod: - $ref: '#/components/schemas/callbackMethodEnum' - fallbackUsername: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - fallbackPassword: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - disconnectUrl: - nullable: true - type: string - format: uri - description: >- - The URL to send the Disconnect event to when - the call ends. This event does not expect a BXML response. - maxLength: 2048 - example: https://www.myCallbackServer.example/webhooks/disconnect - disconnectMethod: - $ref: '#/components/schemas/callbackMethodEnum' - callTimeout: - nullable: true - type: number - format: double - description: >- - The timeout (in seconds) for the callee to answer the call - - after it starts ringing. If the call does not start ringing within - 30s, - - the call will be cancelled regardless of this value. Can be any - numeric - - value (including decimals) between 1 and 300. - minimum: 1 - maximum: 300 - default: 30 - example: 30 - callbackTimeout: - nullable: true - type: number - format: double - description: >- - This is the timeout (in seconds) to use when delivering webhooks - - for the call. Can be any numeric value (including decimals) between - 1 - - and 25. - minimum: 1 - maximum: 25 - default: 15 - example: 15 - machineDetection: - $ref: '#/components/schemas/machineDetectionConfiguration' - priority: - nullable: true - type: integer - minimum: 1 - maximum: 5 - default: 5 - description: >- - The priority of this call over other calls from your account. For - example, if during a call - - your application needs to place a new call and bridge it with the - current - - call, you might want to create the call with priority 1 so that it - will - - be the next call picked off your queue, ahead of other less time - sensitive - - calls. A lower value means higher priority, so a priority 1 call - takes - - precedence over a priority 2 call. - example: 5 - tag: - nullable: true - type: string - description: >- - A custom string that will be sent with all webhooks for this - - call unless overwritten by a future `` - - verb or `tag` attribute on another verb, or cleared. - - - May be cleared by setting `tag=""` - - - Max length 256 characters. - maxLength: 256 - example: arbitrary text here - createCallResponse: - type: object - required: - - accountId - - answerMethod - - answerUrl - - applicationId - - callId - - callUrl - - disconnectMethod - - from - - to - properties: - applicationId: - type: string - example: 04e88489-df02-4e34-a0ee-27a91849555f - description: The id of the application associated with the `from` number. - accountId: - type: string - example: '9900000' - description: The bandwidth account ID associated with the call. - callId: - type: string - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - description: Programmable Voice API Call ID. - to: - type: string - example: '+19195551234' - description: Recipient of the outgoing call. - from: - type: string - example: '+19195554321' - description: Phone number that created the outbound call. - enqueuedTime: - nullable: true - type: string - format: date-time - description: The time at which the call was accepted into the queue. - example: '2022-06-16T13:15:07.160Z' - callUrl: - type: string - format: uri - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - description: The URL to update this call's state. - callTimeout: - type: number - format: double - example: 30 - description: >- - The timeout (in seconds) for the callee to answer the call after it - starts ringing. - callbackTimeout: - type: number - format: double - example: 15 - description: >- - This is the timeout (in seconds) to use when delivering webhooks for - the call. - tag: - nullable: true - type: string - example: My custom tag value - description: Custom tag value. - answerMethod: - $ref: '#/components/schemas/callbackMethodEnum' - answerUrl: - type: string - format: uri - example: https://myServer.example/bandwidth/webhooks/answer - description: URL to deliver the `answer` event webhook. - answerFallbackMethod: - $ref: '#/components/schemas/callbackMethodEnum' - answerFallbackUrl: - nullable: true - type: string - format: uri - example: https://myFallbackServer.example/bandwidth/webhooks/answer - description: Fallback URL to deliver the `answer` event webhook. - disconnectMethod: - $ref: '#/components/schemas/callbackMethodEnum' - disconnectUrl: - nullable: true - type: string - format: uri - example: https://myServer.example/bandwidth/webhooks/disconnect - description: URL to deliver the `disconnect` event webhook. - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - fallbackUsername: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - fallbackPassword: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - priority: - nullable: true - type: integer - example: 5 - description: The priority of this call over other calls from your account. - callState: - type: object - properties: - applicationId: - type: string - description: The application id associated with the call. - example: 04e88489-df02-4e34-a0ee-27a91849555f - accountId: - type: string - description: The account id associated with the call. - example: '9900000' - callId: - type: string - description: The programmable voice API call ID. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - parentCallId: - nullable: true - type: string - description: >- - The A-leg call id, set only if this call is the B-leg of a - [``](/docs/voice/bxml/transfer). - example: c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - to: - type: string - description: >- - The phone number that received the call, in E.164 format (e.g. - +15555555555), or if the call was to a SIP URI, the SIP URI. - example: '+19195551234' - from: - type: string - description: >- - The phone number that made the call, in E.164 format (e.g. - +15555555555). - example: '+19195554321' - direction: - $ref: '#/components/schemas/callDirectionEnum' - state: - description: >- - The current state of the call. Current possible values are - - `queued`, `initiated`, `answered` and `disconnected`. Additional - states - - may be added in the future, so your application must be tolerant of - unknown - - values. - type: string - example: disconnected - stirShaken: - nullable: true - type: object - description: >- - For inbound calls, the Bandwidth STIR/SHAKEN implementation will - verify the information provided in the inbound invite request - `Identity` header. - - The verification status is stored in the call state `stirShaken` - property as follows. - - - | Property | Description | - - |:------------------|:------------| - - | verstat | (optional) The verification status indicating whether - the verification was successful or not. Possible values are - `TN-Validation-Passed` or `TN-Validation-Failed`. | - - | attestationIndicator | (optional) The attestation level verified - by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` - (gateway). | - - | originatingId | (optional) A unique origination identifier. | - - - Note that these are common properties but that the `stirShaken` - object is free form and can contain other key-value pairs. - - - More information: [Understanding - STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). - additionalProperties: - type: string - example: - verstat: TN-Validation-Passed - attestationIndicator: A - originatingId: abc123 - identity: - nullable: true - type: string - description: >- - The value of the `Identity` header from the inbound invite - - request. Only present for inbound calls and if the account is - configured - - to forward this header. - example: >- - eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken - enqueuedTime: - nullable: true - type: string - format: date-time - description: The time this call was placed in queue. - example: '2022-06-16T13:15:07.160Z' - startTime: - nullable: true - type: string - format: date-time - description: >- - The time the call was initiated, in ISO 8601 format. `null` if the - call is still in your queue. - example: '2022-06-16T13:15:07.160Z' - answerTime: - nullable: true - type: string - format: date-time - description: >- - Populated once the call has been answered, with the time in ISO 8601 - format. - example: '2022-06-16T13:15:18.126Z' - endTime: - nullable: true - type: string - format: date-time - description: Populated once the call has ended, with the time in ISO 8601 format. - example: '2022-06-16T13:15:18.314Z' - disconnectCause: - nullable: true - type: string - description: >- - | Cause | Description | - - |:------|:------------| - - | `hangup`| One party hung up the call, a - [``](../../bxml/verbs/hangup.md) verb was executed, or there - was no more BXML to execute; it indicates that the call ended - normally. | - - | `busy` | Callee was busy. | - - | `timeout` | Call wasn't answered before the `callTimeout` was - reached. | - - | `cancel` | Call was cancelled by its originator while it was - ringing. | - - | `rejected` | Call was rejected by the callee. | - - | `callback-error` | BXML callback couldn't be delivered to your - callback server. | - - | `invalid-bxml` | Invalid BXML was returned in response to a - callback. | - - | `application-error` | An unsupported action was tried on the call, - e.g. trying to play a .ogg audio. | - - | `account-limit` | Account rate limits were reached. | - - | `node-capacity-exceeded` | System maximum capacity was reached. | - - | `error` | Some error not described in any of the other causes - happened on the call. | - - | `unknown` | Unknown error happened on the call. | - - - Note: This list is not exhaustive and other values can appear in the - future. - errorMessage: - nullable: true - type: string - description: >- - Populated only if the call ended with an error, with text explaining - the reason. - example: null - errorId: - nullable: true - type: string - description: >- - Populated only if the call ended with an error, with a Bandwidth - internal id that references the error event. - example: null - lastUpdate: - type: string - format: date-time - description: The last time the call had a state update, in ISO 8601 format. - example: '2022-06-16T13:15:18.314Z' - updateCall: - type: object - properties: - state: - $ref: '#/components/schemas/callStateEnum' - redirectUrl: - description: |- - The URL to send the [Redirect](/docs/voice/bxml/redirect) event - to which will provide new BXML. - - Required if `state` is `active`. - - Not allowed if `state` is `completed`. - nullable: true - type: string - format: uri - example: https://myServer.example/bandwidth/webhooks/redirect - redirectMethod: - $ref: '#/components/schemas/redirectMethodEnum' - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - redirectFallbackUrl: - nullable: true - type: string - format: uri - description: |- - A fallback url which, if provided, will be used to retry the - redirect callback delivery in case `redirectUrl` fails to respond. - example: https://myFallbackServer.example/bandwidth/webhooks/redirect - redirectFallbackMethod: - $ref: '#/components/schemas/redirectMethodEnum' - fallbackUsername: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - fallbackPassword: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - tag: - nullable: true - type: string - description: >- - A custom string that will be sent with this and all future - - callbacks unless overwritten by a future `tag` attribute or - [``](/docs/voice/bxml/tag) - - verb, or cleared. - - - May be cleared by setting `tag=""`. - - - Max length 256 characters. - - - Not allowed if `state` is `completed`. - maxLength: 256 - example: My Custom Tag - updateCallRecording: - type: object - required: - - state - properties: - state: - $ref: '#/components/schemas/recordingStateEnum' - accountStatistics: - type: object - properties: - currentCallQueueSize: - type: integer - description: The number of calls currently enqueued. - example: 0 - maxCallQueueSize: - type: integer - description: >- - The maximum size of the queue before outgoing calls start being - rejected. - example: 900 - callRecordingMetadata: - type: object - properties: - applicationId: - $ref: '#/components/schemas/applicationId1' - accountId: - $ref: '#/components/schemas/accountId' - callId: - $ref: '#/components/schemas/callId' - parentCallId: - $ref: '#/components/schemas/parentCallId' - recordingId: - $ref: '#/components/schemas/recordingId' - to: - $ref: '#/components/schemas/to' - from: - $ref: '#/components/schemas/from' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - duration: - $ref: '#/components/schemas/duration' - direction: - $ref: '#/components/schemas/callDirectionEnum' - channels: - $ref: '#/components/schemas/channels' - startTime: - $ref: '#/components/schemas/startTime' - endTime: - $ref: '#/components/schemas/endTime' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - status: - $ref: '#/components/schemas/status' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - transcription: - $ref: '#/components/schemas/recordingTranscriptionMetadata' - recordingName: - $ref: '#/components/schemas/recordingName' - conference: - type: object - properties: - id: - type: string - description: The Bandwidth-generated conference ID. - example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 - name: - type: string - description: The name of the conference, as specified by your application. - example: my-conference-name - createdTime: - type: string - format: date-time - description: The time the conference was initiated, in ISO 8601 format. - example: '2022-06-17T22:19:40.375Z' - completedTime: - nullable: true - type: string - format: date-time - description: The time the conference was terminated, in ISO 8601 format. - example: '2022-06-17T22:20:00.000Z' - conferenceEventUrl: - nullable: true - type: string - format: uri - description: The URL to send the conference-related events. - example: https://myServer.example/bandwidth/webhooks/conferenceEvent - conferenceEventMethod: - $ref: '#/components/schemas/callbackMethodEnum' - tag: - nullable: true - type: string - description: >- - The custom string attached to the conference that will be sent with - callbacks. - example: my custom tag - activeMembers: - type: array - nullable: true - items: - $ref: '#/components/schemas/conferenceMember' - description: >- - A list of active members of the conference. Omitted if this - - is a response to the [Get Conferences - endpoint](/apis/voice#tag/Conferences/operation/listConferences). - updateConference: - type: object - properties: - status: - $ref: '#/components/schemas/conferenceStateEnum' - redirectUrl: - nullable: true - type: string - format: uri - description: >- - The URL to send the - [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) - - event which will provide new BXML. Not allowed if `state` is - `completed`, - - but required if `state` is `active`. - example: https://myServer.example/bandwidth/webhooks/conferenceRedirect - redirectMethod: - $ref: '#/components/schemas/redirectMethodEnum' - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - redirectFallbackUrl: - nullable: true - type: string - format: uri - description: >- - A fallback url which, if provided, will be used to retry the - - `conferenceRedirect` webhook delivery in case `redirectUrl` fails to - respond. Not - - allowed if `state` is `completed`. - example: >- - https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect - redirectFallbackMethod: - $ref: '#/components/schemas/redirectMethodEnum' - fallbackUsername: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - fallbackPassword: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - conferenceMember: - type: object - properties: - callId: - $ref: '#/components/schemas/callId' - conferenceId: - $ref: '#/components/schemas/conferenceId' - memberUrl: - type: string - format: uri - description: >- - A URL that may be used to retrieve information about or update - - the state of this conference member. This is the URL of this - member's - - [Get Conference - Member](/apis/voice-apis/voice/#tag/Conferences/operation/getConferenceMember) - endpoint - - and [Modify Conference - Member](/apis/voice-apis/voice/#tag/Conferences/operation/updateConferenceMember) - - endpoint. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - mute: - type: boolean - description: >- - Whether or not this member is currently muted. Members who are muted - are still able to hear other participants. - - - If used in a PUT request, updates this member's mute status. Has no - effect if omitted. - example: false - hold: - type: boolean - description: >- - Whether or not this member is currently on hold. Members who are on - hold are not able to hear or speak in the conference. - - - If used in a PUT request, updates this member's hold status. Has no - effect if omitted. - example: false - callIdsToCoach: - nullable: true - type: array - items: - type: string - description: >- - If this member had a value set for `callIdsToCoach` in its - [Conference](/docs/voice/bxml/conference) verb or this list was - added with a previous PUT request to modify the member, this is that - list of calls. - - - If present in a PUT request, modifies the calls that this member is - coaching. Has no effect if omitted. See the documentation for the - [Conference](/docs/voice/bxml/conference) verb for more details - about coaching. - - Note that this will not add the matching calls to the conference; - each call must individually execute a Conference verb to join. - example: - - c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - updateConferenceMember: - type: object - properties: - mute: - type: boolean - description: >- - Whether or not this member is currently muted. Members who are muted - are still able to hear other participants. - - - Updates this member's mute status. Has no effect if omitted. - example: false - hold: - type: boolean - description: >- - Whether or not this member is currently on hold. Members who are on - hold are not able to hear or speak in the conference. - - - Updates this member's hold status. Has no effect if omitted. - example: false - callIdsToCoach: - nullable: true - type: array - items: - type: string - description: >- - If this member had a value set for `callIdsToCoach` in its - [Conference](/docs/voice/bxml/conference) verb or this list was - added with a previous PUT request to modify the member, this is that - list of calls. - - - Modifies the calls that this member is coaching. Has no effect if - omitted. See the documentation for the - [Conference](/docs/voice/bxml/conference) verb for more details - about coaching. - - - Note that this will not add the matching calls to the conference; - each call must individually execute a Conference verb to join. - example: - - c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - conferenceRecordingMetadata: - type: object - properties: - accountId: - $ref: '#/components/schemas/accountId' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - recordingId: - $ref: '#/components/schemas/recordingId' - duration: - $ref: '#/components/schemas/duration' - channels: - $ref: '#/components/schemas/channels' - startTime: - $ref: '#/components/schemas/startTime' - endTime: - $ref: '#/components/schemas/endTime' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - status: - $ref: '#/components/schemas/status' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - recordingName: - $ref: '#/components/schemas/recordingName' - machineDetectionConfiguration: - type: object - description: >- - The machine detection request used to perform machine detection on the - call. Currently, there is an issue where decimal values are not getting - processed correctly. Please use whole number values. We are working to - resolve this issue. Please contact Bandwidth Support if you need more - information. - properties: - mode: - $ref: '#/components/schemas/machineDetectionModeEnum' - detectionTimeout: - nullable: true - type: number - format: double - description: >- - The timeout used for the whole operation, in seconds. If no - - result is determined in this period, a callback with a `timeout` - result - - is sent. - default: 15 - example: 15 - silenceTimeout: - nullable: true - type: number - format: double - description: >- - If no speech is detected in this period, a callback with a 'silence' - result is sent. - default: 10 - example: 10 - speechThreshold: - nullable: true - type: number - format: double - description: >- - When speech has ended and a result couldn't be determined based - - on the audio content itself, this value is used to determine if the - speaker - - is a machine based on the speech duration. If the length of the - speech - - detected is greater than or equal to this threshold, the result will - be - - 'answering-machine'. If the length of speech detected is below this - threshold, - - the result will be 'human'. - default: 10 - example: 10 - speechEndThreshold: - nullable: true - type: number - format: double - description: >- - Amount of silence (in seconds) before assuming the callee has - finished speaking. - default: 5 - example: 5 - machineSpeechEndThreshold: - nullable: true - type: number - format: double - description: >- - When an answering machine is detected, the amount of silence (in - seconds) before assuming the message has finished playing. - - If not provided it will default to the speechEndThreshold value. - example: 5 - delayResult: - nullable: true - type: boolean - description: >- - If set to 'true' and if an answering machine is detected, the - - 'answering-machine' callback will be delayed until the machine is - done - - speaking, or an end of message tone is detected, or until the - 'detectionTimeout' is exceeded. If false, the 'answering-machine' - - result is sent immediately. - default: false - example: false - callbackUrl: - nullable: true - description: >- - The URL to send the 'machineDetectionComplete' webhook when the - detection is completed. Only for 'async' mode. - type: string - format: uri - maxLength: 2048 - example: https://myServer.example/bandwidth/webhooks/machineDetectionComplete - callbackMethod: - $ref: '#/components/schemas/callbackMethodEnum' - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - fallbackUrl: - nullable: true - type: string - format: uri - description: >- - A fallback URL which, if provided, will be used to retry the - - machine detection complete webhook delivery in case `callbackUrl` - fails - - to respond - maxLength: 2048 - example: >- - https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete - fallbackMethod: - $ref: '#/components/schemas/callbackMethodEnum' - fallbackUsername: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - fallbackPassword: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - transcribeRecording: - type: object - properties: - callbackUrl: - type: string - format: uri - description: >- - The URL to send the - [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) - - event to. You should not include sensitive or - personally-identifiable - - information in the callbackUrl field! Always use the proper username - and - - password fields for authorization. - example: https://myServer.example/bandwidth/webhooks/transcriptionAvailable - callbackMethod: - $ref: '#/components/schemas/callbackMethodEnum' - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - tag: - $ref: '#/components/schemas/tag1' - callbackTimeout: - nullable: true - type: number - format: double - minimum: 1 - maximum: 25 - default: 15 - description: >- - This is the timeout (in seconds) to use when delivering the - - webhook to `callbackUrl`. Can be any numeric value (including - decimals) - - between 1 and 25. - example: 5.5 - detectLanguage: - type: boolean - nullable: true - description: >- - A boolean value to indicate that the recording may not be in - English, and the transcription service will need to detect the - dominant language the recording is in and transcribe accordingly. - Current supported languages are English, French, and Spanish. - default: false - example: true - recordingTranscriptions: - type: object - properties: - transcripts: - type: array - items: - $ref: '#/components/schemas/transcription' - callTranscriptionMetadataList: - type: array - items: - $ref: '#/components/schemas/callTranscriptionMetadata' - example: - - transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b - transcriptionName: live_transcription - transcriptionUrl: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b - callTranscriptionMetadata: - type: object - properties: - transcriptionId: - type: string - description: The programmable voice API transcription ID. - example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b - transcriptionName: - type: string - description: >- - The programmable voice API transcription name. This name could be - provided by the user when creating the transcription. - example: live_transcription - transcriptionUrl: - type: string - description: >- - A URL that may be used to retrieve the transcription itself. This - points to the - - [Get Call - Transcription](/apis/voice-apis/voice/#tag/Transcriptions/operation/getRealTimeTranscription) - endpoint. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b - callTranscriptionResponse: - type: object - properties: - accountId: - type: string - description: The user account associated with the call. - example: '9900000' - callId: - type: string - description: The call id associated with the event. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - transcriptionId: - type: string - description: The programmable voice API transcription ID. - example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b - tracks: - type: array - items: - $ref: '#/components/schemas/callTranscription' - example: - - detectedLanguage: en-US - track: inbound - transcript: Hello World! This is an example. - confidence: 0.9 - callTranscription: - type: object - properties: - detectedLanguage: - $ref: '#/components/schemas/callTranscriptionDetectedLanguageEnum' - track: - $ref: '#/components/schemas/callTranscriptionTrackEnum' - transcript: - type: string - description: The transcription itself. - example: Hello World! This is an example. - confidence: - type: number - format: double - minimum: 0 - maximum: 1 - description: >- - How confident the transcription engine was in transcribing the - associated audio (from `0` to `1`). - example: 0.9 - recordingTranscriptionMetadata: - nullable: true - type: object - description: If the recording was transcribed, metadata about the transcription - properties: - id: - type: string - description: The unique transcription ID - example: t-387bd648-18f3-4823-9d16-746bca0003c9 - status: - $ref: '#/components/schemas/status' - completedTime: - type: string - format: date-time - description: The time that the transcription was completed - example: '2022-06-13T18:46:29.715Z' - url: - type: string - format: uri - description: The URL of the [transcription](#operation/getCallTranscription) - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription - voiceApiError: - type: object - properties: - type: - type: string - description: - type: string - id: - nullable: true - type: string - answerCallback: - type: object - description: >- - The Answer event is sent to the answerUrl specified in the createCall - request when an outbound call is answered. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - machineDetectionResult: - $ref: '#/components/schemas/machineDetectionResult' - bridgeCompleteCallback: - type: object - description: >- - If the target call leaves the , then this callback is sent to - the bridgeCompleteUrl, and the BXML returned in it is executed on the - call. If this webhook is sent, the Bridge Target Complete webhook is NOT - sent. This callback is also sent if any problem occurs that prevents the - calls to be bridged. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - cause: - $ref: '#/components/schemas/cause' - errorMessage: - $ref: '#/components/schemas/errorMessage' - errorId: - $ref: '#/components/schemas/errorId' - bridgeTargetCompleteCallback: - type: object - description: >- - If the originating call leaves the , then this callback is sent - to the bridgeTargetCompleteUrl, and the BXML returned in it is executed - on the target call. If this webhook is sent, the Bridge Complete webhook - is NOT sent. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - conferenceCreatedCallback: - type: object - description: >- - The Conference Created event is fired whenever a new conference that - specified a callbackUrl is created. The response may be either empty or - a BXML document. Only the following verbs are valid for conferences: - PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, - ResumeRecording. Audio verbs will be heard by all members of the - conference. Recordings capture audio from all members who are not muted - or on hold, as well as any audio verbs that are played into the - conference. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - tag: - $ref: '#/components/schemas/tag1' - conferenceRedirectCallback: - type: object - description: >- - The Conference Redirect event is fired whenever an existing conference - is modified via a POST request made to the /conferences/{conferenceId} - endpoint. The response may be either empty or a BXML document. Only the - following verbs are valid for conferences: PlayAudio, SpeakSentence, - StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio - verbs will be heard by all members of the conference. Recordings capture - audio from all members who are not muted or on hold, as well as any - audio verbs that are played into the conference. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - tag: - $ref: '#/components/schemas/tag1' - conferenceMemberJoinCallback: - type: object - description: >- - The Conference Member Join event is fired whenever a caller joins a - conference that specified a callbackUrl. The response may be either - empty or a BXML document. Only the following verbs are valid for - conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, - PauseRecording, ResumeRecording. Audio verbs will be heard by all - members of the conference. Recordings capture audio from all members who - are not muted or on hold, as well as any audio verbs that are played - into the conference. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - callId: - $ref: '#/components/schemas/callId' - tag: - $ref: '#/components/schemas/tag1' - conferenceMemberExitCallback: - type: object - description: >- - The Conference Member Exit event is fired whenever a caller exits a - conference that specified a callbackUrl. The response may be either - empty or a BXML document. Only the following verbs are valid for - conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, - PauseRecording, ResumeRecording. Audio verbs will be heard by all - members of the conference. Recordings capture audio from all members who - are not muted or on hold, as well as any audio verbs that are played - into the conference. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - callId: - $ref: '#/components/schemas/callId' - tag: - $ref: '#/components/schemas/tag1' - conferenceCompletedCallback: - type: object - description: >- - The Conference Completed event is fired when the last member leaves the - conference. The response to this event may not contain BXML. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - tag: - $ref: '#/components/schemas/tag1' - conferenceRecordingAvailableCallback: - type: object - description: >- - The Conference Recording Available event is sent after a conference - recording has been processed. It indicates that the recording is - available for download. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - accountId: - $ref: '#/components/schemas/accountId' - recordingId: - $ref: '#/components/schemas/recordingId' - channels: - $ref: '#/components/schemas/channels' - startTime: - $ref: '#/components/schemas/startTime' - endTime: - $ref: '#/components/schemas/endTime' - duration: - $ref: '#/components/schemas/duration' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - tag: - $ref: '#/components/schemas/tag1' - status: - $ref: '#/components/schemas/status' - disconnectCallback: - type: object - description: The Disconnect event is fired when a call ends, for any reason. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - callId: - $ref: '#/components/schemas/callId' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - endTime: - $ref: '#/components/schemas/endTime' - cause: - $ref: '#/components/schemas/cause' - errorMessage: - $ref: '#/components/schemas/errorMessage' - errorId: - $ref: '#/components/schemas/errorId' - tag: - $ref: '#/components/schemas/tag1' - dtmfCallback: - type: object - description: >- - The DTMF event is sent for every digit detected after a - verb is executed. You may not respond to this event with BXML. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - callId: - $ref: '#/components/schemas/callId' - direction: - $ref: '#/components/schemas/callDirectionEnum' - digit: - $ref: '#/components/schemas/digit' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - parentCallId: - $ref: '#/components/schemas/parentCallId' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - tag: - $ref: '#/components/schemas/tag1' - gatherCallback: - type: object - description: >- - The gather event is sent after a verb is executed. Its purpose - is to report the gathered digits to the calling application. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - digits: - $ref: '#/components/schemas/digits' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - parentCallId: - $ref: '#/components/schemas/parentCallId' - terminatingDigit: - $ref: '#/components/schemas/terminatingDigit' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - tag: - $ref: '#/components/schemas/tag1' - initiateCallback: - type: object - description: >- - The Initiate event is fired when an inbound call is received for a - Telephone Number on your Account. It is sent to the URL specified in the - application associated with the location (sip-peer) that the called - telephone number belongs to. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - startTime: - $ref: '#/components/schemas/startTime' - diversion: - $ref: '#/components/schemas/diversion' - stirShaken: - $ref: '#/components/schemas/stirShaken' - uui: - $ref: '#/components/schemas/uui' - machineDetectionCompleteCallback: - type: object - description: >- - This event is sent to the url informed when requesting a machine - detection operation. It contains the machine detection operation result, - which can be: human, answering-machine, silence, timeout, error. This - event is not sent when sync answering machine detection mode is chosen. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - machineDetectionResult: - $ref: '#/components/schemas/machineDetectionResult' - recordingCompleteCallback: - type: object - description: >- - The Record Complete event is sent after a verb has executed if - the call is still active. The BXML returned by this callback is executed - next. When the recording is available for download, a Recording - Available event will be sent. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - parentCallId: - $ref: '#/components/schemas/parentCallId' - recordingId: - $ref: '#/components/schemas/recordingId' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - endTime: - $ref: '#/components/schemas/endTime' - duration: - $ref: '#/components/schemas/duration' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - channels: - $ref: '#/components/schemas/channels' - tag: - $ref: '#/components/schemas/tag1' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - recordingAvailableCallback: - type: object - description: >- - The Recording Available event is sent after a recording has been - processed. It indicates that the recording is available for download. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - parentCallId: - $ref: '#/components/schemas/parentCallId' - recordingId: - $ref: '#/components/schemas/recordingId' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - endTime: - $ref: '#/components/schemas/endTime' - duration: - $ref: '#/components/schemas/duration' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - channels: - $ref: '#/components/schemas/channels' - tag: - $ref: '#/components/schemas/tag1' - status: - $ref: '#/components/schemas/status' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - redirectCallback: - type: object - description: >- - The Redirect event is fired when a verb is executed. Its - purpose is to get the next set of verbs from the calling application. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - parentCallId: - $ref: '#/components/schemas/parentCallId' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - transcriptionAvailableCallback: - type: object - description: >- - The Transcription Available event is sent when the recording - transcription is available to be downloaded. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - parentCallId: - $ref: '#/components/schemas/parentCallId' - recordingId: - $ref: '#/components/schemas/recordingId' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - endTime: - $ref: '#/components/schemas/endTime' - duration: - $ref: '#/components/schemas/duration' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - tag: - $ref: '#/components/schemas/tag1' - transcription: - $ref: '#/components/schemas/transcription' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - transferAnswerCallback: - type: object - description: >- - When processing a verb, this event is sent when a called - party (B-leg) answers. The event is sent to the endpoint specified in - the transferAnswerUrl attribute of the tag that answered. - BXML returned by this callback will be executed for the called party - only. After all BXML has been executed, the called party will be bridged - to the original call. Most BXML verbs are allowed in response to a - transferAnswer event, but some are not allowed. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - transferCompleteCallback: - type: object - description: >- - This event is sent to the transferCompleteUrl of the A-leg's - verb when the transferred call (B-leg) completes. In a simultaneous - ringing scenario, only one B-leg succeeds and this event corresponds to - that successful leg. If none of the calls were answered, the - transferComplete event corresponds to one of the legs. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - cause: - $ref: '#/components/schemas/cause' - errorMessage: - $ref: '#/components/schemas/errorMessage' - errorId: - $ref: '#/components/schemas/errorId' - transferDisconnectCallback: - type: object - description: >- - This event is sent to the transferDisconnectUrl of each - tag when its respective call leg ends for any reason. The event is sent - in the normal case, when the transferred leg is answered and later hung - up, but is also sent if the new leg was never answered in the first - place, if it was rejected, and if the original call leg hung up before - the transferred leg. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - parentCallId: - $ref: '#/components/schemas/parentCallId' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - endTime: - $ref: '#/components/schemas/endTime' - tag: - $ref: '#/components/schemas/tag1' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - cause: - $ref: '#/components/schemas/cause' - errorMessage: - $ref: '#/components/schemas/errorMessage' - errorId: - $ref: '#/components/schemas/errorId' - eventType: - type: string - description: >- - The event type, value can be one of the following: answer, - bridgeComplete, bridgeTargetComplete, conferenceCreated, - conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, - conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, - gather, initiate, machineDetectionComplete, recordingComplete, - recordingAvailable, redirect, transcriptionAvailable, transferAnswer, - transferComplete, transferDisconnect. - example: bridgeComplete - eventTime: - type: string - format: date-time - description: >- - The approximate UTC date and time when the event was generated by the - Bandwidth server, in ISO 8601 format. This may not be exactly the time - of event execution. - example: '2022-06-17T22:19:40.375Z' - accountId: - type: string - description: The user account associated with the call. - example: '9900000' - applicationId1: - type: string - description: The id of the application associated with the call. - example: 04e88489-df02-4e34-a0ee-27a91849555f - to: - type: string - description: >- - The phone number that received the call, in E.164 format (e.g. - +15555555555). - example: '+15555555555' - from: - type: string - description: >- - The provided identifier of the caller. Must be a phone number in E.164 - format (e.g. +15555555555). - example: '+15555555555' - conferenceId: - type: string - description: The unique, Bandwidth-generated ID of the conference that was recorded - example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 - name: - type: string - description: The user-specified name of the conference that was recorded - example: my-conference-name - recordingId: - type: string - description: The unique ID of this recording - example: r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833 - duration: - type: string - description: The duration of the recording in ISO-8601 format - example: PT13.67S - channels: - type: integer - format: int32 - description: >- - Always `1` for conference recordings; multi-channel recordings are not - supported on conferences. - example: 1 - digit: - type: string - description: The digit collected in the call. - example: '2' - digits: - type: string - description: >- - (optional) The digits, letters, and/or symbols entered by the user. The - string is empty if a timeout occurred before any buttons were pressed. - example: '123' - terminatingDigit: - type: string - description: >- - (optional) The digit the user pressed to end the gather. Empty string - value if no terminating digit was pressed. - example: '#' - startTime: - type: string - format: date-time - description: Time the call was started, in ISO 8601 format. - example: '2022-06-17T22:19:40.375Z' - enqueuedTime: - type: string - format: date-time - description: >- - (optional) If call queueing is enabled and this is an outbound call, - time the call was queued, in ISO 8601 format. - example: '2022-06-17T22:20:00.000Z' - nullable: true - answerTime: - type: string - format: date-time - description: Time the call was answered, in ISO 8601 format. - example: '2022-06-17T22:20:00.000Z' - nullable: true - endTime: - type: string - format: date-time - description: The time that the recording ended in ISO-8601 format - example: '2022-06-17T22:20:00.000Z' - status: - type: string - description: >- - The current status of the process. For recording, current possible - values are 'processing', 'partial', 'complete', 'deleted', and 'error'. - For transcriptions, current possible values are 'none', 'processing', - 'available', 'error', 'timeout', 'file-size-too-big', and - 'file-size-too-small'. Additional states may be added in the future, so - your application must be tolerant of unknown values. - example: completed - transferCallerId: - type: string - description: >- - The phone number used as the from field of the B-leg call, in E.164 - format (e.g. +15555555555). - example: '+15555555555' - transferTo: - type: string - description: >- - The phone number used as the to field of the B-leg call, in E.164 format - (e.g. +15555555555). - example: '+15555555555' - mediaUrl: - nullable: true - type: string - format: uri - description: >- - The URL that can be used to download the recording. Only present if the - recording is finished and may be downloaded. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media - callId: - type: string - description: The call id associated with the event. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - recordingName: - type: string - description: A name to identify this recording. - example: my-recording-name - callUrl: - type: string - format: uri - description: The URL of the call associated with the event. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - parentCallId: - type: string - description: >- - (optional) If the event is related to the B leg of a , the - call id of the original call leg that executed the . - Otherwise, this field will not be present. - example: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d - tag1: - type: string - description: >- - (optional) The tag specified on call creation. If no tag was specified - or it was previously cleared, this field will not be present. - example: exampleTag - nullable: true - cause: - type: string - description: >- - Reason the call failed - hangup, busy, timeout, cancel, rejected, - callback-error, invalid-bxml, application-error, account-limit, - node-capacity-exceeded, error, or unknown. - example: busy - errorMessage: - type: string - description: >- - Text explaining the reason that caused the call to fail in case of - errors. - example: >- - Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged - with another call - nullable: true - errorId: - type: string - description: Bandwidth's internal id that references the error event. - example: 4642074b-7b58-478b-96e4-3a60955c6765 - nullable: true - machineDetectionResult: - type: object - description: >- - (optional) if machine detection was requested in sync mode, the result - will be specified here. Possible values are the same as the async - counterpart: Machine Detection Complete - properties: - value: - type: string - description: >- - Possible values are answering-machine, human, silence, timeout, or - error. - example: answering-machine - duration: - type: string - description: The amount of time it took to determine the result. - example: PT4.9891287S - nullable: true - diversion: - type: object - properties: - reason: - type: string - description: >- - The reason for the diversion. Common values: unknown, user-busy, - no-answer, unavailable, unconditional, time-of-day, do-not-disturb, - deflection, follow-me, out-of-service, away. - example: unavailable - privacy: - type: string - description: off or full - example: 'off' - screen: - type: string - description: >- - No if the number was provided by the user, yes if the number was - provided by the network - example: 'no' - counter: - type: string - description: The number of diversions that have occurred - example: '2' - limit: - type: string - description: The maximum number of diversions allowed for this session - example: '3' - unknown: - type: string - description: >- - The normal list of values is not exhaustive. Your application must - be tolerant of unlisted keys and unlisted values of those keys. - example: unknownValue - origTo: - type: string - description: >- - Always present. Indicates the last telephone number that the call - was diverted from. - example: '+15558884444' - transcription: - type: object - properties: - text: - type: string - description: The transcribed text - example: Nice talking to you, friend! - confidence: - type: number - format: double - description: >- - The confidence on the recognized content, ranging from `0.0` to - `1.0` with `1.0` being the highest confidence. - example: 0.9 - stirShaken: - type: object - properties: - verstat: - type: string - description: >- - (optional) The verification status indicating whether the - verification was successful or not. Possible values are - TN-Validation-Passed and TN-Validation-Failed. - example: Tn-Validation-Passed - attestationIndicator: - type: string - description: >- - (optional) The attestation level verified by Bandwidth. Possible - values are A (full), B (partial) or C (gateway). - example: A - originatingId: - type: string - description: (optional) A unique origination identifier. - example: 99759086-1335-11ed-9bcf-5f7d464e91af - uui: - type: string - description: >- - The value of the `User-To-User` header to send within the initial - `INVITE`. Must include the encoding parameter as specified in RFC 7433. - Only `base64`, `jwt` and `hex` encoding are currently allowed. This - value, including the encoding specifier, may not exceed 256 characters. - example: bXktdXVp - maxLength: 256 - codeRequest: - type: object - properties: - to: - type: string - description: The phone number to send the mfa code to. - pattern: ^\+[1-9]\d{1,14}$ - example: '+19195551234' - from: - type: string - description: The application phone number, the sender of the mfa code. - pattern: ^\+[1-9]\d{1,14}$ - maxLength: 32 - example: '+19195554321' - applicationId: - type: string - description: The application unique ID, obtained from Bandwidth. - maxLength: 50 - example: 66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1 - scope: - type: string - description: >- - An optional field to denote what scope or action the mfa code is - addressing. If not supplied, defaults to "2FA". - maxLength: 25 - example: 2FA - message: - type: string - description: >- - The message format of the mfa code. There are three values that the - system will replace "{CODE}", "{NAME}", "{SCOPE}". The "{SCOPE}" - and "{NAME} value template are optional, while "{CODE}" must be - supplied. As the name would suggest, code will be replace with the - actual mfa code. Name is replaced with the application name, - configured during provisioning of mfa. The scope value is the same - value sent during the call and partitioned by the server. - maxLength: 2048 - example: Your temporary {NAME} {SCOPE} code is {CODE} - digits: - type: integer - description: >- - The number of digits for your mfa code. The valid number ranges - from 2 to 8, inclusively. - minimum: 4 - maximum: 8 - example: 6 - required: - - to - - from - - applicationId - - message - - digits - voiceCodeResponse: - type: object - properties: - callId: - type: string - description: Programmable Voice API Call ID. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - messagingCodeResponse: - type: object - properties: - messageId: - type: string - description: Messaging API Message ID. - example: 1589228074636lm4k2je7j7jklbn2 - verifyCodeRequest: - type: object - properties: - to: - type: string - description: The phone number to send the mfa code to. - pattern: ^\+[1-9]\d{1,14}$ - example: '+19195551234' - scope: - type: string - description: >- - An optional field to denote what scope or action the mfa code is - addressing. If not supplied, defaults to "2FA". - example: 2FA - expirationTimeInMinutes: - type: number - description: >- - The time period, in minutes, to validate the mfa code. By setting - this to 3 minutes, it will mean any code generated within the last 3 - minutes are still valid. The valid range for expiration time is - between 0 and 15 minutes, exclusively and inclusively, respectively. - minimum: 1 - maximum: 15 - example: 3 - code: - type: string - description: The generated mfa code to check if valid. - minLength: 4 - maxLength: 8 - example: '123456' - required: - - to - - expirationTimeInMinutes - - code - verifyCodeResponse: - type: object - properties: - valid: - type: boolean - description: Whether or not the supplied code is valid. - example: true - mfaRequestError: - type: object - properties: - error: - type: string - description: A message describing the error with your request. - example: 400 Request is malformed or invalid - requestId: - type: string - description: The associated requestId from AWS. - example: 354cc8a3-6701-461e-8fa7-8671703dd898 - mfaUnauthorizedRequestError: - type: object - properties: - message: - type: string - description: Unauthorized - example: Unauthorized - mfaForbiddenRequestError: - type: object - properties: - message: - type: string - description: >- - The message containing the reason behind the request being - forbidden. - example: Missing Authentication Token - completedLookupStatusEnum: - type: string - enum: - - COMPLETE - - PARTIAL_COMPLETE - - FAILED - example: COMPLETE - inProgressLookupStatusEnum: - type: string - enum: - - IN_PROGRESS - - COMPLETE - - PARTIAL_COMPLETE - - FAILED - example: COMPLETE - deactivationEventEnum: - type: string - description: > - [DNI-Only](#section/DNI-Only). - - `DEACTIVATED` if the carrier reported a deactivation event for this - phone number. - enum: - - DEACTIVATED - latestMessageDeliveryStatusEnum: - type: string - description: >- - [DNI-Only](#section/DNI-Only). The current delivery status of the phone - number. - - - ACTIVE: A message was successfully sent to the number (delivery code - 0). - - - DEACTIVATED: A message was not delivered to a number (delivery code - 720) - - - UNKNOWN: Bandwidth cannot find an delivery status entry for the - number. - enum: - - ACTIVE - - DEACTIVATED - - UNKNOWN - lineTypeEnum: - type: string - enum: - - FIXED - - VOIP-FIXED - - MOBILE - - VOIP - example: MOBILE - requestId: - type: string - format: uuid - description: The phone number lookup request ID from Bandwidth. - example: 004223a0-8b17-41b1-bf81-20732adf5590 - linkSchema: - title: Link - type: object - properties: - href: - type: string - description: URI of the link. - example: /relative/uri - rel: - type: string - description: Specifies the relationship between this link and the resource. - example: aRelatedResource - method: - type: string - description: HTTP method to be used. - example: GET - lookupErrorSchema: - type: object - properties: - code: - type: string - description: Validation error code - example: NO-MATCH - description: - type: string - description: Description of validation error - example: Example error description - type: - type: string - description: Type of validation error - example: NumberInventory - meta: - type: object - properties: - phoneNumbers: - type: array - items: - type: string - description: Phone number experiencing the error. - example: - - '+13992077164' - - '+19196104424' - message: - type: string - description: Message describing the error - example: Invalid TNs - code: - type: integer - description: Error code associated with the message - example: 1001 - syncLookupRequest: - type: object - properties: - phoneNumbers: - description: Telephone numbers in E.164 format. - type: array - minimum: 1 - maximum: 100 - items: - type: string - pattern: ^\+[1-9]\d{1,14}$ - required: - - phoneNumbers - asyncLookupRequest: - type: object - properties: - phoneNumbers: - description: Telephone numbers in E.164 format. - type: array - minimum: 1 - maximum: 15000 - items: - type: string - pattern: ^\+[1-9]\d{1,14}$ - required: - - phoneNumbers - createSyncLookupResponse: - type: object - properties: - links: - type: array - items: - $ref: '#/components/schemas/linkSchema' - example: [] - data: - type: object - description: The phone number lookup response data - properties: - requestId: - $ref: '#/components/schemas/requestId' - status: - $ref: '#/components/schemas/completedLookupStatusEnum' - results: - type: array - description: >- - The carrier information results for the specified telephone - numbers. - items: - $ref: '#/components/schemas/lookupResult' - errors: - type: array - items: - $ref: '#/components/schemas/lookupErrorSchema' - createAsyncBulkLookupResponse: - type: object - properties: - links: - type: array - description: Links for pagination (if applicable) - items: - $ref: '#/components/schemas/linkSchema' - data: - type: object - description: The phone number lookup response data - properties: - requestId: - $ref: '#/components/schemas/requestId' - status: - $ref: '#/components/schemas/inProgressLookupStatusEnum' - errors: - type: array - items: - $ref: '#/components/schemas/lookupErrorSchema' - getAsyncBulkLookupResponse: - type: object - properties: - links: - type: array - items: - $ref: '#/components/schemas/linkSchema' - example: [] - data: - type: object - description: The phone number lookup response data - properties: - requestId: - $ref: '#/components/schemas/requestId' - status: - $ref: '#/components/schemas/inProgressLookupStatusEnum' - results: - type: array - description: >- - The carrier information results for the specified telephone - number. - items: - $ref: '#/components/schemas/lookupResult' - errors: - type: array - items: - $ref: '#/components/schemas/lookupErrorSchema' - lookupErrorResponse: - type: object - properties: - links: - type: array - items: - $ref: '#/components/schemas/linkSchema' - example: [] - data: - type: object - description: The phone number lookup response data - errors: - type: array - items: - $ref: '#/components/schemas/lookupErrorSchema' - lookupResult: - type: object - description: Carrier information results for the specified telephone number. - properties: - phoneNumber: - type: string - description: The telephone number in E.164 format. - example: '+10072904498' - lineType: - $ref: '#/components/schemas/lineTypeEnum' - messagingProvider: - type: string - description: The messaging service provider of the telephone number. - example: Verizon Wireless - voiceProvider: - type: string - description: The voice service provider of the telephone number. - example: Verizon Wireless - countryCodeA3: - type: string - description: >- - The country code of the telephone number in ISO 3166-1 alpha-3 - format. - example: USA - deactivationReporter: - type: string - description: > - [DNI-Only](#section/DNI-Only). - - The carrier that reported a deactivation event for this phone - number. - deactivationDate: - type: string - format: date-time-local - description: >- - [DNI-Only](#section/DNI-Only). The datetime the carrier reported a - deactivation event. - example: 2025-06-20 18:35 - deactivationEvent: - $ref: '#/components/schemas/deactivationEventEnum' - latestMessageDeliveryStatus: - $ref: '#/components/schemas/latestMessageDeliveryStatusEnum' - initialMessageDeliveryStatusDate: - type: string - format: date - description: >- - [DNI-Only](#section/DNI-Only). The date the phone number entered the - status described in `latestMessageDeliveryStatus`. - - Think of this as the "start time" for that status. - - Value resets every time the `latestMessageDeliveryStatus` changes. - example: '2025-06-20' - latestMessageDeliveryStatusDate: - type: string - format: date - description: >- - [DNI-Only](#section/DNI-Only). The date bandwidth last received - delivery status information for this phone number. - - Use this field to understand how up-to-date the - `latestMessageDeliveryStatus` is. - - Value resets every time the `latestMessageDeliveryStatus` changes. - example: '2025-06-21' - accountId1: - type: string - description: User's account ID. - example: '1234567' - tfPhoneNumber: - type: string - description: Toll-free telephone number in E.164 format. - minLength: 12 - maxLength: 12 - nullable: false - pattern: ^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$ - example: '+18005555555' - tfvWebhookErrors: - type: array - description: Details of the errors that were encountered when processing the request. - items: - type: string - example: 'optInWorkflowImageURLs: Entries must be a valid array of objects.' - tfvCallbackStatusEnum: - type: string - enum: - - VERIFIED - - UNVERIFIED - example: VERIFIED - tfvUnverifiedStatus: - type: string - default: UNVERIFIED - example: UNVERIFIED - declineReasonDescription: - type: string - description: Explanation for why a verification request was declined. - nullable: false - example: >- - Invalid Information - Can't Validate URL - Website is not accessible / - not available - denialStatusCode: - description: Reason code for denial. - type: integer - example: 511 - resubmitAllowed: - description: >- - Whether a Toll-Free Verification request qualifies for resubmission via - PUT. - example: true - type: boolean - blocked: - description: >- - Whether a Toll-Free Verification is blocked. This attribute will only be - defined when the number is blocked. - example: true - type: boolean - blockedReason: - description: >- - The reason why the Toll-Free Verification is blocked. This attribute - will only be defined when the number is blocked. - example: Toll-free number was used to send spam messages - type: string - privacyPolicyUrl: - description: The Toll-Free Verification request privacy policy URL. - example: http://your-company.com/privacyPolicy - type: string - termsAndConditionsUrl: - description: The Toll-Free Verification request terms and conditions policy URL. - example: http://your-company.com/termsAndConditions - type: string - businessDba: - description: The company 'Doing Business As'. - example: Another Company Name Inc. - type: string - businessRegistrationNumber: - type: string - description: >- - US Federal Tax ID Number (EIN) or Canada Business Number (CBN). Optional - until early 2026. If a value is provided for this field, a value must be - provided for `businessRegistrationType` and `businessEntityType`. - Available starting October 1st, 2025. - nullable: true - maxLength: 500 - example: 12-3456789 - businessRegistrationTypeEnum: - type: string - description: >- - The type of business registration number. Optional until early 2026; - required if `businessRegistrationNumber` is provided. Available starting - October 1st, 2025. - enum: - - EIN - - CBN - nullable: true - businessEntityTypeEnum: - type: string - description: >- - The type of registered business. If no option is applicable, please - provide "SOLE_PROPRIETOR" as a value. Optional until early 2026; - required if `businessRegistrationNumber` is provided. Available starting - October 1st, 2025. - enum: - - SOLE_PROPRIETOR - - PRIVATE_PROFIT - - PUBLIC_PROFIT - - NON_PROFIT - - GOVERNMENT - nullable: true - helpMessageResponse: - type: string - description: A message that gets sent to users requesting help. - nullable: true - maxLength: 500 - example: Please contact support for assistance. - ageGatedContent: - type: boolean - description: Indicates whether the content is age-gated. - example: false - additionalDenialReason: - properties: - statusCode: - $ref: '#/components/schemas/denialStatusCode' - reason: - $ref: '#/components/schemas/declineReasonDescription' - resubmitAllowed: - $ref: '#/components/schemas/resubmitAllowed' - required: - - statusCode - - reason - - resubmitAllowed - type: object - internalTicketNumber: - type: string - format: uuid - description: >- - Unique identifier (UUID) generated by Bandwidth to assist in tracking - the verification status of a toll-free number - included in all webhook - payloads. - example: acde070d-8c4c-4f0d-9d8a-162843c10333 - internalTicketNumberForWebhook: - type: string - format: uuid - description: >- - Unique identifier (UUID) generated by Bandwidth to assist in tracking - the verification status of a toll-free number. - example: acde070d-8c4c-4f0d-9d8a-162843c10333 - businessContactPhoneNumber: - description: Contact telephone number - type: string - minLength: 1 - maxLength: 500 - nullable: false - example: '+19192654500' - verificationRequest: - type: object - required: - - businessAddress - - businessContact - - messageVolume - - phoneNumbers - - useCase - - useCaseSummary - - productionMessageContent - - optInWorkflow - properties: - businessAddress: - $ref: '#/components/schemas/address' - businessContact: - $ref: '#/components/schemas/contact' - messageVolume: - type: integer - description: Estimated monthly volume of messages from the toll-free number. - minimum: 10 - maximum: 10000000 - example: 10000 - phoneNumbers: - type: array - minItems: 1 - maxItems: 10 - items: - $ref: '#/components/schemas/tfPhoneNumber' - useCase: - $ref: '#/components/schemas/useCase' - useCaseSummary: - $ref: '#/components/schemas/useCaseSummary' - productionMessageContent: - $ref: '#/components/schemas/productionMessageContent' - optInWorkflow: - $ref: '#/components/schemas/optInWorkflow' - additionalInformation: - type: string - description: Any additional information. - minLength: 0 - maxLength: 500 - nullable: true - example: Any additional information - isvReseller: - $ref: '#/components/schemas/isvReseller' - privacyPolicyUrl: - $ref: '#/components/schemas/privacyPolicyUrl' - termsAndConditionsUrl: - $ref: '#/components/schemas/termsAndConditionsUrl' - businessDba: - $ref: '#/components/schemas/businessDba' - businessRegistrationNumber: - $ref: '#/components/schemas/businessRegistrationNumber' - businessRegistrationType: - $ref: '#/components/schemas/businessRegistrationTypeEnum' - businessEntityType: - $ref: '#/components/schemas/businessEntityTypeEnum' - helpMessageResponse: - $ref: '#/components/schemas/helpMessageResponse' - ageGatedContent: - $ref: '#/components/schemas/ageGatedContent' - verificationUpdateRequest: - type: object - required: - - businessAddress - - businessContact - - messageVolume - - useCase - - useCaseSummary - - productionMessageContent - - optInWorkflow - properties: - businessAddress: - $ref: '#/components/schemas/address' - businessContact: - $ref: '#/components/schemas/contact' - messageVolume: - type: integer - description: Estimated monthly volume of messages from the toll-free number. - minimum: 10 - maximum: 10000000 - example: 10000 - useCase: - $ref: '#/components/schemas/useCase' - useCaseSummary: - $ref: '#/components/schemas/useCaseSummary' - productionMessageContent: - $ref: '#/components/schemas/productionMessageContent' - optInWorkflow: - $ref: '#/components/schemas/optInWorkflow' - additionalInformation: - $ref: '#/components/schemas/additionalInformation' - isvReseller: - $ref: '#/components/schemas/isvReseller' - privacyPolicyUrl: - $ref: '#/components/schemas/privacyPolicyUrl' - termsAndConditionsUrl: - $ref: '#/components/schemas/termsAndConditionsUrl' - businessDba: - $ref: '#/components/schemas/businessDba' - businessRegistrationNumber: - $ref: '#/components/schemas/businessRegistrationNumber' - businessRegistrationType: - $ref: '#/components/schemas/businessRegistrationTypeEnum' - businessEntityType: - $ref: '#/components/schemas/businessEntityTypeEnum' - helpMessageResponse: - $ref: '#/components/schemas/helpMessageResponse' - ageGatedContent: - $ref: '#/components/schemas/ageGatedContent' - tfvBasicAuthentication: - type: object - properties: - username: - type: string - maxLength: 100 - example: username - password: - type: string - maxLength: 200 - example: password - required: - - username - - password - webhookSubscriptionRequestSchema: - type: object - properties: - basicAuthentication: - $ref: '#/components/schemas/tfvBasicAuthentication' - callbackUrl: - $ref: '#/components/schemas/webhookUrl' - sharedSecretKey: - $ref: '#/components/schemas/sharedSecretKey' - required: - - callbackUrl - failureWebhook: - type: object - properties: - accountId: - $ref: '#/components/schemas/accountId1' - phoneNumber: - $ref: '#/components/schemas/tfPhoneNumber' - errorCode: - type: string - description: >- - An error code indicating what error was encountered. This code can - be interpreted as an HTTP status code in regards to the error that - was encountered. - example: '400' - errorMessage: - type: string - description: A description of the error that was encountered. - example: cannot process request. - errors: - $ref: '#/components/schemas/tfvWebhookErrors' - internalTicketNumber: - $ref: '#/components/schemas/internalTicketNumberForWebhook' - verificationDenialWebhook: - type: object - properties: - accountId: - $ref: '#/components/schemas/accountId1' - additionalDenialReasons: - description: >- - An optional list of denial reasons in addition to - declineReasonDescription when multiple reasons apply. - items: - $ref: '#/components/schemas/additionalDenialReason' - example: - - statusCode: 512 - reason: Reason A - resubmitAllowed: true - - statusCode: 513 - reason: Reason B - resubmitAllowed: true - type: array - declineReasonDescription: - $ref: '#/components/schemas/declineReasonDescription' - denialStatusCode: - $ref: '#/components/schemas/denialStatusCode' - internalTicketNumber: - $ref: '#/components/schemas/internalTicketNumberForWebhook' - phoneNumber: - $ref: '#/components/schemas/tfPhoneNumber' - resubmitAllowed: - $ref: '#/components/schemas/resubmitAllowed' - status: - $ref: '#/components/schemas/tfvUnverifiedStatus' - blocked: - $ref: '#/components/schemas/blocked' - blockedReason: - $ref: '#/components/schemas/blockedReason' - verificationWebhook: - type: object - properties: - accountId: - $ref: '#/components/schemas/accountId1' - phoneNumber: - $ref: '#/components/schemas/tfPhoneNumber' - status: - $ref: '#/components/schemas/tfvCallbackStatusEnum' - internalTicketNumber: - $ref: '#/components/schemas/internalTicketNumberForWebhook' - blockedWebhook: - type: object - properties: - accountId: - $ref: '#/components/schemas/accountId1' - phoneNumber: - $ref: '#/components/schemas/tfPhoneNumber' - status: - $ref: '#/components/schemas/tfvCallbackStatusEnum' - internalTicketNumber: - $ref: '#/components/schemas/internalTicketNumberForWebhook' - blocked: - $ref: '#/components/schemas/blocked' - blockedReason: - $ref: '#/components/schemas/blockedReason' - tfvSubmissionWrapper: - type: object - properties: - submission: - $ref: '#/components/schemas/verificationUpdateRequest' - address: - type: object - nullable: false - required: - - name - - addr1 - - city - - state - - zip - - url - properties: - name: - type: string - description: The name of the business using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: Bandwidth Inc. - addr1: - type: string - description: The address of the business using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: 2230 Bandmate Way - addr2: - type: string - description: The address of the business using the toll-free number. - minLength: 0 - maxLength: 500 - nullable: true - example: 2230 Bandmate Way - city: - type: string - description: The city of the business using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: Raleigh - state: - type: string - description: The state of the business using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: NC - zip: - type: string - description: The zip of the business using the toll-free number. - nullable: false - example: '27606' - pattern: '[- A-Za-z0-9]{0,500}' - url: - type: string - format: url - description: The website of the business using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: https://www.example.com/path/to/resource - additionalInformation: - type: string - description: Any additional information. - minLength: 0 - maxLength: 500 - nullable: true - example: Any additional information - optInWorkflow: - type: object - nullable: false - required: - - description - - imageUrls - properties: - description: - type: string - minLength: 1 - maxLength: 500 - nullable: false - example: Opt In Flow - imageUrls: - type: array - items: - type: string - minLength: 1 - maxLength: 500 - nullable: false - example: https://www.example.com/path/to/resource - pattern: >- - ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) - confirmationResponse: - type: string - minLength: 0 - maxLength: 500 - nullable: true - example: Thank you for opting in! - isvReseller: - type: string - description: ISV name. - minLength: 0 - maxLength: 500 - nullable: true - example: Test ISV - contact: - type: object - nullable: false - required: - - firstName - - lastName - - email - - phoneNumber - properties: - firstName: - type: string - description: The first name of the business contact using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: John - lastName: - type: string - description: The last name of the business contact using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: Doe - email: - $ref: '#/components/schemas/email' - phoneNumber: - $ref: '#/components/schemas/businessContactPhoneNumber' - email: - type: string - format: email - minLength: 0 - maxLength: 500 - nullable: false - pattern: >- - ^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$ - example: foo@bar.com - useCases: - type: array - items: - type: string - example: - - 2FA - - App Notifications - - Appointments - - Auctions - - Auto Repair Services - - Bank Transfers - - Billing - - Booking Confirmations - - Business Updates - - COVID-19 Alerts - useCase: - type: string - description: The category of the use case. - minLength: 0 - maxLength: 500 - example: 2FA - useCaseSummary: - type: string - description: A general idea of the use case and customer. - minLength: 0 - maxLength: 500 - nullable: false - example: Text summarizing the use case for the toll-free number - productionMessageContent: - type: string - description: Example of message content. - minLength: 0 - maxLength: 500 - nullable: false - example: Production message content - webhookSubscriptionsListBody: - description: >- - A list of all webhook subscriptions registered for this account ID for - this particular feature (unpaginated). - type: object - required: - - data - properties: - links: - $ref: '#/components/schemas/linksObject' - errors: - type: array - items: - $ref: '#/components/schemas/error' - data: - items: - $ref: '#/components/schemas/webhookSubscription' - type: array - linksObject: - type: object - properties: - first: - description: The first (or only) page of results matching the query. - type: string - next: - description: >- - If more results exist than specified by 'size', this link returns - the next page of 'size' results. - type: string - previous: - description: >- - If the results are more than one page, this link returns the - previous page of 'size' results. - type: string - last: - description: >- - If more results exist than specified by 'size', this link return the - last page of result. - type: string - error: - type: object - properties: - code: - type: integer - description: - type: string - telephoneNumbers: - type: array - items: - $ref: '#/components/schemas/telephoneNumber' - telephoneNumber: - type: object - properties: - telephoneNumber: - description: Simple Telephone Number. - type: string - webhookSubscriptionTypeEnum: - type: string - enum: - - TOLLFREE_VERIFICATION_STATUS - - MESSAGING_PORTOUT_APPROVAL_STATUS - example: TOLLFREE_VERIFICATION_STATUS - webhookSubscription: - description: >- - Information about a webhook that Bandwidth should send upon the - completion of event customer has subscribed to. - type: object - required: - - callbackUrl - properties: - id: - type: string - example: 7hICGStfAfeGxEq3N0lQwO - accountId: - type: string - example: '1234567' - callbackUrl: - $ref: '#/components/schemas/webhookUrl' - type: - $ref: '#/components/schemas/webhookSubscriptionTypeEnum' - basicAuthentication: - description: >- - Basic authentication credentials are not required, but if present, - both username and password must be provided. - type: object - required: - - username - - password - properties: - username: - type: string - maxLength: 100 - password: - type: string - maxLength: 200 - createdDate: - type: string - format: date-time - example: '2023-05-15T13:56:39.965Z' - modifiedDate: - type: string - format: date-time - example: '2023-05-15T13:56:39.965Z' - webhookUrl: - description: >- - Callback URL to receive status updates from Bandwidth. When a webhook - subscription is registered with Bandwidth under a given account ID, it - will be used to send status updates for all requests submitted under - that account ID. - type: string - format: url - minLength: 0 - maxLength: 2000 - nullable: true - example: https://www.example.com/path/to/resource - pattern: >- - ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) - tfvError: - description: A generic error object. - properties: - type: - type: string - example: Error Type - description: - type: string - example: Error Message - errors: - type: object - description: >- - Each key of this errors object refers to a field of the submitted - object (using dot notation for nested objects), with the field being - a key to an array of one or more errors for that field. - example: - field: error message - type: object - tfvStatus: - type: object - properties: - phoneNumber: - $ref: '#/components/schemas/tfPhoneNumber' - status: - $ref: '#/components/schemas/tfvStatusEnum' - internalTicketNumber: - $ref: '#/components/schemas/internalTicketNumber' - declineReasonDescription: - $ref: '#/components/schemas/declineReasonDescription' - resubmitAllowed: - $ref: '#/components/schemas/resubmitAllowed' - createdDateTime: - type: string - description: Date and time the verification request was created. - format: date-time - example: '2021-06-08T06:45:13.0Z' - modifiedDateTime: - type: string - description: Date and time the verification request was last modified. - format: date-time - example: '2021-06-08T06:45:13.0Z' - submission: - $ref: '#/components/schemas/tfvSubmissionInfo' - blocked: - $ref: '#/components/schemas/blocked' - blockedReason: - $ref: '#/components/schemas/blockedReason' - tfvSubmissionInfo: - type: object - properties: - businessAddress: - $ref: '#/components/schemas/address' - businessContact: - $ref: '#/components/schemas/contact' - messageVolume: - type: integer - description: Estimated monthly volume of messages from the toll-free number. - minimum: 10 - maximum: 10000000 - example: 10000 - useCase: - $ref: '#/components/schemas/useCase' - useCaseSummary: - $ref: '#/components/schemas/useCaseSummary' - productionMessageContent: - $ref: '#/components/schemas/productionMessageContent' - optInWorkflow: - $ref: '#/components/schemas/optInWorkflow' - additionalInformation: - $ref: '#/components/schemas/additionalInformation' - isvReseller: - $ref: '#/components/schemas/isvReseller' - privacyPolicyUrl: - $ref: '#/components/schemas/privacyPolicyUrl' - termsAndConditionsUrl: - $ref: '#/components/schemas/termsAndConditionsUrl' - businessDba: - $ref: '#/components/schemas/businessDba' - businessRegistrationNumber: - $ref: '#/components/schemas/businessRegistrationNumber' - description: >- - US Federal Tax ID Number (EIN) or Canada Business Number (CBN). - Available starting October 1st, 2025. - businessRegistrationType: - $ref: '#/components/schemas/businessRegistrationTypeEnum' - description: >- - The type of business registration number. Available starting October - 1st, 2025. - businessEntityType: - $ref: '#/components/schemas/businessEntityTypeEnum' - description: >- - The type of registered business. If no option is applicable, please - provide "SOLE_PROPRIETOR" as a value. Available starting October - 1st, 2025. - tfvStatusEnum: - type: string - enum: - - VERIFIED - - UNVERIFIED - - PENDING - example: VERIFIED - sharedSecretKey: - description: >- - An ASCII string submitted by the user as a shared secret key for - generating an HMAC header for callbacks. - example: This is my $3cret - maxLength: 64 - minLength: 16 - nullable: true - pattern: ^[ -~]{16,64}$ - type: string - responses: - createMessageResponse: - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/message' - createMultiChannelMessageResponse: - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/createMultiChannelMessageResponse' - listMessagesResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/messagesList' - getMediaResponse: - description: OK - content: - application/octet-stream: - schema: - type: string - description: Successful Operation - format: binary - listMediaResponse: - description: OK - headers: - Continuation-Token: - description: Continuation token used to retrieve subsequent media. - schema: - type: string - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/media' - messagingBadRequestError: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingNotAcceptableError: - description: Not Acceptable - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - createMessageBadRequestError: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/createMessageRequestError' - messagingUnauthorizedError: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingForbiddenError: - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingNotFoundError: - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingMethodNotAllowedError: - description: Method Not Allowed - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingInvalidMediaTypeError: - description: Unsupported Media Type - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingTooManyRequestsError: - description: Too Many Requests - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingInternalServerError: - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - multiChannelBadRequestError: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: request-validation - description: >- - The 'channelList[0].from' field must contain exactly one - telephone number - source: - field: channelList[0].from - multiChannelNotAcceptableError: - description: Not Acceptable - multiChannelUnauthorizedError: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: unauthorized - description: Authentication Failed - source: {} - multiChannelForbiddenError: - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: forbidden - description: Access Denied - source: {} - multiChannelNotFoundError: - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: forbidden - description: Resource not found. - source: {} - multiChannelMethodNotAllowedError: - description: Method Not Allowed - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: method-not-allowed - description: Method 'PUT' not supported for this resource. - source: {} - multiChannelInvalidMediaTypeError: - description: Unsupported Media Type - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: unsupported-content-type - description: >- - Content-Type 'application/xml;charset=UTF-8' is not supported. - Please use 'application/json' - source: - header: Content-Type - multiChannelTooManyRequestsError: - description: Too Many Requests - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: rate-limit-exceeded - description: >- - You have exceeded your rate limit for this endpoint. Please - retry later. - source: {} - multiChannelInternalServerError: - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: internal-server-error - description: Internal server error. No further information available - source: {} - createCallResponse: - description: Created - headers: - Location: - description: The URL for further interactions with this call - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/createCallResponse' - examples: - createCall Response: - $ref: '#/components/examples/createCallResponseExample' - getCallStateResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/callState' - updateCallResponse: - description: OK - listCallsResponse: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/callState' - getStatisticsResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/accountStatistics' - updateRecordingResponse: - description: OK - listCallRecordingsResponse: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/callRecordingMetadata' - getCallRecordingResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/callRecordingMetadata' - downloadRecordingMediaResponse: - description: OK - content: - audio/vnd.wave: - schema: - type: string - format: binary - audio/mpeg: - schema: - type: string - format: binary - getRecordingTranscriptionResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/recordingTranscriptions' - listTranscriptionsResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/callTranscriptionMetadataList' - getCallTranscriptionResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/callTranscriptionResponse' - deleteCallTranscriptionResponse: - description: No Content - listConferencesResponse: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/conference' - examples: - listConferences Response: - $ref: '#/components/examples/listConferencesResponseExample' - getConferenceResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/conference' - getConferenceMemberResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/conferenceMember' - listConferenceRecordingsResponse: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/conferenceRecordingMetadata' - getConferenceRecordingResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/conferenceRecordingMetadata' - voiceBadRequestError: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - badRequestErrorExample: - $ref: '#/components/examples/voiceBadRequestErrorExample' - voiceUnauthorizedError: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - unauthorizedErrorExample: - $ref: '#/components/examples/voiceUnauthorizedErrorExample' - voiceForbiddenError: - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - forbiddenErrorExample: - $ref: '#/components/examples/voiceForbiddenErrorExample' - voiceNotFoundError: - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - notFoundErrorExample: - $ref: '#/components/examples/voiceNotFoundErrorExample' - voiceNotAllowedError: - description: Method Not Allowed - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - notAllowedErrorExample: - $ref: '#/components/examples/voiceNotAllowedErrorExample' - voiceConflictError: - description: Conflict - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - conflictErrorExample: - $ref: '#/components/examples/voiceConflictErrorExample' - voiceUnsupportedMediaTypeError: - description: Unsupported Media Type - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - tooManyRequestsErrorExample: - $ref: '#/components/examples/voiceUnsupportedMediaTypeErrorExample' - voiceTooManyRequestsError: - description: Too Many Requests - headers: - Retry-After: - description: When you should try your request again. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - tooManyRequestsErrorExample: - $ref: '#/components/examples/voiceTooManyRequestsErrorExample' - voiceInternalServerError: - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - internalServerErrorExample: - $ref: '#/components/examples/voiceInternalServerErrorExample' - voiceCodeResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/voiceCodeResponse' - messagingCodeResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/messagingCodeResponse' - verifyCodeResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/verifyCodeResponse' - mfaBadRequestError: - description: Bad Request - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/mfaRequestError' - mfaUnauthorizedError: - description: Unauthorized - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/mfaUnauthorizedRequestError' - mfaForbiddenError: - description: Forbidden - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/mfaForbiddenRequestError' - mfaTooManyRequestsError: - description: Too Many Requests - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/mfaRequestError' - mfaInternalServerError: - description: Internal Server Error - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/mfaRequestError' - createSyncLookupResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/createSyncLookupResponse' - examples: - lookupCompleteWithDniExample: - $ref: '#/components/examples/lookupCompleteWithDniExample' - lookupCompleteExample: - $ref: '#/components/examples/lookupCompleteExample' - lookupPartialExample: - $ref: '#/components/examples/lookupPartialExample' - lookupFailedExample: - $ref: '#/components/examples/lookupFailedExample' - createAsyncBulkLookupResponse: - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/createAsyncBulkLookupResponse' - examples: - lookupInProgressExample: - $ref: '#/components/examples/lookupInProgressExample' - getAsyncBulkLookupResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/getAsyncBulkLookupResponse' - examples: - lookupCompleteWithDniExample: - $ref: '#/components/examples/lookupCompleteWithDniExample' - lookupCompleteExample: - $ref: '#/components/examples/lookupCompleteExample' - lookupInProgressExample: - $ref: '#/components/examples/lookupInProgressExample' - lookupPartialExample: - $ref: '#/components/examples/lookupPartialExample' - lookupFailedExample: - $ref: '#/components/examples/lookupFailedExample' - tnLookupDefaultResponse: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/lookupErrorResponse' - examples: - badRequest: - $ref: '#/components/examples/badRequestExample' - unauthorized: - $ref: '#/components/examples/unauthorizedExample' - forbidden: - $ref: '#/components/examples/forbiddenExample' - mediaType: - $ref: '#/components/examples/unsupportedMediaTypeExample' - notFound: - $ref: '#/components/examples/notFoundExample' - tooManyRequests: - $ref: '#/components/examples/tooManyRequestsExample' - internalServer: - $ref: '#/components/examples/internalServerErrorExample' - getTollFreeVerificationStatusResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/tfvStatus' - listWebhookSubscriptionsResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/webhookSubscriptionsListBody' - createWebhookSubscriptionResponse: - description: Created - content: - application/json: - schema: - $ref: '#/components/schemas/webhookSubscription' - updateWebhookSubscriptionResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/webhookSubscription' - listTollFreeUseCasesResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/useCases' - tfvBadRequestResponse: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Cannot process request. - type: bad request - noContentResponse: - description: No Content - tfvPostBadRequestResponse: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: cannot process request. - errors: - businessName: Business name is required. - businessContactEmail: Business contact email is not a valid email address. - optInWorkflowImageURLs: Entries must be a valid array of objects. - tfvUnauthorizedResponse: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Client is providing incorrect or invalid credentials. - type: unauthorized - tfvForbiddenResponse: - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Client is not authorized for the action. - type: forbidden - tfvNotFoundResponse: - description: Cannot find the requested resource. - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Cannot find the requested resource. - type: Not Found - tfvNotAllowedResponse: - description: Method Not Allowed - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Method is not allowed. - type: Method Not Allowed - tfvTooManyRequestsResponse: - description: Too Many Requests - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Throttling error. Too many requests. - type: Too Many Requests - tfvServerErrorResponse: - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Internal Server Error. - type: Internal Server Error - tfvServiceUnavailableResponse: - description: Service Unavailable - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Service Unavailable Error. - type: Service Unavailable - parameters: - accountId: - in: path - name: accountId - required: true - schema: - type: string - description: Your Bandwidth Account ID. - example: '9900000' - mediaId: - in: path - name: mediaId - required: true - description: Media ID to retrieve. - example: 14762070468292kw2fuqty55yp2b2/0/bw.png - schema: - type: string - contentType: - in: header - name: Content-Type - style: simple - explode: false - description: The media type of the entity-body. - example: audio/wav - schema: - type: string - cacheControl: - in: header - name: Cache-Control - style: simple - explode: false - description: >- - General-header field is used to specify directives that MUST be obeyed - by all caching mechanisms along the request/response chain. - example: no-cache - schema: - type: string - continuationToken: - in: header - name: Continuation-Token - description: Continuation token used to retrieve subsequent media. - example: >- - 1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39 - schema: - type: string - messageId: - in: query - name: messageId - required: false - description: >- - The ID of the message to search for. Special characters need to be - encoded using URL encoding. Message IDs could come in different formats, - e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and - 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that - you must include at least one query parameter. - example: 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 - schema: - type: string - sourceTn: - in: query - name: sourceTn - required: false - description: >- - The phone number that sent the message. Accepted values are: a single - full phone number a comma separated list of full phone numbers (maximum - of 10) or a single partial phone number (minimum of 5 characters e.g. - '%2B1919'). - example: '%2B15554443333' - schema: - type: string - destinationTn: - in: query - name: destinationTn - required: false - description: >- - The phone number that received the message. Accepted values are: a - single full phone number a comma separated list of full phone numbers - (maximum of 10) or a single partial phone number (minimum of 5 - characters e.g. '%2B1919'). - example: '%2B15554443333' - schema: - type: string - messageStatus: - in: query - name: messageStatus - required: false - description: >- - The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED - DELIVERED ACCEPTED UNDELIVERED. - schema: - $ref: '#/components/schemas/messageStatusEnum' - messageDirection: - in: query - name: messageDirection - required: false - description: The direction of the message. One of INBOUND OUTBOUND. - schema: - $ref: '#/components/schemas/listMessageDirectionEnum' - carrierName: - in: query - name: carrierName - required: false - description: >- - The name of the carrier used for this message. Possible values include - but are not limited to Verizon and TMobile. Special characters need to - be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). - example: Verizon - schema: - type: string - messageType: - in: query - name: messageType - required: false - description: The type of message. Either sms or mms. - schema: - $ref: '#/components/schemas/messageTypeEnum' - errorCode: - in: query - name: errorCode - required: false - description: The error code of the message. - example: 9902 - schema: - type: integer - fromDateTime: - in: query - name: fromDateTime - required: false - description: >- - The start of the date range to search in ISO 8601 format. Uses the - message receive time. The date range to search in is currently 14 days. - example: 2022-09-14T18:20:16.000Z - schema: - type: string - toDateTime: - in: query - name: toDateTime - required: false - description: >- - The end of the date range to search in ISO 8601 format. Uses the message - receive time. The date range to search in is currently 14 days. - example: 2022-09-14T18:20:16.000Z - schema: - type: string - campaignId: - in: query - name: campaignId - required: false - description: The campaign ID of the message. - example: CJEUMDK - schema: - type: string - fromBwLatency: - in: query - name: fromBwLatency - required: false - description: >- - The minimum Bandwidth latency of the message in seconds. Only available - for accounts with the Advanced Quality Metrics feature enabled. - example: 5 - schema: - type: integer - bwQueued: - in: query - name: bwQueued - required: false - description: >- - A boolean value indicating whether the message is queued in the - Bandwidth network. - example: true - schema: - type: boolean - product: - in: query - name: product - required: false - description: Messaging product associated with the message. - example: P2P - schema: - $ref: '#/components/schemas/productTypeEnum' - location: - in: query - name: location - required: false - description: Location Id associated with the message. - example: 123ABC - schema: - type: string - carrierQueued: - in: query - name: carrierQueued - required: false - description: >- - A boolean value indicating whether the message is queued in the carrier - network. Only available for OUTBOUND messages from accounts with the - Advanced Quality Metrics feature enabled. - example: true - schema: - type: boolean - fromCarrierLatency: - in: query - name: fromCarrierLatency - required: false - description: >- - The minimum carrier latency of the message in seconds. Only available - for OUTBOUND messages from accounts with the Advanced Quality Metrics - feature enabled. - example: 50 - schema: - type: integer - callingNumberCountryA3: - in: query - name: callingNumberCountryA3 - required: false - description: Calling number country in A3 format. - example: USA - schema: - type: string - calledNumberCountryA3: - in: query - name: calledNumberCountryA3 - required: false - description: Called number country in A3 format. - example: USA - schema: - type: string - fromSegmentCount: - in: query - name: fromSegmentCount - required: false - description: Segment count (start range). - example: 1 - schema: - type: integer - toSegmentCount: - in: query - name: toSegmentCount - required: false - description: Segment count (end range). - example: 3 - schema: - type: integer - fromMessageSize: - in: query - name: fromMessageSize - required: false - description: Message size (start range). - example: 100 - schema: - type: integer - toMessageSize: - in: query - name: toMessageSize - required: false - description: Message size (end range). - example: 120 - schema: - type: integer - sort: - in: query - name: sort - required: false - description: >- - The field and direction to sort by combined with a colon. Direction is - either asc or desc. - example: sourceTn:desc - schema: - type: string - pageToken: - in: query - name: pageToken - required: false - description: A base64 encoded value used for pagination of results. - example: gdEewhcJLQRB5 - schema: - type: string - limit: - in: query - name: limit - required: false - description: >- - The maximum records requested in search result. Default 100. The sum of - limit and after cannot be more than 10000. - schema: - type: integer - example: 50 - limitTotalCount: - in: query - name: limitTotalCount - required: false - description: >- - When set to true, the response's totalCount field will have a maximum - value of 10,000. When set to false, or excluded, this will give an - accurate totalCount of all messages that match the provided filters. If - you are experiencing latency, try using this parameter to limit your - results. - example: true - schema: - type: boolean - callId: - name: callId - in: path - required: true - schema: - type: string - description: Programmable Voice API Call ID. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - recordingId: - name: recordingId - in: path - required: true - schema: - type: string - description: Programmable Voice API Recording ID. - example: r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - conferenceId: - name: conferenceId - in: path - required: true - schema: - type: string - description: Programmable Voice API Conference ID. - example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 - memberId: - name: memberId - in: path - required: true - schema: - type: string - description: Programmable Voice API Conference Member ID. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - transcriptionId: - name: transcriptionId - in: path - required: true - schema: - type: string - description: Programmable Voice API Transcription ID. - example: t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - to: - name: to - in: query - required: false - schema: - type: string - description: Filter results by the `to` field. - example: '%2b19195551234' - from: - name: from - in: query - required: false - schema: - type: string - description: Filter results by the `from` field. - example: '%2b19195554321' - name: - name: name - in: query - required: false - schema: - type: string - description: Filter results by the `name` field. - example: my-custom-name - minCreatedTime: - name: minCreatedTime - in: query - required: false - schema: - type: string - description: >- - Filter results to conferences which have a `createdTime` after or at - `minCreatedTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - maxCreatedTime: - name: maxCreatedTime - in: query - required: false - schema: - type: string - description: >- - Filter results to conferences which have a `createdTime` before or at - `maxCreatedTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - minStartTime: - name: minStartTime - in: query - required: false - schema: - type: string - description: >- - Filter results to recordings which have a `startTime` after or including - `minStartTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - maxStartTime: - name: maxStartTime - in: query - required: false - schema: - type: string - description: >- - Filter results to recordings which have a `startTime` before - `maxStartTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - pageSize: - name: pageSize - in: query - required: false - schema: - type: integer - format: int32 - minimum: 1 - maximum: 1000 - default: 1000 - description: Specifies the max number of conferences that will be returned. - example: 500 - minStartTimeCalls: - name: minStartTime - in: query - required: false - schema: - type: string - description: >- - Filter results to calls which have a `startTime` after or including - `minStartTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - maxStartTimeCalls: - name: maxStartTime - in: query - required: false - schema: - type: string - description: >- - Filter results to calls which have a `startTime` before or including - `maxStartTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - pageSizeCalls: - name: pageSize - in: query - required: false - schema: - type: integer - format: int32 - minimum: 1 - maximum: 10000 - default: 1000 - description: Specifies the max number of calls that will be returned. - example: 500 - pageToken1: - name: pageToken - in: query - required: false - schema: - type: string - description: >- - Not intended for explicit use. To use pagination, follow the links in - the `Link` header of the response, as indicated in the endpoint - description. - example: eyJwYWdlVG9rZW4iOiJ0b2tlbiJ9 - disconnectCause: - name: disconnectCause - in: query - required: false - schema: - type: string - description: Filter results to calls with specified call Disconnect Cause. - example: hangup - accountId1: - in: path - name: accountId - required: true - schema: - type: string - description: Your Bandwidth Account ID. - example: '9900000' - requestId: - in: path - name: requestId - required: true - schema: - type: string - format: uuid - description: The phone number lookup request ID from Bandwidth. - example: 004223a0-8b17-41b1-bf81-20732adf5590 - tfPhoneNumberPathParam: - in: path - name: phoneNumber - required: true - schema: - $ref: '#/components/schemas/tfPhoneNumber' - description: Valid Toll-Free telephone number in E.164 format. - example: '+18885555555' - webhookSubscriptionIdPathParam: - in: path - name: id - required: true - schema: - type: string - description: Webhook subscription ID - example: 7bt57JcsVYJrN9K1OcV1Nu - examples: - smsMessageReceivedCallbackExample: - summary: An example of a sms message-received callback body. - value: - time: '2025-01-06T15:43:35.502180Z' - type: message-received - to: '+12345678902' - description: Incoming message received - message: - id: 14762070468292kw2fuqty55yp2b2 - owner: '+12345678902' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - time: '2025-01-06T15:43:34.000000Z' - segmentCount: 1 - direction: in - to: - - '+12345678902' - from: '+12345678901' - text: Hey, check out this SMS! - mmsMessageReceivedCallbackExample: - summary: An example of a mms message-received callback body. - value: - time: '2024-09-14T18:20:45.160744Z' - type: message-received - to: '+12345678902' - description: Incoming message received - message: - id: 14762070468292kw2fuqty55yp2b2 - owner: '+12345678902' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - time: '2024-09-14T18:20:45.160744Z' - segmentCount: 1 - direction: in - to: - - '+12345678902' - - '+12345678903' - from: '+12345678901' - text: Hey, check out the MMS! - media: - - >- - https://messaging.bandwidth.com/api/v2/users/9900902/media/14762070468292kw2fuqty55yp2b2/0/bw.png - messageSendingCallbackExample: - summary: An example of a message-sending callback body. - value: - time: '2024-06-25T18:42:36.979456Z' - type: message-sending - to: '+15554443333' - description: Message is sending to carrier. - message: - id: 1593110555875xo7watq5px6rbe5d - owner: '+15552221111' - applicationId: cfd4fb83-7531-4acc-b471-42d0bb76a65c - time: '2024-06-25T18:42:35.876906Z' - segmentCount: 1 - direction: out - to: - - '+15554443333' - from: '+15552221111' - text: '' - media: - - https://dev.bandwidth.com/images/bandwidth-logo.png - tag: your tag here - smsMessageDeliveredCallbackExample: - summary: An example of a sms message-delivered callback body. - value: - type: message-delivered - time: '2024-09-14T18:20:11.160744Z' - description: Message delivered to carrier. - to: '+12345678902' - message: - id: 14762070468292kw2fuqty55yp2b2 - time: '2024-09-14T18:20:11.160744Z' - to: - - '+12345678902' - from: '+12345678901' - text: '' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - owner: '+12345678902' - direction: out - segmentCount: 1 - mmsMessageDeliveredCallbackExample: - summary: An example of a mms message-delivered callback body. - value: - type: message-delivered - time: '2024-09-14T18:20:24.160544Z' - description: Message delivered to carrier. - to: '+12345678902' - message: - id: 14762070468292kw2fuqty55yp2b2 - time: '2024-09-14T18:20:24.160544Z' - to: - - '+12345678902' - from: '+12345678901' - text: '' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - owner: '+12345678902' - direction: out - segmentCount: 1 - media: - - https://dev.bandwidth.com/images/bandwidth-logo.png - groupMmsMessageDeliveredCallbackExample: - summary: An example of a group mms message-delivered callback body. - value: - type: message-delivered - time: '2024-09-14T18:20:17.160544Z' - description: Message delivered to carrier. - to: '+12345678902' - message: - id: 14762070468292kw2fuqty55yp2b2 - time: '2024-09-14T18:20:17.160544Z' - to: - - '+12345678902' - - '+12345678903' - from: '+12345678901' - text: '' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - owner: '+12345678902' - direction: out - segmentCount: 1 - messageFailedCallbackExample: - summary: An example of a message-failed callback body. - value: - type: message-failed - time: '2024-12-18T16:51:27.704450Z' - description: forbidden to country - to: '+52345678903' - errorCode: 4432 - message: - id: 14762070468292kw2fuqty55yp2b2 - time: '2024-12-18T16:51:27.704450Z' - to: - - '+12345678902' - - '+52345678903' - from: '+12345678901' - text: '' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - media: - - https://dev.bandwidth.com/images/bandwidth-logo.png - owner: '+12345678901' - direction: out - segmentCount: 1 - createCallResponseExample: - summary: Example of a createCall Response - value: - applicationId: 04e88489-df02-4e34-a0ee-27a91849555f - accountId: '9900000' - callId: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - to: '+19195551234' - from: '+19195554312' - enqueuedTime: '2022-06-16T13:15:07.160Z' - callUrl: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - callTimeout: 30 - callbackTimeout: 15 - tag: My custom tag value - answerMethod: POST - answerUrl: https://myServer.example/bandwidth/webhooks/answer - answerFallbackMethod: POST - answerFallbackUrl: https://myServer.example/bandwidth/webhooks/answerFallback - disconnectMethod: POST - disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect - username: mySecretUsername - password: '*****' - fallbackUsername: mySecretUsername - fallbackPassword: '*****' - priority: 5 - listConferencesResponseExample: - summary: Example of a listConferences Response - value: - - id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 - name: my-conference-name - createdTime: '2022-06-17T22:19:40.375Z' - completedTime: '2022-06-17T22:20:00.000Z' - conferenceEventUrl: https://myServer.example/bandwidth/webhooks/conferenceEvent - conferenceEventMethod: POST - tag: my custom tag - voiceBadRequestErrorExample: - summary: Example of a Bad Request (400) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceUnauthorizedErrorExample: - summary: Example of an Unauthorized (401) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceForbiddenErrorExample: - summary: Example of a Forbidden (403) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceNotFoundErrorExample: - summary: Example of a Not Found (404) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceNotAllowedErrorExample: - summary: Example of a Not Allowed (405) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceConflictErrorExample: - summary: Example of a Conflict (409) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceUnsupportedMediaTypeErrorExample: - summary: Example of an Unsupported Media Type (415) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceTooManyRequestsErrorExample: - summary: Example of a Too Many Requests (429) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceInternalServerErrorExample: - summary: Example of an Internal Server (500) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - singleNumberRequestExample: - summary: Number Lookup Request - value: - phoneNumbers: - - '+19196104423' - multipleNumberRequestExample: - summary: Number Lookup Request for Multiple Numbers - value: - phoneNumbers: - - '+19196104423' - - '+19196104424' - lookupInProgressExample: - summary: Numbers Lookup In Progress - value: - links: - - href: href - rel: rel - method: GET - data: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: IN_PROGRESS - results: [] - errors: [] - lookupFailedExample: - summary: Numbers Lookup Failed - value: - links: - - href: href - rel: rel - method: GET - data: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: FAILED - results: [] - errors: - - code: NO-MATCH - description: The following TNs could not be found in the Number Industry data - meta: - phoneNumbers: - - '+13992077164' - message: Invalid TNs - code: 1001 - type: NumberInventory - lookupPartialExample: - summary: Numbers Lookup Partial Complete - value: - links: - - href: href - rel: rel - method: GET - data: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: PARTIAL_COMPLETE - results: - - phoneNumber: '+19196104423' - lineType: MOBILE - messagingProvider: Verizon Wireless - voiceProvider: Verizon Wireless - countryCodeA3: USA - - phoneNumber: '+19196104424' - lineType: MOBILE - messagingProvider: T-Mobile USA - voiceProvider: T-Mobile USA - countryCodeA3: USA - errors: - - code: NO-MATCH - description: The following TNs could not be found in the Number Industry data - meta: - phoneNumbers: - - '+13992077164' - message: Invalid TNs - code: 1001 - type: NumberInventory - lookupCompleteExample: - summary: Numbers Lookup Complete (without DNI) - value: - links: - - href: href - rel: rel - method: GET - data: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: COMPLETE - results: - - phoneNumber: '+10072904497' - lineType: MOBILE - messagingProvider: Verizon Wireless - voiceProvider: Verizon Wireless - countryCodeA3: USA - - phoneNumber: '+10072904498' - lineType: MOBILE - messagingProvider: T-Mobile USA - voiceProvider: T-Mobile USA - countryCodeA3: USA - errors: [] - lookupCompleteWithDniExample: - summary: Numbers Lookup Complete (with DNI) - value: - links: - - href: href - rel: rel - method: GET - data: - requestId: 20732adf-bf81-8b17-41b1-004223a05590 - status: COMPLETE - results: - - phoneNumber: '+10072904497' - countryCodeA3: USA - lineType: MOBILE - messagingProvider: T-MOBILE USA INC - voiceProvider: T-MOBILE USA INC - latestMessageDeliveryStatus: ACTIVE - initialMessageDeliveryStatusDate: '2025-05-14' - latestMessageDeliveryStatusDate: '2025-05-18' - - phoneNumber: '+10072904498' - countryCodeA3: USA - lineType: FIXED - voiceProvider: VERIZON - latestMessageDeliveryStatus: DEACTIVATED - initialMessageDeliveryStatusDate: '2025-09-05' - latestMessageDeliveryStatusDate: '2025-09-05' - - phoneNumber: '+10072904499' - lineType: MOBILE - countryCodeA3: USA - messagingProvider: VERIZON - voiceProvider: VERIZON - deactivationReporter: Verizon Wireless - deactivationDate: '2025-09-29 01:23:00' - deactivationEvent: DEACTIVATED - latestMessageDeliveryStatus: UNKNOWN - errors: [] - badRequestExample: - summary: Example Bad Request Error - value: - links: [] - data: {} - errors: - - type: bad-request - description: >- - Bad Request. Ensure that you have set the requestId as a URL path - parameter. - unauthorizedExample: - summary: Unauthorized Error - value: - links: [] - data: {} - errors: - - type: Unauthorized - description: You are not authorized to access this resource. - code: '1' - page: null - forbiddenExample: - summary: Forbidden Error - value: - links: [] - data: {} - errors: - - type: Forbidden - description: You do not have permission to access this resource. - code: '2' - page: null - unsupportedMediaTypeExample: - summary: Unsupported Media Type Error - value: - links: [] - data: {} - errors: - - type: invalid-content-type - description: >- - Invalid content-type. Ensure that your content-type header is set - to application/json. - notFoundExample: - summary: Not Found Error - value: - links: [] - data: {} - errors: - - type: not-found - description: >- - RequestId not found. Ensure that the requestId used in the URL - path is valid and maps to a previous request that was submitted. - tooManyRequestsExample: - summary: Too Many Requests Error - value: - links: [] - data: {} - errors: - - type: rate-limiting - description: >- - Rate limit exceeded. Wait for the time specified in the - Retry-After header before sending another request. - internalServerErrorExample: - summary: Internal Server Error - value: - links: [] - data: {} - errors: - - code: '500' - type: unexpected-error - description: >- - Unexpected error. Please contact Bandwidth Support if your - requests are receiving this status code for an extended period of - time. - requestBodies: - createMessageRequest: - content: - application/json: - schema: - $ref: '#/components/schemas/messageRequest' - required: true - createMultiChannelMessageRequest: - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelMessageRequest' - required: true - uploadMediaRequest: - content: - application/json: - schema: - type: string - format: binary - application/ogg: - schema: - type: string - format: binary - application/pdf: - schema: - type: string - format: binary - application/rtf: - schema: - type: string - format: binary - application/zip: - schema: - type: string - format: binary - application/x-tar: - schema: - type: string - format: binary - application/xml: - schema: - type: string - format: binary - application/gzip: - schema: - type: string - format: binary - application/x-bzip2: - schema: - type: string - format: binary - application/x-gzip: - schema: - type: string - format: binary - application/smil: - schema: - type: string - format: binary - application/javascript: - schema: - type: string - format: binary - audio/mp4: - schema: - type: string - format: binary - audio/mpeg: - schema: - type: string - format: binary - audio/ogg: - schema: - type: string - format: binary - audio/flac: - schema: - type: string - format: binary - audio/webm: - schema: - type: string - format: binary - audio/wav: - schema: - type: string - format: binary - audio/amr: - schema: - type: string - format: binary - audio/3gpp: - schema: - type: string - format: binary - image/bmp: - schema: - type: string - format: binary - image/gif: - schema: - type: string - format: binary - image/heic: - schema: - type: string - format: binary - image/heif: - schema: - type: string - format: binary - image/jpeg: - schema: - type: string - format: binary - image/pjpeg: - schema: - type: string - format: binary - image/png: - schema: - type: string - format: binary - image/svg+xml: - schema: - type: string - format: binary - image/tiff: - schema: - type: string - format: binary - image/webp: - schema: - type: string - format: binary - image/x-icon: - schema: - type: string - format: binary - text/css: - schema: - type: string - format: binary - text/csv: - schema: - type: string - format: binary - text/calendar: - schema: - type: string - format: binary - text/html: - schema: - type: string - format: binary - text/plain: - schema: - type: string - format: binary - text/javascript: - schema: - type: string - format: binary - text/vcard: - schema: - type: string - format: binary - text/vnd.wap.wml: - schema: - type: string - format: binary - text/xml: - schema: - type: string - format: binary - video/avi: - schema: - type: string - format: binary - video/mp4: - schema: - type: string - format: binary - video/mpeg: - schema: - type: string - format: binary - video/ogg: - schema: - type: string - format: binary - video/quicktime: - schema: - type: string - format: binary - video/webm: - schema: - type: string - format: binary - video/x-ms-wmv: - schema: - type: string - format: binary - video/x-flv: - schema: - type: string - format: binary - required: true - createCallRequest: - description: JSON object containing information to create an outbound call - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/createCall' - updateCallRequest: - description: >- - JSON object containing information to redirect an existing call to a new - BXML document - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/updateCall' - updateCallBxmlRequest: - required: true - content: - application/xml: - schema: - type: string - description: A valid BXML document to replace the call's current BXML. - examples: - speakSentence: - summary: Speak Sentence - value: |- - - - This is a test sentence. - - redirectUrl: - summary: Redirect - value: |- - - - - - updateCallRecordingRequest: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/updateCallRecording' - transcribeRecordingRequest: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/transcribeRecording' - updateConferenceRequest: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/updateConference' - updateConferenceBxmlRequest: - required: true - content: - application/xml: - schema: - type: string - description: A valid BXML document to replace the call's current BXML. - examples: - stopRecording: - summary: Stop Recording - value: |- - - - - - updateConferenceMemberRequest: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/updateConferenceMember' - codeRequest: - description: MFA code request body. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/codeRequest' - codeVerify: - description: MFA code verify request body. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/verifyCodeRequest' - createSyncLookupRequest: - description: Synchronous phone number lookup request. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/syncLookupRequest' - examples: - singleNumberRequestExample: - $ref: '#/components/examples/singleNumberRequestExample' - multipleNumberRequestExample: - $ref: '#/components/examples/multipleNumberRequestExample' - createAsyncBulkLookupRequest: - description: Asynchronous bulk phone number lookup request. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/asyncLookupRequest' - examples: - multipleNumberRequestExample: - $ref: '#/components/examples/multipleNumberRequestExample' - requestTollFreeVerificationRequest: - description: Request for verification of a toll-free phone number. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/verificationRequest' - updateTollFreeVerificationRequestRequest: - description: Update a request for verification of a toll-free phone number. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/tfvSubmissionWrapper' - verificationWebhookRequest: - description: Verification callback status of a toll-free phone number. - required: true - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/verificationWebhook' - - $ref: '#/components/schemas/verificationDenialWebhook' - - $ref: '#/components/schemas/failureWebhook' - - $ref: '#/components/schemas/blockedWebhook' - webhookSubscriptionRequest: - description: >- - Information about a webhook that Bandwidth should send upon the - completion of event customer is trying to subscribe to. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/webhookSubscriptionRequestSchema' - securitySchemes: - Basic: - type: http - scheme: basic - description: >- - Basic authentication is a simple authentication scheme built into the - HTTP protocol. To use it, send your HTTP requests with an - `Authorization` header that contains the word `Basic` followed by a - space and a Base64-encoded string `username:password`. - - - - Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==` - OAuth2: - type: oauth2 - flows: - clientCredentials: - tokenUrl: https://api.bandwidth.com/api/v1/oauth2/token - scopes: {} - callbacks: - inboundCallback: - '{inboundCallbackUrl}': - post: - requestBody: - required: true - description: >- -

This Inbound Message Webhook is an envelope containing either a - received (MO) message to your - - message-enabled Bandwidth telephone number or a multichannel - client's response to a suggestion response - - or location request. - -

The payload type will be one of message-received, - suggestion-response, or - location-request-response. - -

Note that suggestion-response and - location-request-response callback types are - pertinent only for RBM messages sent from the - /messages/multiChannel endpoint. - -

Please visit Webhooks

- content: - application/json: - schema: - $ref: '#/components/schemas/inboundCallback' - examples: - smsMessageReceivedCallback: - $ref: '#/components/examples/smsMessageReceivedCallbackExample' - mmsMessageReceivedCallback: - $ref: '#/components/examples/mmsMessageReceivedCallbackExample' - responses: - '200': - description: OK - '202': - description: Accepted - statusCallback: - '{statusCallbackUrl}': - post: - requestBody: - required: true - description: >- -

This Outbound Message Webhook is an envelope containing status - information regarding a message sent (MT) - - from your message-enabled Bandwidth telephone number. -

The payload type will be one of message-sending, message-delivered, message-failed or message-read. -

Note that message-read callbacks are pertinent only for RBM messages sent from the /messages/multiChannel endpoint. -

Please visit Webhooks

- content: - application/json: - schema: - $ref: '#/components/schemas/statusCallback' - examples: - messageSendingCallback: - $ref: '#/components/examples/messageSendingCallbackExample' - smsMessageDeliveredCallback: - $ref: '#/components/examples/smsMessageDeliveredCallbackExample' - mmsMessageDeliveredCallback: - $ref: '#/components/examples/mmsMessageDeliveredCallbackExample' - groupMmsMessageDeliveredCallback: - $ref: >- - #/components/examples/groupMmsMessageDeliveredCallbackExample - messageFailedCallback: - $ref: '#/components/examples/messageFailedCallbackExample' - responses: - '200': - description: OK - '202': - description: Accepted - tfVerificationStatus: - your_url.com/webhookService: - post: - summary: TFV status updates sent to customer's webhook URL. - description: >- - Unique webhook URL provided by customers to which Bandwidth sends a - POST request to notify customer regarding TFV status updates. - operationId: tfvRequest - parameters: - - description: >- - 64-character lowercase hexidecimal HMAC calculated with a shared - secret key, the canonicalized request body, and SHA256. It is - only included when a shared secret key is set through webhook - subscription. - example: ca7b9e9816c90d336f5dca529e733354b81535c7af027b81878ac98afb2dbaa2 - in: header - name: x-bandwidth-signature-hmac-sha256 - schema: - type: string - requestBody: - $ref: '#/components/requestBodies/verificationWebhookRequest' - responses: - '204': - $ref: '#/components/responses/noContentResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' diff --git a/bandwidth.yml b/bandwidth.yml new file mode 120000 index 00000000..2117df27 --- /dev/null +++ b/bandwidth.yml @@ -0,0 +1 @@ +../api-specs-combine-action/api-specs/bandwidth.yml \ No newline at end of file diff --git a/bandwidth/__init__.py b/bandwidth/__init__.py index 5d5b6304..013ae746 100644 --- a/bandwidth/__init__.py +++ b/bandwidth/__init__.py @@ -21,6 +21,7 @@ __all__ = [ "CallsApi", "ConferencesApi", + "EndpointsApi", "MFAApi", "MediaApi", "MessagesApi", @@ -78,16 +79,31 @@ "CreateAsyncBulkLookupResponseData", "CreateCall", "CreateCallResponse", + "CreateEndpointRequestBase", + "CreateEndpointResponse", + "CreateEndpointResponseObject", "CreateMessageRequestError", "CreateMultiChannelMessageResponse", "CreateSyncLookupResponse", "CreateSyncLookupResponseData", + "CreateWebRtcConnectionRequest", "DeactivationEventEnum", + "Device", + "DeviceStatusEnum", "DisconnectCallback", "Diversion", "DtmfCallback", + "Endpoint", + "EndpointDirectionEnum", + "EndpointEvent", + "EndpointEventTypeEnum", + "EndpointResponse", + "EndpointStatusEnum", + "EndpointTypeEnum", + "Endpoints", "Error", "ErrorObject", + "ErrorResponse", "ErrorSource", "FailureWebhook", "FieldError", @@ -105,6 +121,7 @@ "Link", "LinkSchema", "LinksObject", + "ListEndpointsResponse", "ListMessageDirectionEnum", "ListMessageItem", "LookupErrorResponse", @@ -148,6 +165,7 @@ "MultiChannelMessageRequest", "MultiChannelMessageResponseData", "OptInWorkflow", + "Page", "PageInfo", "PriorityEnum", "ProductTypeEnum", @@ -176,6 +194,8 @@ "RecordingTranscriptions", "RedirectCallback", "RedirectMethodEnum", + "SipConnectionMetadata", + "SipCredentials", "SmsMessageContent", "StandaloneCardOrientationEnum", "StatusCallback", @@ -220,6 +240,7 @@ # import apis into sdk package from bandwidth.api.calls_api import CallsApi as CallsApi from bandwidth.api.conferences_api import ConferencesApi as ConferencesApi +from bandwidth.api.endpoints_api import EndpointsApi as EndpointsApi from bandwidth.api.mfa_api import MFAApi as MFAApi from bandwidth.api.media_api import MediaApi as MediaApi from bandwidth.api.messages_api import MessagesApi as MessagesApi @@ -281,16 +302,31 @@ from bandwidth.models.create_async_bulk_lookup_response_data import CreateAsyncBulkLookupResponseData as CreateAsyncBulkLookupResponseData from bandwidth.models.create_call import CreateCall as CreateCall from bandwidth.models.create_call_response import CreateCallResponse as CreateCallResponse +from bandwidth.models.create_endpoint_request_base import CreateEndpointRequestBase as CreateEndpointRequestBase +from bandwidth.models.create_endpoint_response import CreateEndpointResponse as CreateEndpointResponse +from bandwidth.models.create_endpoint_response_object import CreateEndpointResponseObject as CreateEndpointResponseObject from bandwidth.models.create_message_request_error import CreateMessageRequestError as CreateMessageRequestError from bandwidth.models.create_multi_channel_message_response import CreateMultiChannelMessageResponse as CreateMultiChannelMessageResponse from bandwidth.models.create_sync_lookup_response import CreateSyncLookupResponse as CreateSyncLookupResponse from bandwidth.models.create_sync_lookup_response_data import CreateSyncLookupResponseData as CreateSyncLookupResponseData +from bandwidth.models.create_web_rtc_connection_request import CreateWebRtcConnectionRequest as CreateWebRtcConnectionRequest from bandwidth.models.deactivation_event_enum import DeactivationEventEnum as DeactivationEventEnum +from bandwidth.models.device import Device as Device +from bandwidth.models.device_status_enum import DeviceStatusEnum as DeviceStatusEnum from bandwidth.models.disconnect_callback import DisconnectCallback as DisconnectCallback from bandwidth.models.diversion import Diversion as Diversion from bandwidth.models.dtmf_callback import DtmfCallback as DtmfCallback +from bandwidth.models.endpoint import Endpoint as Endpoint +from bandwidth.models.endpoint_direction_enum import EndpointDirectionEnum as EndpointDirectionEnum +from bandwidth.models.endpoint_event import EndpointEvent as EndpointEvent +from bandwidth.models.endpoint_event_type_enum import EndpointEventTypeEnum as EndpointEventTypeEnum +from bandwidth.models.endpoint_response import EndpointResponse as EndpointResponse +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum as EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum as EndpointTypeEnum +from bandwidth.models.endpoints import Endpoints as Endpoints from bandwidth.models.error import Error as Error from bandwidth.models.error_object import ErrorObject as ErrorObject +from bandwidth.models.error_response import ErrorResponse as ErrorResponse from bandwidth.models.error_source import ErrorSource as ErrorSource from bandwidth.models.failure_webhook import FailureWebhook as FailureWebhook from bandwidth.models.field_error import FieldError as FieldError @@ -308,6 +344,7 @@ from bandwidth.models.link import Link as Link from bandwidth.models.link_schema import LinkSchema as LinkSchema from bandwidth.models.links_object import LinksObject as LinksObject +from bandwidth.models.list_endpoints_response import ListEndpointsResponse as ListEndpointsResponse from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum as ListMessageDirectionEnum from bandwidth.models.list_message_item import ListMessageItem as ListMessageItem from bandwidth.models.lookup_error_response import LookupErrorResponse as LookupErrorResponse @@ -351,6 +388,7 @@ from bandwidth.models.multi_channel_message_request import MultiChannelMessageRequest as MultiChannelMessageRequest from bandwidth.models.multi_channel_message_response_data import MultiChannelMessageResponseData as MultiChannelMessageResponseData from bandwidth.models.opt_in_workflow import OptInWorkflow as OptInWorkflow +from bandwidth.models.page import Page as Page from bandwidth.models.page_info import PageInfo as PageInfo from bandwidth.models.priority_enum import PriorityEnum as PriorityEnum from bandwidth.models.product_type_enum import ProductTypeEnum as ProductTypeEnum @@ -379,6 +417,8 @@ from bandwidth.models.recording_transcriptions import RecordingTranscriptions as RecordingTranscriptions from bandwidth.models.redirect_callback import RedirectCallback as RedirectCallback from bandwidth.models.redirect_method_enum import RedirectMethodEnum as RedirectMethodEnum +from bandwidth.models.sip_connection_metadata import SipConnectionMetadata as SipConnectionMetadata +from bandwidth.models.sip_credentials import SipCredentials as SipCredentials from bandwidth.models.sms_message_content import SmsMessageContent as SmsMessageContent from bandwidth.models.standalone_card_orientation_enum import StandaloneCardOrientationEnum as StandaloneCardOrientationEnum from bandwidth.models.status_callback import StatusCallback as StatusCallback diff --git a/bandwidth/api/__init__.py b/bandwidth/api/__init__.py index feb7cec3..7b0f7dff 100644 --- a/bandwidth/api/__init__.py +++ b/bandwidth/api/__init__.py @@ -3,6 +3,7 @@ # import apis into api package from bandwidth.api.calls_api import CallsApi from bandwidth.api.conferences_api import ConferencesApi +from bandwidth.api.endpoints_api import EndpointsApi from bandwidth.api.mfa_api import MFAApi from bandwidth.api.media_api import MediaApi from bandwidth.api.messages_api import MessagesApi diff --git a/bandwidth/api/endpoints_api.py b/bandwidth/api/endpoints_api.py new file mode 100644 index 00000000..e8b26ba3 --- /dev/null +++ b/bandwidth/api/endpoints_api.py @@ -0,0 +1,1659 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from bandwidth.models.create_endpoint_response import CreateEndpointResponse +from bandwidth.models.create_web_rtc_connection_request import CreateWebRtcConnectionRequest +from bandwidth.models.endpoint_response import EndpointResponse +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from bandwidth.models.list_endpoints_response import ListEndpointsResponse + +from bandwidth.api_client import ApiClient, RequestSerialized +from bandwidth.api_response import ApiResponse +from bandwidth.rest import RESTResponseType + + +class EndpointsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_endpoint( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + body: CreateWebRtcConnectionRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> CreateEndpointResponse: + """Create Endpoint + + Creates a new Endpoint for the specified account. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param body: (required) + :type body: CreateWebRtcConnectionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_endpoint_serialize( + account_id=account_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateEndpointResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_endpoint_with_http_info( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + body: CreateWebRtcConnectionRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[CreateEndpointResponse]: + """Create Endpoint + + Creates a new Endpoint for the specified account. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param body: (required) + :type body: CreateWebRtcConnectionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_endpoint_serialize( + account_id=account_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateEndpointResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_endpoint_without_preload_content( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + body: CreateWebRtcConnectionRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Create Endpoint + + Creates a new Endpoint for the specified account. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param body: (required) + :type body: CreateWebRtcConnectionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_endpoint_serialize( + account_id=account_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateEndpointResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_endpoint_serialize( + self, + account_id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api.bandwidth.com/v2' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if account_id is not None: + _path_params['accountId'] = account_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'Basic', + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/accounts/{accountId}/endpoints', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_endpoint( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> None: + """Delete Endpoint + + Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param endpoint_id: BRTC Endpoint ID. (required) + :type endpoint_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_endpoint_serialize( + account_id=account_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_endpoint_with_http_info( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[None]: + """Delete Endpoint + + Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param endpoint_id: BRTC Endpoint ID. (required) + :type endpoint_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_endpoint_serialize( + account_id=account_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_endpoint_without_preload_content( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Delete Endpoint + + Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param endpoint_id: BRTC Endpoint ID. (required) + :type endpoint_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_endpoint_serialize( + account_id=account_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_endpoint_serialize( + self, + account_id, + endpoint_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api.bandwidth.com/v2' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if account_id is not None: + _path_params['accountId'] = account_id + if endpoint_id is not None: + _path_params['endpointId'] = endpoint_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Basic', + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/accounts/{accountId}/endpoints/{endpointId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_endpoint( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> EndpointResponse: + """Get Endpoint + + Returns information about the specified endpoint. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param endpoint_id: BRTC Endpoint ID. (required) + :type endpoint_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_serialize( + account_id=account_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_endpoint_with_http_info( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[EndpointResponse]: + """Get Endpoint + + Returns information about the specified endpoint. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param endpoint_id: BRTC Endpoint ID. (required) + :type endpoint_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_serialize( + account_id=account_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_endpoint_without_preload_content( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Get Endpoint + + Returns information about the specified endpoint. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param endpoint_id: BRTC Endpoint ID. (required) + :type endpoint_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_endpoint_serialize( + account_id=account_id, + endpoint_id=endpoint_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EndpointResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_endpoint_serialize( + self, + account_id, + endpoint_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api.bandwidth.com/v2' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if account_id is not None: + _path_params['accountId'] = account_id + if endpoint_id is not None: + _path_params['endpointId'] = endpoint_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Basic', + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/accounts/{accountId}/endpoints/{endpointId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_endpoints( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + type: Annotated[Optional[EndpointTypeEnum], Field(description="The type of endpoint.")] = None, + status: Annotated[Optional[EndpointStatusEnum], Field(description="The status of the endpoint.")] = None, + after_cursor: Annotated[Optional[StrictStr], Field(description="The cursor to use for pagination. This is the value of the `next` link in the previous response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The maximum number of endpoints to return in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ListEndpointsResponse: + """List Endpoints + + Returns a list of endpoints associated with the specified account. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param type: The type of endpoint. + :type type: EndpointTypeEnum + :param status: The status of the endpoint. + :type status: EndpointStatusEnum + :param after_cursor: The cursor to use for pagination. This is the value of the `next` link in the previous response. + :type after_cursor: str + :param limit: The maximum number of endpoints to return in the response. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_endpoints_serialize( + account_id=account_id, + type=type, + status=status, + after_cursor=after_cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListEndpointsResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_endpoints_with_http_info( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + type: Annotated[Optional[EndpointTypeEnum], Field(description="The type of endpoint.")] = None, + status: Annotated[Optional[EndpointStatusEnum], Field(description="The status of the endpoint.")] = None, + after_cursor: Annotated[Optional[StrictStr], Field(description="The cursor to use for pagination. This is the value of the `next` link in the previous response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The maximum number of endpoints to return in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[ListEndpointsResponse]: + """List Endpoints + + Returns a list of endpoints associated with the specified account. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param type: The type of endpoint. + :type type: EndpointTypeEnum + :param status: The status of the endpoint. + :type status: EndpointStatusEnum + :param after_cursor: The cursor to use for pagination. This is the value of the `next` link in the previous response. + :type after_cursor: str + :param limit: The maximum number of endpoints to return in the response. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_endpoints_serialize( + account_id=account_id, + type=type, + status=status, + after_cursor=after_cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListEndpointsResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_endpoints_without_preload_content( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + type: Annotated[Optional[EndpointTypeEnum], Field(description="The type of endpoint.")] = None, + status: Annotated[Optional[EndpointStatusEnum], Field(description="The status of the endpoint.")] = None, + after_cursor: Annotated[Optional[StrictStr], Field(description="The cursor to use for pagination. This is the value of the `next` link in the previous response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The maximum number of endpoints to return in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """List Endpoints + + Returns a list of endpoints associated with the specified account. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param type: The type of endpoint. + :type type: EndpointTypeEnum + :param status: The status of the endpoint. + :type status: EndpointStatusEnum + :param after_cursor: The cursor to use for pagination. This is the value of the `next` link in the previous response. + :type after_cursor: str + :param limit: The maximum number of endpoints to return in the response. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_endpoints_serialize( + account_id=account_id, + type=type, + status=status, + after_cursor=after_cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListEndpointsResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_endpoints_serialize( + self, + account_id, + type, + status, + after_cursor, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api.bandwidth.com/v2' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if account_id is not None: + _path_params['accountId'] = account_id + # process the query parameters + if type is not None: + + _query_params.append(('type', type.value)) + + if status is not None: + + _query_params.append(('status', status.value)) + + if after_cursor is not None: + + _query_params.append(('afterCursor', after_cursor)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Basic', + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/accounts/{accountId}/endpoints', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_endpoint_bxml( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + body: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> None: + """Update Endpoint BXML + + Updates the BXML for the specified endpoint. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param endpoint_id: BRTC Endpoint ID. (required) + :type endpoint_id: str + :param body: (required) + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_endpoint_bxml_serialize( + account_id=account_id, + endpoint_id=endpoint_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_endpoint_bxml_with_http_info( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + body: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[None]: + """Update Endpoint BXML + + Updates the BXML for the specified endpoint. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param endpoint_id: BRTC Endpoint ID. (required) + :type endpoint_id: str + :param body: (required) + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_endpoint_bxml_serialize( + account_id=account_id, + endpoint_id=endpoint_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_endpoint_bxml_without_preload_content( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + body: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Update Endpoint BXML + + Updates the BXML for the specified endpoint. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param endpoint_id: BRTC Endpoint ID. (required) + :type endpoint_id: str + :param body: (required) + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_endpoint_bxml_serialize( + account_id=account_id, + endpoint_id=endpoint_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '405': "ErrorResponse", + '415': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_endpoint_bxml_serialize( + self, + account_id, + endpoint_id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api.bandwidth.com/v2' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if account_id is not None: + _path_params['accountId'] = account_id + if endpoint_id is not None: + _path_params['endpointId'] = endpoint_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/xml' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'Basic', + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/accounts/{accountId}/endpoints/{endpointId}/bxml', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/bandwidth/models/__init__.py b/bandwidth/models/__init__.py index 58a7cc68..93714014 100644 --- a/bandwidth/models/__init__.py +++ b/bandwidth/models/__init__.py @@ -53,16 +53,31 @@ from bandwidth.models.create_async_bulk_lookup_response_data import CreateAsyncBulkLookupResponseData from bandwidth.models.create_call import CreateCall from bandwidth.models.create_call_response import CreateCallResponse +from bandwidth.models.create_endpoint_request_base import CreateEndpointRequestBase +from bandwidth.models.create_endpoint_response import CreateEndpointResponse +from bandwidth.models.create_endpoint_response_object import CreateEndpointResponseObject from bandwidth.models.create_message_request_error import CreateMessageRequestError from bandwidth.models.create_multi_channel_message_response import CreateMultiChannelMessageResponse from bandwidth.models.create_sync_lookup_response import CreateSyncLookupResponse from bandwidth.models.create_sync_lookup_response_data import CreateSyncLookupResponseData +from bandwidth.models.create_web_rtc_connection_request import CreateWebRtcConnectionRequest from bandwidth.models.deactivation_event_enum import DeactivationEventEnum +from bandwidth.models.device import Device +from bandwidth.models.device_status_enum import DeviceStatusEnum from bandwidth.models.disconnect_callback import DisconnectCallback from bandwidth.models.diversion import Diversion from bandwidth.models.dtmf_callback import DtmfCallback +from bandwidth.models.endpoint import Endpoint +from bandwidth.models.endpoint_direction_enum import EndpointDirectionEnum +from bandwidth.models.endpoint_event import EndpointEvent +from bandwidth.models.endpoint_event_type_enum import EndpointEventTypeEnum +from bandwidth.models.endpoint_response import EndpointResponse +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from bandwidth.models.endpoints import Endpoints from bandwidth.models.error import Error from bandwidth.models.error_object import ErrorObject +from bandwidth.models.error_response import ErrorResponse from bandwidth.models.error_source import ErrorSource from bandwidth.models.failure_webhook import FailureWebhook from bandwidth.models.field_error import FieldError @@ -80,6 +95,7 @@ from bandwidth.models.link import Link from bandwidth.models.link_schema import LinkSchema from bandwidth.models.links_object import LinksObject +from bandwidth.models.list_endpoints_response import ListEndpointsResponse from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum from bandwidth.models.list_message_item import ListMessageItem from bandwidth.models.lookup_error_response import LookupErrorResponse @@ -123,6 +139,7 @@ from bandwidth.models.multi_channel_message_request import MultiChannelMessageRequest from bandwidth.models.multi_channel_message_response_data import MultiChannelMessageResponseData from bandwidth.models.opt_in_workflow import OptInWorkflow +from bandwidth.models.page import Page from bandwidth.models.page_info import PageInfo from bandwidth.models.priority_enum import PriorityEnum from bandwidth.models.product_type_enum import ProductTypeEnum @@ -151,6 +168,8 @@ from bandwidth.models.recording_transcriptions import RecordingTranscriptions from bandwidth.models.redirect_callback import RedirectCallback from bandwidth.models.redirect_method_enum import RedirectMethodEnum +from bandwidth.models.sip_connection_metadata import SipConnectionMetadata +from bandwidth.models.sip_credentials import SipCredentials from bandwidth.models.sms_message_content import SmsMessageContent from bandwidth.models.standalone_card_orientation_enum import StandaloneCardOrientationEnum from bandwidth.models.status_callback import StatusCallback diff --git a/bandwidth/models/create_endpoint_request_base.py b/bandwidth/models/create_endpoint_request_base.py new file mode 100644 index 00000000..1100a9b3 --- /dev/null +++ b/bandwidth/models/create_endpoint_request_base.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from bandwidth.models.endpoint_direction_enum import EndpointDirectionEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from typing import Optional, Set +from typing_extensions import Self + +class CreateEndpointRequestBase(BaseModel): + """ + CreateEndpointRequestBase + """ # noqa: E501 + type: EndpointTypeEnum + direction: EndpointDirectionEnum + event_callback_url: Optional[StrictStr] = Field(default=None, description="The URL to send event callbacks to.", alias="eventCallbackUrl") + event_fallback_url: Optional[StrictStr] = Field(default=None, description="The URL to send event fallbacks to.", alias="eventFallbackUrl") + tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A tag for the endpoint.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "direction", "eventCallbackUrl", "eventFallbackUrl", "tag"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateEndpointRequestBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateEndpointRequestBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "direction": obj.get("direction"), + "eventCallbackUrl": obj.get("eventCallbackUrl"), + "eventFallbackUrl": obj.get("eventFallbackUrl"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/create_endpoint_response.py b/bandwidth/models/create_endpoint_response.py new file mode 100644 index 00000000..6dc0b641 --- /dev/null +++ b/bandwidth/models/create_endpoint_response.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from bandwidth.models.create_endpoint_response_object import CreateEndpointResponseObject +from bandwidth.models.error import Error +from bandwidth.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class CreateEndpointResponse(BaseModel): + """ + CreateEndpointResponse + """ # noqa: E501 + links: List[Link] + data: CreateEndpointResponseObject + errors: List[Error] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["links", "data", "errors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateEndpointResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in links (list) + _items = [] + if self.links: + for _item_links in self.links: + if _item_links: + _items.append(_item_links.to_dict()) + _dict['links'] = _items + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict['errors'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateEndpointResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "links": [Link.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "data": CreateEndpointResponseObject.from_dict(obj["data"]) if obj.get("data") is not None else None, + "errors": [Error.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/create_endpoint_response_object.py b/bandwidth/models/create_endpoint_response_object.py new file mode 100644 index 00000000..8cddb956 --- /dev/null +++ b/bandwidth/models/create_endpoint_response_object.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from bandwidth.models.device import Device +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from typing import Optional, Set +from typing_extensions import Self + +class CreateEndpointResponseObject(BaseModel): + """ + CreateEndpointResponseObject + """ # noqa: E501 + endpoint_id: StrictStr = Field(description="The unique ID of the endpoint.", alias="endpointId") + type: EndpointTypeEnum + status: EndpointStatusEnum + creation_timestamp: datetime = Field(description="The time the endpoint was created. In ISO-8601 format.", alias="creationTimestamp") + expiration_timestamp: datetime = Field(description="The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours.", alias="expirationTimestamp") + tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A tag for the endpoint.") + devices: Optional[List[Device]] = None + token: StrictStr = Field(description="The json web token specific to the endpoint. Used to authenticate the client with the media gateway.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "tag", "devices", "token"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateEndpointResponseObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in devices (list) + _items = [] + if self.devices: + for _item_devices in self.devices: + if _item_devices: + _items.append(_item_devices.to_dict()) + _dict['devices'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateEndpointResponseObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "endpointId": obj.get("endpointId"), + "type": obj.get("type"), + "status": obj.get("status"), + "creationTimestamp": obj.get("creationTimestamp"), + "expirationTimestamp": obj.get("expirationTimestamp"), + "tag": obj.get("tag"), + "devices": [Device.from_dict(_item) for _item in obj["devices"]] if obj.get("devices") is not None else None, + "token": obj.get("token") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/create_web_rtc_connection_request.py b/bandwidth/models/create_web_rtc_connection_request.py new file mode 100644 index 00000000..3b393dbf --- /dev/null +++ b/bandwidth/models/create_web_rtc_connection_request.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from bandwidth.models.endpoint_direction_enum import EndpointDirectionEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from typing import Optional, Set +from typing_extensions import Self + +class CreateWebRtcConnectionRequest(BaseModel): + """ + CreateWebRtcConnectionRequest + """ # noqa: E501 + type: EndpointTypeEnum + direction: EndpointDirectionEnum + event_callback_url: Optional[StrictStr] = Field(default=None, description="The URL to send event callbacks to.", alias="eventCallbackUrl") + event_fallback_url: Optional[StrictStr] = Field(default=None, description="The URL to send event fallbacks to.", alias="eventFallbackUrl") + tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A tag for the endpoint.") + connection_metadata: Optional[Dict[str, Any]] = Field(default=None, alias="connectionMetadata") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "direction", "eventCallbackUrl", "eventFallbackUrl", "tag", "connectionMetadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateWebRtcConnectionRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateWebRtcConnectionRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "direction": obj.get("direction"), + "eventCallbackUrl": obj.get("eventCallbackUrl"), + "eventFallbackUrl": obj.get("eventFallbackUrl"), + "tag": obj.get("tag"), + "connectionMetadata": obj.get("connectionMetadata") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/device.py b/bandwidth/models/device.py new file mode 100644 index 00000000..c59ebaea --- /dev/null +++ b/bandwidth/models/device.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from bandwidth.models.device_status_enum import DeviceStatusEnum +from typing import Optional, Set +from typing_extensions import Self + +class Device(BaseModel): + """ + Device + """ # noqa: E501 + device_id: StrictStr = Field(description="The unique ID of the device.", alias="deviceId") + device_name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The name of the device.", alias="deviceName") + status: DeviceStatusEnum + creation_timestamp: datetime = Field(description="The time the device was created. In ISO-8601 format.", alias="creationTimestamp") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["deviceId", "deviceName", "status", "creationTimestamp"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Device from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Device from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "deviceId": obj.get("deviceId"), + "deviceName": obj.get("deviceName"), + "status": obj.get("status"), + "creationTimestamp": obj.get("creationTimestamp") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/device_status_enum.py b/bandwidth/models/device_status_enum.py new file mode 100644 index 00000000..4234eb05 --- /dev/null +++ b/bandwidth/models/device_status_enum.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class DeviceStatusEnum(str, Enum): + """ + DeviceStatusEnum + """ + + """ + allowed enum values + """ + CONNECTED = 'CONNECTED' + DISCONNECTED = 'DISCONNECTED' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DeviceStatusEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/endpoint.py b/bandwidth/models/endpoint.py new file mode 100644 index 00000000..ee70f584 --- /dev/null +++ b/bandwidth/models/endpoint.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from bandwidth.models.device import Device +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from typing import Optional, Set +from typing_extensions import Self + +class Endpoint(BaseModel): + """ + Endpoint + """ # noqa: E501 + endpoint_id: StrictStr = Field(description="The unique ID of the endpoint.", alias="endpointId") + type: EndpointTypeEnum + status: EndpointStatusEnum + creation_timestamp: datetime = Field(description="The time the endpoint was created. In ISO-8601 format.", alias="creationTimestamp") + expiration_timestamp: datetime = Field(description="The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours.", alias="expirationTimestamp") + tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A tag for the endpoint.") + devices: Optional[List[Device]] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "tag", "devices"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Endpoint from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in devices (list) + _items = [] + if self.devices: + for _item_devices in self.devices: + if _item_devices: + _items.append(_item_devices.to_dict()) + _dict['devices'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Endpoint from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "endpointId": obj.get("endpointId"), + "type": obj.get("type"), + "status": obj.get("status"), + "creationTimestamp": obj.get("creationTimestamp"), + "expirationTimestamp": obj.get("expirationTimestamp"), + "tag": obj.get("tag"), + "devices": [Device.from_dict(_item) for _item in obj["devices"]] if obj.get("devices") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/endpoint_direction_enum.py b/bandwidth/models/endpoint_direction_enum.py new file mode 100644 index 00000000..6a296a26 --- /dev/null +++ b/bandwidth/models/endpoint_direction_enum.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EndpointDirectionEnum(str, Enum): + """ + EndpointDirectionEnum + """ + + """ + allowed enum values + """ + INBOUND = 'INBOUND' + OUTBOUND = 'OUTBOUND' + BIDIRECTIONAL = 'BIDIRECTIONAL' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointDirectionEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/endpoint_event.py b/bandwidth/models/endpoint_event.py new file mode 100644 index 00000000..2f7f907d --- /dev/null +++ b/bandwidth/models/endpoint_event.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from bandwidth.models.device import Device +from bandwidth.models.endpoint_event_type_enum import EndpointEventTypeEnum +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from typing import Optional, Set +from typing_extensions import Self + +class EndpointEvent(BaseModel): + """ + An event that occurred on an endpoint. + """ # noqa: E501 + endpoint_id: StrictStr = Field(description="The unique ID of the endpoint.", alias="endpointId") + type: EndpointTypeEnum + status: EndpointStatusEnum + creation_timestamp: datetime = Field(description="The time the endpoint was created. In ISO-8601 format.", alias="creationTimestamp") + expiration_timestamp: datetime = Field(description="The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours.", alias="expirationTimestamp") + tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A tag for the endpoint.") + event_time: datetime = Field(description="The time the event occurred. In ISO-8601 format.", alias="eventTime") + event_type: EndpointEventTypeEnum = Field(alias="eventType") + device: Optional[Device] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "tag", "eventTime", "eventType", "device"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of device + if self.device: + _dict['device'] = self.device.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "endpointId": obj.get("endpointId"), + "type": obj.get("type"), + "status": obj.get("status"), + "creationTimestamp": obj.get("creationTimestamp"), + "expirationTimestamp": obj.get("expirationTimestamp"), + "tag": obj.get("tag"), + "eventTime": obj.get("eventTime"), + "eventType": obj.get("eventType"), + "device": Device.from_dict(obj["device"]) if obj.get("device") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/endpoint_event_type_enum.py b/bandwidth/models/endpoint_event_type_enum.py new file mode 100644 index 00000000..6ddeb0ed --- /dev/null +++ b/bandwidth/models/endpoint_event_type_enum.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EndpointEventTypeEnum(str, Enum): + """ + EndpointEventTypeEnum + """ + + """ + allowed enum values + """ + DEVICE_CONNECTED = 'DEVICE_CONNECTED' + DEVICE_DISCONNECTED = 'DEVICE_DISCONNECTED' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointEventTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/endpoint_response.py b/bandwidth/models/endpoint_response.py new file mode 100644 index 00000000..f2d89d88 --- /dev/null +++ b/bandwidth/models/endpoint_response.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from bandwidth.models.endpoint import Endpoint +from bandwidth.models.error import Error +from bandwidth.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class EndpointResponse(BaseModel): + """ + EndpointResponse + """ # noqa: E501 + links: List[Link] + data: Endpoint + errors: List[Error] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["links", "data", "errors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EndpointResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in links (list) + _items = [] + if self.links: + for _item_links in self.links: + if _item_links: + _items.append(_item_links.to_dict()) + _dict['links'] = _items + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict['errors'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EndpointResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "links": [Link.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "data": Endpoint.from_dict(obj["data"]) if obj.get("data") is not None else None, + "errors": [Error.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/endpoint_status_enum.py b/bandwidth/models/endpoint_status_enum.py new file mode 100644 index 00000000..4f7ff564 --- /dev/null +++ b/bandwidth/models/endpoint_status_enum.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EndpointStatusEnum(str, Enum): + """ + EndpointStatusEnum + """ + + """ + allowed enum values + """ + CONNECTED = 'CONNECTED' + DISCONNECTED = 'DISCONNECTED' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointStatusEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/endpoint_type_enum.py b/bandwidth/models/endpoint_type_enum.py new file mode 100644 index 00000000..7373c2ea --- /dev/null +++ b/bandwidth/models/endpoint_type_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EndpointTypeEnum(str, Enum): + """ + EndpointTypeEnum + """ + + """ + allowed enum values + """ + WEBRTC = 'WEBRTC' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EndpointTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/endpoints.py b/bandwidth/models/endpoints.py new file mode 100644 index 00000000..57097750 --- /dev/null +++ b/bandwidth/models/endpoints.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from typing import Optional, Set +from typing_extensions import Self + +class Endpoints(BaseModel): + """ + Endpoints + """ # noqa: E501 + endpoint_id: StrictStr = Field(description="The unique ID of the endpoint.", alias="endpointId") + type: EndpointTypeEnum + status: EndpointStatusEnum + creation_timestamp: datetime = Field(description="The time the endpoint was created. In ISO-8601 format.", alias="creationTimestamp") + expiration_timestamp: datetime = Field(description="The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours.", alias="expirationTimestamp") + tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A tag for the endpoint.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "tag"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Endpoints from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Endpoints from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "endpointId": obj.get("endpointId"), + "type": obj.get("type"), + "status": obj.get("status"), + "creationTimestamp": obj.get("creationTimestamp"), + "expirationTimestamp": obj.get("expirationTimestamp"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/error_response.py b/bandwidth/models/error_response.py new file mode 100644 index 00000000..9058ff78 --- /dev/null +++ b/bandwidth/models/error_response.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from bandwidth.models.error import Error +from bandwidth.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class ErrorResponse(BaseModel): + """ + ErrorResponse + """ # noqa: E501 + links: List[Link] + data: Optional[Dict[str, Any]] + errors: List[Error] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["links", "data", "errors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in links (list) + _items = [] + if self.links: + for _item_links in self.links: + if _item_links: + _items.append(_item_links.to_dict()) + _dict['links'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict['errors'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "links": [Link.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "data": obj.get("data"), + "errors": [Error.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/list_endpoints_response.py b/bandwidth/models/list_endpoints_response.py new file mode 100644 index 00000000..ece66219 --- /dev/null +++ b/bandwidth/models/list_endpoints_response.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from bandwidth.models.endpoints import Endpoints +from bandwidth.models.error import Error +from bandwidth.models.link import Link +from bandwidth.models.page import Page +from typing import Optional, Set +from typing_extensions import Self + +class ListEndpointsResponse(BaseModel): + """ + ListEndpointsResponse + """ # noqa: E501 + links: List[Link] + page: Optional[Page] = None + data: List[Endpoints] + errors: List[Error] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["links", "page", "data", "errors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListEndpointsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in links (list) + _items = [] + if self.links: + for _item_links in self.links: + if _item_links: + _items.append(_item_links.to_dict()) + _dict['links'] = _items + # override the default output from pydantic by calling `to_dict()` of page + if self.page: + _dict['page'] = self.page.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict['errors'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListEndpointsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "links": [Link.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "page": Page.from_dict(obj["page"]) if obj.get("page") is not None else None, + "data": [Endpoints.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "errors": [Error.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/page.py b/bandwidth/models/page.py new file mode 100644 index 00000000..519fe076 --- /dev/null +++ b/bandwidth/models/page.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class Page(BaseModel): + """ + Page + """ # noqa: E501 + page_size: Annotated[int, Field(strict=True, ge=0)] = Field(description="The number of items per page.", alias="pageSize") + total_elements: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The total number of items.", alias="totalElements") + total_pages: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The total number of pages.", alias="totalPages") + page_number: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The current page number.", alias="pageNumber") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["pageSize", "totalElements", "totalPages", "pageNumber"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Page from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Page from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pageSize": obj.get("pageSize"), + "totalElements": obj.get("totalElements"), + "totalPages": obj.get("totalPages"), + "pageNumber": obj.get("pageNumber") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/sip_connection_metadata.py b/bandwidth/models/sip_connection_metadata.py new file mode 100644 index 00000000..2082adca --- /dev/null +++ b/bandwidth/models/sip_connection_metadata.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from bandwidth.models.sip_credentials import SipCredentials +from typing import Optional, Set +from typing_extensions import Self + +class SipConnectionMetadata(BaseModel): + """ + SipConnectionMetadata + """ # noqa: E501 + ip_address: Optional[StrictStr] = Field(default=None, description="The IP address of the SIP connection.", alias="ipAddress") + port: Optional[StrictInt] = Field(default=None, description="The port of the SIP connection.") + credentials: Optional[SipCredentials] = None + uui_header: Optional[StrictStr] = Field(default=None, description="The User-to-User Information header for the SIP connection.", alias="uuiHeader") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["ipAddress", "port", "credentials", "uuiHeader"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SipConnectionMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of credentials + if self.credentials: + _dict['credentials'] = self.credentials.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SipConnectionMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipAddress": obj.get("ipAddress"), + "port": obj.get("port"), + "credentials": SipCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None, + "uuiHeader": obj.get("uuiHeader") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/sip_credentials.py b/bandwidth/models/sip_credentials.py new file mode 100644 index 00000000..cce48c9f --- /dev/null +++ b/bandwidth/models/sip_credentials.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SipCredentials(BaseModel): + """ + SipCredentials + """ # noqa: E501 + username: Optional[StrictStr] = Field(default=None, description="The username for the SIP connection.") + password: Optional[StrictStr] = Field(default=None, description="The password for the SIP connection.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["username", "password"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SipCredentials from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SipCredentials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "username": obj.get("username"), + "password": obj.get("password") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/docs/Callback.md b/docs/Callback.md index f9923bf8..f9c2822e 100644 --- a/docs/Callback.md +++ b/docs/Callback.md @@ -9,11 +9,11 @@ Name | Type | Description | Notes **time** | **datetime** | | **event_time** | **datetime** | Represents the time at which the message was read, for `message-read` callbacks. | [optional] **type** | [**InboundCallbackTypeEnum**](InboundCallbackTypeEnum.md) | | -**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | +**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | **description** | **str** | A detailed description of the event described by the callback. | **message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | **error_code** | **int** | Optional error code, applicable only when type is `message-failed`. | [optional] -**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] +**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] ## Example diff --git a/docs/CreateCall.md b/docs/CreateCall.md index 935ed3ca..d9c18a34 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **to** | **str** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | **var_from** | **str** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`) even if `privacy` is set to true. | **privacy** | **bool** | Hide the calling number. The `displayName` field can be used to customize the displayed name. | [optional] -**display_name** | **str** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] +**display_name** | **str** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] **uui** | **str** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt', 'base64' and 'hex' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] **application_id** | **str** | The id of the application associated with the `from` number. | **answer_url** | **str** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | diff --git a/docs/CreateEndpointRequestBase.md b/docs/CreateEndpointRequestBase.md new file mode 100644 index 00000000..97efed29 --- /dev/null +++ b/docs/CreateEndpointRequestBase.md @@ -0,0 +1,33 @@ +# CreateEndpointRequestBase + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | +**direction** | [**EndpointDirectionEnum**](EndpointDirectionEnum.md) | | +**event_callback_url** | **str** | The URL to send event callbacks to. | [optional] +**event_fallback_url** | **str** | The URL to send event fallbacks to. | [optional] +**tag** | **str** | A tag for the endpoint. | [optional] + +## Example + +```python +from bandwidth.models.create_endpoint_request_base import CreateEndpointRequestBase + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateEndpointRequestBase from a JSON string +create_endpoint_request_base_instance = CreateEndpointRequestBase.from_json(json) +# print the JSON string representation of the object +print(CreateEndpointRequestBase.to_json()) + +# convert the object into a dict +create_endpoint_request_base_dict = create_endpoint_request_base_instance.to_dict() +# create an instance of CreateEndpointRequestBase from a dict +create_endpoint_request_base_from_dict = CreateEndpointRequestBase.from_dict(create_endpoint_request_base_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateEndpointResponse.md b/docs/CreateEndpointResponse.md new file mode 100644 index 00000000..016879e6 --- /dev/null +++ b/docs/CreateEndpointResponse.md @@ -0,0 +1,31 @@ +# CreateEndpointResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**List[Link]**](Link.md) | | +**data** | [**CreateEndpointResponseObject**](CreateEndpointResponseObject.md) | | +**errors** | [**List[Error]**](Error.md) | | + +## Example + +```python +from bandwidth.models.create_endpoint_response import CreateEndpointResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateEndpointResponse from a JSON string +create_endpoint_response_instance = CreateEndpointResponse.from_json(json) +# print the JSON string representation of the object +print(CreateEndpointResponse.to_json()) + +# convert the object into a dict +create_endpoint_response_dict = create_endpoint_response_instance.to_dict() +# create an instance of CreateEndpointResponse from a dict +create_endpoint_response_from_dict = CreateEndpointResponse.from_dict(create_endpoint_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateEndpointResponseObject.md b/docs/CreateEndpointResponseObject.md new file mode 100644 index 00000000..47383b2c --- /dev/null +++ b/docs/CreateEndpointResponseObject.md @@ -0,0 +1,36 @@ +# CreateEndpointResponseObject + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endpoint_id** | **str** | The unique ID of the endpoint. | +**type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | +**status** | [**EndpointStatusEnum**](EndpointStatusEnum.md) | | +**creation_timestamp** | **datetime** | The time the endpoint was created. In ISO-8601 format. | +**expiration_timestamp** | **datetime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | +**tag** | **str** | A tag for the endpoint. | [optional] +**devices** | [**List[Device]**](Device.md) | | [optional] +**token** | **str** | The json web token specific to the endpoint. Used to authenticate the client with the media gateway. | + +## Example + +```python +from bandwidth.models.create_endpoint_response_object import CreateEndpointResponseObject + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateEndpointResponseObject from a JSON string +create_endpoint_response_object_instance = CreateEndpointResponseObject.from_json(json) +# print the JSON string representation of the object +print(CreateEndpointResponseObject.to_json()) + +# convert the object into a dict +create_endpoint_response_object_dict = create_endpoint_response_object_instance.to_dict() +# create an instance of CreateEndpointResponseObject from a dict +create_endpoint_response_object_from_dict = CreateEndpointResponseObject.from_dict(create_endpoint_response_object_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateWebRtcConnectionRequest.md b/docs/CreateWebRtcConnectionRequest.md new file mode 100644 index 00000000..69307ca6 --- /dev/null +++ b/docs/CreateWebRtcConnectionRequest.md @@ -0,0 +1,34 @@ +# CreateWebRtcConnectionRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | +**direction** | [**EndpointDirectionEnum**](EndpointDirectionEnum.md) | | +**event_callback_url** | **str** | The URL to send event callbacks to. | [optional] +**event_fallback_url** | **str** | The URL to send event fallbacks to. | [optional] +**tag** | **str** | A tag for the endpoint. | [optional] +**connection_metadata** | **object** | | [optional] + +## Example + +```python +from bandwidth.models.create_web_rtc_connection_request import CreateWebRtcConnectionRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateWebRtcConnectionRequest from a JSON string +create_web_rtc_connection_request_instance = CreateWebRtcConnectionRequest.from_json(json) +# print the JSON string representation of the object +print(CreateWebRtcConnectionRequest.to_json()) + +# convert the object into a dict +create_web_rtc_connection_request_dict = create_web_rtc_connection_request_instance.to_dict() +# create an instance of CreateWebRtcConnectionRequest from a dict +create_web_rtc_connection_request_from_dict = CreateWebRtcConnectionRequest.from_dict(create_web_rtc_connection_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Device.md b/docs/Device.md new file mode 100644 index 00000000..18908966 --- /dev/null +++ b/docs/Device.md @@ -0,0 +1,32 @@ +# Device + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**device_id** | **str** | The unique ID of the device. | +**device_name** | **str** | The name of the device. | [optional] +**status** | [**DeviceStatusEnum**](DeviceStatusEnum.md) | | +**creation_timestamp** | **datetime** | The time the device was created. In ISO-8601 format. | + +## Example + +```python +from bandwidth.models.device import Device + +# TODO update the JSON string below +json = "{}" +# create an instance of Device from a JSON string +device_instance = Device.from_json(json) +# print the JSON string representation of the object +print(Device.to_json()) + +# convert the object into a dict +device_dict = device_instance.to_dict() +# create an instance of Device from a dict +device_from_dict = Device.from_dict(device_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeviceStatusEnum.md b/docs/DeviceStatusEnum.md new file mode 100644 index 00000000..ce2c3a06 --- /dev/null +++ b/docs/DeviceStatusEnum.md @@ -0,0 +1,12 @@ +# DeviceStatusEnum + + +## Enum + +* `CONNECTED` (value: `'CONNECTED'`) + +* `DISCONNECTED` (value: `'DISCONNECTED'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Endpoint.md b/docs/Endpoint.md new file mode 100644 index 00000000..d32955af --- /dev/null +++ b/docs/Endpoint.md @@ -0,0 +1,35 @@ +# Endpoint + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endpoint_id** | **str** | The unique ID of the endpoint. | +**type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | +**status** | [**EndpointStatusEnum**](EndpointStatusEnum.md) | | +**creation_timestamp** | **datetime** | The time the endpoint was created. In ISO-8601 format. | +**expiration_timestamp** | **datetime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | +**tag** | **str** | A tag for the endpoint. | [optional] +**devices** | [**List[Device]**](Device.md) | | [optional] + +## Example + +```python +from bandwidth.models.endpoint import Endpoint + +# TODO update the JSON string below +json = "{}" +# create an instance of Endpoint from a JSON string +endpoint_instance = Endpoint.from_json(json) +# print the JSON string representation of the object +print(Endpoint.to_json()) + +# convert the object into a dict +endpoint_dict = endpoint_instance.to_dict() +# create an instance of Endpoint from a dict +endpoint_from_dict = Endpoint.from_dict(endpoint_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EndpointDirectionEnum.md b/docs/EndpointDirectionEnum.md new file mode 100644 index 00000000..2202cb53 --- /dev/null +++ b/docs/EndpointDirectionEnum.md @@ -0,0 +1,14 @@ +# EndpointDirectionEnum + + +## Enum + +* `INBOUND` (value: `'INBOUND'`) + +* `OUTBOUND` (value: `'OUTBOUND'`) + +* `BIDIRECTIONAL` (value: `'BIDIRECTIONAL'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EndpointEvent.md b/docs/EndpointEvent.md new file mode 100644 index 00000000..898bdf6c --- /dev/null +++ b/docs/EndpointEvent.md @@ -0,0 +1,38 @@ +# EndpointEvent + +An event that occurred on an endpoint. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endpoint_id** | **str** | The unique ID of the endpoint. | +**type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | +**status** | [**EndpointStatusEnum**](EndpointStatusEnum.md) | | +**creation_timestamp** | **datetime** | The time the endpoint was created. In ISO-8601 format. | +**expiration_timestamp** | **datetime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | +**tag** | **str** | A tag for the endpoint. | [optional] +**event_time** | **datetime** | The time the event occurred. In ISO-8601 format. | +**event_type** | [**EndpointEventTypeEnum**](EndpointEventTypeEnum.md) | | +**device** | [**Device**](Device.md) | | [optional] + +## Example + +```python +from bandwidth.models.endpoint_event import EndpointEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointEvent from a JSON string +endpoint_event_instance = EndpointEvent.from_json(json) +# print the JSON string representation of the object +print(EndpointEvent.to_json()) + +# convert the object into a dict +endpoint_event_dict = endpoint_event_instance.to_dict() +# create an instance of EndpointEvent from a dict +endpoint_event_from_dict = EndpointEvent.from_dict(endpoint_event_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EndpointEventTypeEnum.md b/docs/EndpointEventTypeEnum.md new file mode 100644 index 00000000..1297cbd5 --- /dev/null +++ b/docs/EndpointEventTypeEnum.md @@ -0,0 +1,12 @@ +# EndpointEventTypeEnum + + +## Enum + +* `DEVICE_CONNECTED` (value: `'DEVICE_CONNECTED'`) + +* `DEVICE_DISCONNECTED` (value: `'DEVICE_DISCONNECTED'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EndpointResponse.md b/docs/EndpointResponse.md new file mode 100644 index 00000000..530b77f4 --- /dev/null +++ b/docs/EndpointResponse.md @@ -0,0 +1,31 @@ +# EndpointResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**List[Link]**](Link.md) | | +**data** | [**Endpoint**](Endpoint.md) | | +**errors** | [**List[Error]**](Error.md) | | + +## Example + +```python +from bandwidth.models.endpoint_response import EndpointResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of EndpointResponse from a JSON string +endpoint_response_instance = EndpointResponse.from_json(json) +# print the JSON string representation of the object +print(EndpointResponse.to_json()) + +# convert the object into a dict +endpoint_response_dict = endpoint_response_instance.to_dict() +# create an instance of EndpointResponse from a dict +endpoint_response_from_dict = EndpointResponse.from_dict(endpoint_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EndpointStatusEnum.md b/docs/EndpointStatusEnum.md new file mode 100644 index 00000000..bef32325 --- /dev/null +++ b/docs/EndpointStatusEnum.md @@ -0,0 +1,12 @@ +# EndpointStatusEnum + + +## Enum + +* `CONNECTED` (value: `'CONNECTED'`) + +* `DISCONNECTED` (value: `'DISCONNECTED'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EndpointTypeEnum.md b/docs/EndpointTypeEnum.md new file mode 100644 index 00000000..d87faa67 --- /dev/null +++ b/docs/EndpointTypeEnum.md @@ -0,0 +1,10 @@ +# EndpointTypeEnum + + +## Enum + +* `WEBRTC` (value: `'WEBRTC'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Endpoints.md b/docs/Endpoints.md new file mode 100644 index 00000000..010e68e2 --- /dev/null +++ b/docs/Endpoints.md @@ -0,0 +1,34 @@ +# Endpoints + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endpoint_id** | **str** | The unique ID of the endpoint. | +**type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | +**status** | [**EndpointStatusEnum**](EndpointStatusEnum.md) | | +**creation_timestamp** | **datetime** | The time the endpoint was created. In ISO-8601 format. | +**expiration_timestamp** | **datetime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | +**tag** | **str** | A tag for the endpoint. | [optional] + +## Example + +```python +from bandwidth.models.endpoints import Endpoints + +# TODO update the JSON string below +json = "{}" +# create an instance of Endpoints from a JSON string +endpoints_instance = Endpoints.from_json(json) +# print the JSON string representation of the object +print(Endpoints.to_json()) + +# convert the object into a dict +endpoints_dict = endpoints_instance.to_dict() +# create an instance of Endpoints from a dict +endpoints_from_dict = Endpoints.from_dict(endpoints_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EndpointsApi.md b/docs/EndpointsApi.md new file mode 100644 index 00000000..63e3a31b --- /dev/null +++ b/docs/EndpointsApi.md @@ -0,0 +1,498 @@ +# bandwidth.EndpointsApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_endpoint**](EndpointsApi.md#create_endpoint) | **POST** /accounts/{accountId}/endpoints | Create Endpoint +[**delete_endpoint**](EndpointsApi.md#delete_endpoint) | **DELETE** /accounts/{accountId}/endpoints/{endpointId} | Delete Endpoint +[**get_endpoint**](EndpointsApi.md#get_endpoint) | **GET** /accounts/{accountId}/endpoints/{endpointId} | Get Endpoint +[**list_endpoints**](EndpointsApi.md#list_endpoints) | **GET** /accounts/{accountId}/endpoints | List Endpoints +[**update_endpoint_bxml**](EndpointsApi.md#update_endpoint_bxml) | **PUT** /accounts/{accountId}/endpoints/{endpointId}/bxml | Update Endpoint BXML + + +# **create_endpoint** +> CreateEndpointResponse create_endpoint(account_id, body) + +Create Endpoint + +Creates a new Endpoint for the specified account. + +### Example + +* Basic Authentication (Basic): +* OAuth Authentication (OAuth2): + +```python +import bandwidth +from bandwidth.models.create_endpoint_response import CreateEndpointResponse +from bandwidth.models.create_web_rtc_connection_request import CreateWebRtcConnectionRequest +from bandwidth.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = bandwidth.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: Basic +configuration = bandwidth.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure your client ID and secret for OAuth +configuration = bandwidth.Configuration( + client_id = os.environ["CLIENT_ID"], + client_secret = os.environ["CLIENT_SECRET"] +) + +# Enter a context with an instance of the API client +with bandwidth.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = bandwidth.EndpointsApi(api_client) + account_id = '5500123' # str | Your Bandwidth Account ID. + body = bandwidth.CreateWebRtcConnectionRequest() # CreateWebRtcConnectionRequest | + + try: + # Create Endpoint + api_response = api_instance.create_endpoint(account_id, body) + print("The response of EndpointsApi->create_endpoint:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointsApi->create_endpoint: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Your Bandwidth Account ID. | + **body** | **CreateWebRtcConnectionRequest**| | + +### Return type + +[**CreateEndpointResponse**](CreateEndpointResponse.md) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**405** | Method Not Allowed | - | +**415** | Unsupported Media Type | - | +**429** | Too Many Requests | - | +**500** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_endpoint** +> delete_endpoint(account_id, endpoint_id) + +Delete Endpoint + +Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + +### Example + +* Basic Authentication (Basic): +* OAuth Authentication (OAuth2): + +```python +import bandwidth +from bandwidth.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = bandwidth.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: Basic +configuration = bandwidth.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure your client ID and secret for OAuth +configuration = bandwidth.Configuration( + client_id = os.environ["CLIENT_ID"], + client_secret = os.environ["CLIENT_SECRET"] +) + +# Enter a context with an instance of the API client +with bandwidth.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = bandwidth.EndpointsApi(api_client) + account_id = '5500123' # str | Your Bandwidth Account ID. + endpoint_id = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | BRTC Endpoint ID. + + try: + # Delete Endpoint + api_instance.delete_endpoint(account_id, endpoint_id) + except Exception as e: + print("Exception when calling EndpointsApi->delete_endpoint: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Your Bandwidth Account ID. | + **endpoint_id** | **str**| BRTC Endpoint ID. | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**405** | Method Not Allowed | - | +**415** | Unsupported Media Type | - | +**429** | Too Many Requests | - | +**500** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_endpoint** +> EndpointResponse get_endpoint(account_id, endpoint_id) + +Get Endpoint + +Returns information about the specified endpoint. + +### Example + +* Basic Authentication (Basic): +* OAuth Authentication (OAuth2): + +```python +import bandwidth +from bandwidth.models.endpoint_response import EndpointResponse +from bandwidth.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = bandwidth.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: Basic +configuration = bandwidth.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure your client ID and secret for OAuth +configuration = bandwidth.Configuration( + client_id = os.environ["CLIENT_ID"], + client_secret = os.environ["CLIENT_SECRET"] +) + +# Enter a context with an instance of the API client +with bandwidth.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = bandwidth.EndpointsApi(api_client) + account_id = '5500123' # str | Your Bandwidth Account ID. + endpoint_id = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | BRTC Endpoint ID. + + try: + # Get Endpoint + api_response = api_instance.get_endpoint(account_id, endpoint_id) + print("The response of EndpointsApi->get_endpoint:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointsApi->get_endpoint: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Your Bandwidth Account ID. | + **endpoint_id** | **str**| BRTC Endpoint ID. | + +### Return type + +[**EndpointResponse**](EndpointResponse.md) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**405** | Method Not Allowed | - | +**415** | Unsupported Media Type | - | +**429** | Too Many Requests | - | +**500** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_endpoints** +> ListEndpointsResponse list_endpoints(account_id, type=type, status=status, after_cursor=after_cursor, limit=limit) + +List Endpoints + +Returns a list of endpoints associated with the specified account. + +### Example + +* Basic Authentication (Basic): +* OAuth Authentication (OAuth2): + +```python +import bandwidth +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from bandwidth.models.list_endpoints_response import ListEndpointsResponse +from bandwidth.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = bandwidth.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: Basic +configuration = bandwidth.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure your client ID and secret for OAuth +configuration = bandwidth.Configuration( + client_id = os.environ["CLIENT_ID"], + client_secret = os.environ["CLIENT_SECRET"] +) + +# Enter a context with an instance of the API client +with bandwidth.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = bandwidth.EndpointsApi(api_client) + account_id = '5500123' # str | Your Bandwidth Account ID. + type = bandwidth.EndpointTypeEnum() # EndpointTypeEnum | The type of endpoint. (optional) + status = bandwidth.EndpointStatusEnum() # EndpointStatusEnum | The status of the endpoint. (optional) + after_cursor = 'TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ==' # str | The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + limit = 100 # int | The maximum number of endpoints to return in the response. (optional) (default to 100) + + try: + # List Endpoints + api_response = api_instance.list_endpoints(account_id, type=type, status=status, after_cursor=after_cursor, limit=limit) + print("The response of EndpointsApi->list_endpoints:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EndpointsApi->list_endpoints: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Your Bandwidth Account ID. | + **type** | [**EndpointTypeEnum**](.md)| The type of endpoint. | [optional] + **status** | [**EndpointStatusEnum**](.md)| The status of the endpoint. | [optional] + **after_cursor** | **str**| The cursor to use for pagination. This is the value of the `next` link in the previous response. | [optional] + **limit** | **int**| The maximum number of endpoints to return in the response. | [optional] [default to 100] + +### Return type + +[**ListEndpointsResponse**](ListEndpointsResponse.md) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**405** | Method Not Allowed | - | +**415** | Unsupported Media Type | - | +**429** | Too Many Requests | - | +**500** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_endpoint_bxml** +> update_endpoint_bxml(account_id, endpoint_id, body) + +Update Endpoint BXML + +Updates the BXML for the specified endpoint. + +### Example + +* Basic Authentication (Basic): +* OAuth Authentication (OAuth2): + +```python +import bandwidth +from bandwidth.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = bandwidth.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: Basic +configuration = bandwidth.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure your client ID and secret for OAuth +configuration = bandwidth.Configuration( + client_id = os.environ["CLIENT_ID"], + client_secret = os.environ["CLIENT_SECRET"] +) + +# Enter a context with an instance of the API client +with bandwidth.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = bandwidth.EndpointsApi(api_client) + account_id = '5500123' # str | Your Bandwidth Account ID. + endpoint_id = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | BRTC Endpoint ID. + body = 'body_example' # str | + + try: + # Update Endpoint BXML + api_instance.update_endpoint_bxml(account_id, endpoint_id, body) + except Exception as e: + print("Exception when calling EndpointsApi->update_endpoint_bxml: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Your Bandwidth Account ID. | + **endpoint_id** | **str**| BRTC Endpoint ID. | + **body** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/xml + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**405** | Method Not Allowed | - | +**415** | Unsupported Media Type | - | +**429** | Too Many Requests | - | +**500** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md new file mode 100644 index 00000000..60910a8b --- /dev/null +++ b/docs/ErrorResponse.md @@ -0,0 +1,31 @@ +# ErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**List[Link]**](Link.md) | | +**data** | **object** | | +**errors** | [**List[Error]**](Error.md) | | + +## Example + +```python +from bandwidth.models.error_response import ErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorResponse from a JSON string +error_response_instance = ErrorResponse.from_json(json) +# print the JSON string representation of the object +print(ErrorResponse.to_json()) + +# convert the object into a dict +error_response_dict = error_response_instance.to_dict() +# create an instance of ErrorResponse from a dict +error_response_from_dict = ErrorResponse.from_dict(error_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InboundCallback.md b/docs/InboundCallback.md index ad9e2f47..40163194 100644 --- a/docs/InboundCallback.md +++ b/docs/InboundCallback.md @@ -8,10 +8,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **datetime** | | **type** | [**InboundCallbackTypeEnum**](InboundCallbackTypeEnum.md) | | -**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | +**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | **description** | **str** | A detailed description of the event described by the callback. | **message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | -**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] +**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] ## Example diff --git a/docs/InboundCallbackTypeEnum.md b/docs/InboundCallbackTypeEnum.md index 690a01f6..f1259de4 100644 --- a/docs/InboundCallbackTypeEnum.md +++ b/docs/InboundCallbackTypeEnum.md @@ -1,6 +1,6 @@ # InboundCallbackTypeEnum -The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. +The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. ## Enum diff --git a/docs/ListEndpointsResponse.md b/docs/ListEndpointsResponse.md new file mode 100644 index 00000000..5fe2c0ec --- /dev/null +++ b/docs/ListEndpointsResponse.md @@ -0,0 +1,32 @@ +# ListEndpointsResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**List[Link]**](Link.md) | | +**page** | [**Page**](Page.md) | | [optional] +**data** | [**List[Endpoints]**](Endpoints.md) | | +**errors** | [**List[Error]**](Error.md) | | + +## Example + +```python +from bandwidth.models.list_endpoints_response import ListEndpointsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListEndpointsResponse from a JSON string +list_endpoints_response_instance = ListEndpointsResponse.from_json(json) +# print the JSON string representation of the object +print(ListEndpointsResponse.to_json()) + +# convert the object into a dict +list_endpoints_response_dict = list_endpoints_response_instance.to_dict() +# create an instance of ListEndpointsResponse from a dict +list_endpoints_response_from_dict = ListEndpointsResponse.from_dict(list_endpoints_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LookupResult.md b/docs/LookupResult.md index b7758648..187ed115 100644 --- a/docs/LookupResult.md +++ b/docs/LookupResult.md @@ -15,8 +15,8 @@ Name | Type | Description | Notes **deactivation_date** | **str** | [DNI-Only](#section/DNI-Only). The datetime the carrier reported a deactivation event. | [optional] **deactivation_event** | [**DeactivationEventEnum**](DeactivationEventEnum.md) | | [optional] **latest_message_delivery_status** | [**LatestMessageDeliveryStatusEnum**](LatestMessageDeliveryStatusEnum.md) | | [optional] -**initial_message_delivery_status_date** | **date** | [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] -**latest_message_delivery_status_date** | **date** | [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] +**initial_message_delivery_status_date** | **date** | [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] +**latest_message_delivery_status_date** | **date** | [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] ## Example diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md index e3f7a7a7..158dd706 100644 --- a/docs/MachineDetectionConfiguration.md +++ b/docs/MachineDetectionConfiguration.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **silence_timeout** | **float** | If no speech is detected in this period, a callback with a 'silence' result is sent. | [optional] [default to 10] **speech_threshold** | **float** | When speech has ended and a result couldn't be determined based on the audio content itself, this value is used to determine if the speaker is a machine based on the speech duration. If the length of the speech detected is greater than or equal to this threshold, the result will be 'answering-machine'. If the length of speech detected is below this threshold, the result will be 'human'. | [optional] [default to 10] **speech_end_threshold** | **float** | Amount of silence (in seconds) before assuming the callee has finished speaking. | [optional] [default to 5] -**machine_speech_end_threshold** | **float** | When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. | [optional] +**machine_speech_end_threshold** | **float** | When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. | [optional] **delay_result** | **bool** | If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately. | [optional] [default to False] **callback_url** | **str** | The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode. | [optional] **callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to CallbackMethodEnum.POST] diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md index fae515d8..db965980 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **application_id** | **str** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | **to** | **List[str]** | The phone number(s) the message should be sent to in E164 format. | -**var_from** | **str** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | +**var_from** | **str** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | **text** | **str** | The contents of the text message. Must be 2048 characters or less. | [optional] **media** | **List[str]** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] **tag** | **str** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] diff --git a/docs/Page.md b/docs/Page.md new file mode 100644 index 00000000..a33c4655 --- /dev/null +++ b/docs/Page.md @@ -0,0 +1,32 @@ +# Page + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page_size** | **int** | The number of items per page. | +**total_elements** | **int** | The total number of items. | [optional] +**total_pages** | **int** | The total number of pages. | [optional] +**page_number** | **int** | The current page number. | [optional] + +## Example + +```python +from bandwidth.models.page import Page + +# TODO update the JSON string below +json = "{}" +# create an instance of Page from a JSON string +page_instance = Page.from_json(json) +# print the JSON string representation of the object +print(Page.to_json()) + +# convert the object into a dict +page_dict = page_instance.to_dict() +# create an instance of Page from a dict +page_from_dict = Page.from_dict(page_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SipConnectionMetadata.md b/docs/SipConnectionMetadata.md new file mode 100644 index 00000000..97e0f68b --- /dev/null +++ b/docs/SipConnectionMetadata.md @@ -0,0 +1,32 @@ +# SipConnectionMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_address** | **str** | The IP address of the SIP connection. | [optional] +**port** | **int** | The port of the SIP connection. | [optional] +**credentials** | [**SipCredentials**](SipCredentials.md) | | [optional] +**uui_header** | **str** | The User-to-User Information header for the SIP connection. | [optional] + +## Example + +```python +from bandwidth.models.sip_connection_metadata import SipConnectionMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of SipConnectionMetadata from a JSON string +sip_connection_metadata_instance = SipConnectionMetadata.from_json(json) +# print the JSON string representation of the object +print(SipConnectionMetadata.to_json()) + +# convert the object into a dict +sip_connection_metadata_dict = sip_connection_metadata_instance.to_dict() +# create an instance of SipConnectionMetadata from a dict +sip_connection_metadata_from_dict = SipConnectionMetadata.from_dict(sip_connection_metadata_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SipCredentials.md b/docs/SipCredentials.md new file mode 100644 index 00000000..20c72ea4 --- /dev/null +++ b/docs/SipCredentials.md @@ -0,0 +1,30 @@ +# SipCredentials + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **str** | The username for the SIP connection. | [optional] +**password** | **str** | The password for the SIP connection. | [optional] + +## Example + +```python +from bandwidth.models.sip_credentials import SipCredentials + +# TODO update the JSON string below +json = "{}" +# create an instance of SipCredentials from a JSON string +sip_credentials_instance = SipCredentials.from_json(json) +# print the JSON string representation of the object +print(SipCredentials.to_json()) + +# convert the object into a dict +sip_credentials_dict = sip_credentials_instance.to_dict() +# create an instance of SipCredentials from a dict +sip_credentials_from_dict = SipCredentials.from_dict(sip_credentials_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + From 1cad034dd38ac1eabb4d42a3dd3946963b3f5e6e Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Wed, 14 Jan 2026 15:51:48 -0500 Subject: [PATCH 02/10] Add unit tests for EndpointsApi functionality and update .gitignore --- .gitignore | 3 +- test/unit/api/test_endpoints_api.py | 206 ++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 test/unit/api/test_endpoints_api.py diff --git a/.gitignore b/.gitignore index 048da015..f16616b3 100644 --- a/.gitignore +++ b/.gitignore @@ -78,4 +78,5 @@ target/ # Test Fixtures test/fixtures/ -.env \ No newline at end of file +.env +temp \ No newline at end of file diff --git a/test/unit/api/test_endpoints_api.py b/test/unit/api/test_endpoints_api.py new file mode 100644 index 00000000..b6407ffe --- /dev/null +++ b/test/unit/api/test_endpoints_api.py @@ -0,0 +1,206 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.endpoints_api import EndpointsApi +from bandwidth.models.create_web_rtc_connection_request import CreateWebRtcConnectionRequest +from bandwidth.models.create_endpoint_response import CreateEndpointResponse +from bandwidth.models.endpoint_response import EndpointResponse +from bandwidth.models.list_endpoints_response import ListEndpointsResponse +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from bandwidth.models.endpoint_direction_enum import EndpointDirectionEnum +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum + + +class TestEndpointsApi(unittest.TestCase): + """EndpointsApi unit test stubs""" + + @classmethod + def setUpClass(cls) -> None: + configuration = Configuration( + client_id=BW_CLIENT_ID, + client_secret=BW_CLIENT_SECRET, + host='http://127.0.0.1:4010', + ignore_operation_servers=True + ) + api_client = ApiClient(configuration) + cls.endpoints_api_instance = EndpointsApi(api_client) + + def test_create_endpoint(self) -> None: + """Test case for create_endpoint + + Create Endpoint + """ + endpoint_body = CreateWebRtcConnectionRequest( + type=EndpointTypeEnum("webrtc"), + direction=EndpointDirectionEnum("inbound"), + event_callback_url="https://myServer.com/bandwidth/webhooks/endpoint", + event_fallback_url="https://myFallbackServer.com/bandwidth/webhooks/endpoint", + tag="test-endpoint", + connection_metadata={ + "key1": "value1", + "key2": "value2" + } + ) + response = self.endpoints_api_instance.create_endpoint_with_http_info( + BW_ACCOUNT_ID, + endpoint_body + ) + + assert_that(response.status_code, equal_to(201)) + assert_that(response.data, instance_of(CreateEndpointResponse)) + assert_that(response.data.links, instance_of(list)) + assert_that(response.data.data, instance_of(object)) + assert_that(response.data.errors, instance_of(list)) + + def test_delete_endpoint(self) -> None: + """Test case for delete_endpoint + + Delete Endpoint + """ + response = self.endpoints_api_instance.delete_endpoint_with_http_info( + BW_ACCOUNT_ID, + "ep-abc123" + ) + + assert_that(response.status_code, equal_to(204)) + + def test_get_endpoint(self) -> None: + """Test case for get_endpoint + + Get Endpoint + """ + response = self.endpoints_api_instance.get_endpoint_with_http_info( + BW_ACCOUNT_ID, + "ep-abc123" + ) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(EndpointResponse)) + assert_that(response.data.links, instance_of(list)) + assert_that(response.data.data, instance_of(object)) + assert_that(response.data.errors, instance_of(list)) + + def test_list_endpoints(self) -> None: + """Test case for list_endpoints + + List Endpoints + """ + response = self.endpoints_api_instance.list_endpoints_with_http_info( + BW_ACCOUNT_ID + ) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(ListEndpointsResponse)) + assert_that(response.data.links, instance_of(list)) + assert_that(response.data.data, instance_of(list)) + assert_that(response.data.errors, instance_of(list)) + + def test_list_endpoints_with_filters(self) -> None: + """Test case for list_endpoints with filters + + List Endpoints with Type and Status Filters + """ + response = self.endpoints_api_instance.list_endpoints_with_http_info( + BW_ACCOUNT_ID, + type=EndpointTypeEnum("webrtc"), + status=EndpointStatusEnum("active"), + limit=100 + ) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(ListEndpointsResponse)) + assert_that(response.data.links, instance_of(list)) + assert_that(response.data.data, instance_of(list)) + assert_that(response.data.errors, instance_of(list)) + if response.data.page: + assert_that(response.data.page, instance_of(object)) + + def test_list_endpoints_with_pagination(self) -> None: + """Test case for list_endpoints with pagination + + List Endpoints with Pagination + """ + response = self.endpoints_api_instance.list_endpoints_with_http_info( + BW_ACCOUNT_ID, + after_cursor="cursor-abc123", + limit=50 + ) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(ListEndpointsResponse)) + assert_that(response.data.links, instance_of(list)) + assert_that(response.data.data, instance_of(list)) + assert_that(response.data.errors, instance_of(list)) + + def test_update_endpoint_bxml(self) -> None: + """Test case for update_endpoint_bxml + + Update Endpoint BXML + """ + update_bxml = 'This is a test bxml response for endpoint' + + response = self.endpoints_api_instance.update_endpoint_bxml_with_http_info( + BW_ACCOUNT_ID, + "ep-abc123", + update_bxml + ) + + assert_that(response.status_code, equal_to(204)) + + def test_create_endpoint_minimal(self) -> None: + """Test case for create_endpoint with minimal required fields + + Create Endpoint with Minimal Fields + """ + endpoint_body = CreateWebRtcConnectionRequest( + type=EndpointTypeEnum("webrtc"), + direction=EndpointDirectionEnum("outbound") + ) + response = self.endpoints_api_instance.create_endpoint_with_http_info( + BW_ACCOUNT_ID, + endpoint_body + ) + + assert_that(response.status_code, equal_to(201)) + assert_that(response.data, instance_of(CreateEndpointResponse)) + + def test_create_endpoint_sip(self) -> None: + """Test case for create_endpoint with SIP type + + Create SIP Endpoint + """ + endpoint_body = CreateWebRtcConnectionRequest( + type=EndpointTypeEnum("sip"), + direction=EndpointDirectionEnum("bidirectional"), + event_callback_url="https://myServer.com/bandwidth/webhooks/sip-endpoint", + tag="sip-test-endpoint" + ) + response = self.endpoints_api_instance.create_endpoint_with_http_info( + BW_ACCOUNT_ID, + endpoint_body + ) + + assert_that(response.status_code, equal_to(201)) + assert_that(response.data, instance_of(CreateEndpointResponse)) + + +if __name__ == '__main__': + unittest.main() From e2b795516d59fe41a78770df356563a69f864a55 Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Thu, 15 Jan 2026 14:04:32 -0500 Subject: [PATCH 03/10] Restore bandwidth.yml --- bandwidth.yml | 9425 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 9424 insertions(+), 1 deletion(-) mode change 120000 => 100644 bandwidth.yml diff --git a/bandwidth.yml b/bandwidth.yml deleted file mode 120000 index 2117df27..00000000 --- a/bandwidth.yml +++ /dev/null @@ -1 +0,0 @@ -../api-specs-combine-action/api-specs/bandwidth.yml \ No newline at end of file diff --git a/bandwidth.yml b/bandwidth.yml new file mode 100644 index 00000000..8b9998df --- /dev/null +++ b/bandwidth.yml @@ -0,0 +1,9424 @@ +openapi: 3.0.3 +info: + title: Bandwidth + description: Bandwidth's Communication APIs + contact: + name: Bandwidth + url: https://dev.bandwidth.com + email: letstalk@bandwidth.com + version: 1.0.0 +security: + - Basic: [] + - OAuth2: [] +tags: + - name: Messages + - name: Media + - name: Multi-Channel + - name: Calls + - name: Conferences + - name: Recordings + - name: Statistics + - name: Transcriptions + - name: MFA + - name: Phone Number Lookup + - name: Toll-Free Verification + - name: Endpoints +paths: + /users/{accountId}/media: + get: + summary: List Media + description: Gets a list of your media files. No query parameters are supported. + operationId: listMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/continuationToken' + responses: + '200': + $ref: '#/components/responses/listMediaResponse' + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + servers: &ref_0 + - url: https://messaging.bandwidth.com/api/v2 + description: Production + /users/{accountId}/media/{mediaId}: + get: + summary: Get Media + description: Downloads a media file you previously uploaded. + operationId: getMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/mediaId' + responses: + '200': + $ref: '#/components/responses/getMediaResponse' + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + put: + summary: Upload Media + description: >- + Upload a file. You may add headers to the request in order to provide + some control to your media file. + + + If a file is uploaded with the same name as a file that already exists + under this account, the previous file will be overwritten. + + + A list of supported media types can be found + [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). + operationId: uploadMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/mediaId' + - $ref: '#/components/parameters/contentType' + - $ref: '#/components/parameters/cacheControl' + requestBody: + $ref: '#/components/requestBodies/uploadMediaRequest' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + delete: + summary: Delete Media + description: |- + Deletes a media file from Bandwidth API server. Make sure you don't have + any application scripts still using the media before you delete. + + If you accidentally delete a media file you can immediately upload a new + file with the same name. + operationId: deleteMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/mediaId' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + servers: *ref_0 + /users/{accountId}/messages: + get: + summary: List Messages + description: Returns a list of messages based on query parameters. + operationId: listMessages + tags: + - Messages + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/messageId' + - $ref: '#/components/parameters/sourceTn' + - $ref: '#/components/parameters/destinationTn' + - $ref: '#/components/parameters/messageStatus' + - $ref: '#/components/parameters/messageDirection' + - $ref: '#/components/parameters/carrierName' + - $ref: '#/components/parameters/messageType' + - $ref: '#/components/parameters/errorCode' + - $ref: '#/components/parameters/fromDateTime' + - $ref: '#/components/parameters/toDateTime' + - $ref: '#/components/parameters/campaignId' + - $ref: '#/components/parameters/fromBwLatency' + - $ref: '#/components/parameters/bwQueued' + - $ref: '#/components/parameters/product' + - $ref: '#/components/parameters/location' + - $ref: '#/components/parameters/carrierQueued' + - $ref: '#/components/parameters/fromCarrierLatency' + - $ref: '#/components/parameters/callingNumberCountryA3' + - $ref: '#/components/parameters/calledNumberCountryA3' + - $ref: '#/components/parameters/fromSegmentCount' + - $ref: '#/components/parameters/toSegmentCount' + - $ref: '#/components/parameters/fromMessageSize' + - $ref: '#/components/parameters/toMessageSize' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/pageToken' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/limitTotalCount' + responses: + '200': + $ref: '#/components/responses/listMessagesResponse' + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + post: + summary: Create Message + description: >- + Endpoint for sending text messages and picture messages using V2 + messaging. + operationId: createMessage + tags: + - Messages + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/createMessageRequest' + responses: + '202': + $ref: '#/components/responses/createMessageResponse' + '400': + $ref: '#/components/responses/createMessageBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '405': + $ref: '#/components/responses/messagingMethodNotAllowedError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + callbacks: + statusCallback: + $ref: '#/components/callbacks/statusCallback' + servers: *ref_0 + /users/{accountId}/messages/multiChannel: + post: + summary: Create Multi-Channel Message + description: Endpoint for sending Multi-Channel messages. + operationId: createMultiChannelMessage + parameters: + - $ref: '#/components/parameters/accountId' + tags: + - Multi-Channel + requestBody: + $ref: '#/components/requestBodies/createMultiChannelMessageRequest' + responses: + '202': + $ref: '#/components/responses/createMultiChannelMessageResponse' + '400': + $ref: '#/components/responses/multiChannelBadRequestError' + '401': + $ref: '#/components/responses/multiChannelUnauthorizedError' + '403': + $ref: '#/components/responses/multiChannelForbiddenError' + '404': + $ref: '#/components/responses/multiChannelNotFoundError' + '405': + $ref: '#/components/responses/multiChannelMethodNotAllowedError' + '406': + $ref: '#/components/responses/multiChannelNotAcceptableError' + '415': + $ref: '#/components/responses/multiChannelInvalidMediaTypeError' + '429': + $ref: '#/components/responses/multiChannelTooManyRequestsError' + '500': + $ref: '#/components/responses/multiChannelInternalServerError' + callbacks: + statusCallback: + $ref: '#/components/callbacks/statusCallback' + x-badges: + - name: Beta + color: '#076EA8' + servers: *ref_0 + /accounts/{accountId}/calls: + post: + tags: + - Calls + summary: Create Call + description: >- + Creates an outbound phone call. + + + All calls are initially queued. Your outbound calls will initiated at a + specific dequeueing rate, enabling your application to "fire and forget" + when creating calls. Queued calls may not be modified until they are + dequeued and placed, but may be removed from your queue on demand. + + + Please note: Calls submitted to your queue will be placed + approximately in order, but exact ordering is not guaranteed. + operationId: createCall + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/createCallRequest' + responses: + '201': + $ref: '#/components/responses/createCallResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + get: + tags: + - Calls + summary: Get Calls + description: >- + Returns a max of 10000 calls, sorted by `createdTime` from oldest to + newest. + + + **NOTE:** If the number of calls in the account is bigger than + `pageSize`, a `Link` header (with format `<{url}>; rel="next"`) will be + returned in the response. The url can be used to retrieve the next page + of call records. + + Also, call information is kept for 7 days after the calls are hung up. + If you attempt to retrieve information for a call that is older than 7 + days, you will get an empty array [] in response. + operationId: listCalls + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/to' + - $ref: '#/components/parameters/from' + - $ref: '#/components/parameters/minStartTimeCalls' + - $ref: '#/components/parameters/maxStartTimeCalls' + - $ref: '#/components/parameters/disconnectCause' + - $ref: '#/components/parameters/pageSizeCalls' + - $ref: '#/components/parameters/pageToken1' + responses: + '200': + $ref: '#/components/responses/listCallsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: &ref_1 + - url: https://voice.bandwidth.com/api/v2 + description: Production + /accounts/{accountId}/calls/{callId}: + get: + tags: + - Calls + summary: Get Call State Information + description: >- + Retrieve the current state of a specific call. This information is + near-realtime, so it may take a few minutes for your call to be + accessible using this endpoint. + + + **Note**: Call information is kept for 7 days after the calls are hung + up. If you attempt to retrieve information for a call that is older than + 7 days, you will get an HTTP 404 response. + operationId: getCallState + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + responses: + '200': + $ref: '#/components/responses/getCallStateResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + post: + tags: + - Calls + summary: Update Call + description: >- + Interrupts and redirects a call to a different URL that should return a + BXML document. + operationId: updateCall + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + requestBody: + $ref: '#/components/requestBodies/updateCallRequest' + responses: + '200': + $ref: '#/components/responses/updateCallResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '409': + $ref: '#/components/responses/voiceConflictError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/bxml: + put: + tags: + - Calls + summary: Update Call BXML + description: Interrupts and replaces an active call's BXML document. + operationId: updateCallBxml + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + requestBody: + $ref: '#/components/requestBodies/updateCallBxmlRequest' + responses: + '204': + description: Call BXML was successfully replaced. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '409': + $ref: '#/components/responses/voiceConflictError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences: + get: + tags: + - Conferences + summary: Get Conferences + description: >- + Returns a max of 1000 conferences, sorted by `createdTime` from oldest + to newest. + + + **NOTE:** If the number of conferences in the account is bigger than + `pageSize`, a `Link` header (with format `<{url}>; rel="next"`) will be + returned in the response. The url can be used to retrieve the next page + of conference records. + operationId: listConferences + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/minCreatedTime' + - $ref: '#/components/parameters/maxCreatedTime' + - $ref: '#/components/parameters/pageSize' + - $ref: '#/components/parameters/pageToken1' + responses: + '200': + $ref: '#/components/responses/listConferencesResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}: + get: + tags: + - Conferences + summary: Get Conference Information + description: Returns information about the specified conference. + operationId: getConference + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + responses: + '200': + $ref: '#/components/responses/getConferenceResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + post: + tags: + - Conferences + summary: Update Conference + description: Update the conference state. + operationId: updateConference + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + requestBody: + $ref: '#/components/requestBodies/updateConferenceRequest' + responses: + '204': + description: Conference was successfully modified. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}/bxml: + put: + tags: + - Conferences + summary: Update Conference BXML + description: Update the conference BXML document. + operationId: updateConferenceBxml + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + requestBody: + $ref: '#/components/requestBodies/updateConferenceBxmlRequest' + responses: + '204': + description: Conference successfully modified. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}/members/{memberId}: + get: + tags: + - Conferences + summary: Get Conference Member + description: Returns information about the specified conference member. + operationId: getConferenceMember + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/memberId' + responses: + '200': + $ref: '#/components/responses/getConferenceMemberResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + put: + tags: + - Conferences + summary: Update Conference Member + description: Updates settings for a particular conference member. + operationId: updateConferenceMember + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/memberId' + requestBody: + $ref: '#/components/requestBodies/updateConferenceMemberRequest' + responses: + '204': + description: Conference member was successfully modified. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}/recordings: + get: + tags: + - Conferences + summary: Get Conference Recordings + description: >- + Returns a (potentially empty) list of metadata for the recordings that + took place during the specified conference. + operationId: listConferenceRecordings + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + responses: + '200': + $ref: '#/components/responses/listConferenceRecordingsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}: + get: + tags: + - Conferences + summary: Get Conference Recording Information + description: Returns metadata for the specified recording. + operationId: getConferenceRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/getConferenceRecordingResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media: + get: + tags: + - Conferences + summary: Download Conference Recording + description: Downloads the specified recording file. + operationId: downloadConferenceRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/downloadRecordingMediaResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/recordings: + get: + tags: + - Recordings + summary: Get Call Recordings + description: >- + Returns a list of metadata for the recordings associated with the + + specified account. The list can be filtered by the optional from, to, + minStartTime, + + and maxStartTime arguments. The list is capped at 1000 entries and may + be + + empty if no recordings match the specified criteria. + operationId: listAccountCallRecordings + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/to' + - $ref: '#/components/parameters/from' + - $ref: '#/components/parameters/minStartTime' + - $ref: '#/components/parameters/maxStartTime' + responses: + '200': + $ref: '#/components/responses/listCallRecordingsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/recording: + put: + tags: + - Recordings + summary: Update Recording + description: Pause or resume a recording on an active phone call. + operationId: updateCallRecordingState + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + requestBody: + $ref: '#/components/requestBodies/updateCallRecordingRequest' + responses: + '200': + $ref: '#/components/responses/updateRecordingResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/recordings: + get: + tags: + - Recordings + summary: List Call Recordings + description: |- + Returns a (potentially empty) list of metadata for the recordings + that took place during the specified call. + operationId: listCallRecordings + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + responses: + '200': + $ref: '#/components/responses/listCallRecordingsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/recordings/{recordingId}: + get: + tags: + - Recordings + summary: Get Call Recording + description: Returns metadata for the specified recording. + operationId: getCallRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/getCallRecordingResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + delete: + tags: + - Recordings + summary: Delete Recording + description: >- + Delete the recording information, media and transcription. + + + Note: After the deletion is requested and a `204` is returned, neither + the recording metadata nor the actual media nor its transcription will + be accessible anymore. However, the media of the specified recording is + not deleted immediately. This deletion process, while transparent and + irreversible, can take an additional 24 to 48 hours. + operationId: deleteRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '204': + description: Recording was deleted. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media: + get: + tags: + - Recordings + summary: Download Recording + description: Downloads the specified recording. + operationId: downloadCallRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/downloadRecordingMediaResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + delete: + tags: + - Recordings + summary: Delete Recording Media + description: Deletes the specified recording's media. + operationId: deleteRecordingMedia + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '204': + description: The recording media was successfully deleted. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription: + get: + tags: + - Recordings + summary: Get Transcription + description: >- + Downloads the specified transcription. + + If the recording was multi-channel, then there will be 2 transcripts. + + The caller/called party transcript will be the first item while + [``](/docs/voice/bxml/playAudio) and + [``](/docs/voice/bxml/speakSentence) transcript will be + the second item. + + During a [``](/docs/voice/bxml/transfer) the A-leg transcript + will be the first item while the B-leg transcript will be the second + item. + operationId: getRecordingTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/getRecordingTranscriptionResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + post: + tags: + - Recordings + summary: Create Transcription Request + description: >- + Generate the transcription for a specific recording. Transcription + + can succeed only for recordings of length greater than 500 milliseconds + and + + less than 4 hours. + operationId: transcribeCallRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + requestBody: + $ref: '#/components/requestBodies/transcribeRecordingRequest' + responses: + '204': + description: Transcription was successfully requested. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + delete: + tags: + - Recordings + summary: Delete Transcription + description: >- + Deletes the specified recording's transcription. + + + Note: After the deletion is requested and a `204` is returned, the + transcription will not be accessible anymore. However, it is not deleted + immediately. This deletion process, while transparent and irreversible, + can take an additional 24 to 48 hours. + operationId: deleteRecordingTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '204': + description: The transcription was successfully deleted. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/statistics: + get: + tags: + - Statistics + summary: Get Account Statistics + description: Returns details about the current state of the account. + operationId: getStatistics + parameters: + - $ref: '#/components/parameters/accountId' + responses: + '200': + $ref: '#/components/responses/getStatisticsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/transcriptions: + get: + tags: + - Transcriptions + summary: List Real-time Transcriptions + description: >- + List the transcriptions created on this call via + [startTranscription](/docs/voice/bxml/startTranscription). + operationId: listRealTimeTranscriptions + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + responses: + '200': + $ref: '#/components/responses/listTranscriptionsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}: + get: + tags: + - Transcriptions + summary: Get Real-time Transcription + description: >- + Retrieve the specified transcription that was created on this call via + [startTranscription](/docs/voice/bxml/startTranscription). + operationId: getRealTimeTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/transcriptionId' + responses: + '200': + $ref: '#/components/responses/getCallTranscriptionResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + delete: + tags: + - Transcriptions + summary: Delete Real-time Transcription + description: >- + Delete the specified transcription that was created on this call via + [startTranscription](/docs/voice/bxml/startTranscription). + + + Note: After the deletion is requested and a `200` is returned, the + transcription will not be accessible anymore. However, it is not deleted + immediately. This deletion process, while transparent and irreversible, + can take an additional 24 to 48 hours. + operationId: deleteRealTimeTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/transcriptionId' + responses: + '200': + $ref: '#/components/responses/deleteCallTranscriptionResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/code/voice: + post: + tags: + - MFA + summary: Voice Authentication Code + description: Send an MFA Code via a phone call. + operationId: generateVoiceCode + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/codeRequest' + responses: + '200': + $ref: '#/components/responses/voiceCodeResponse' + '400': + $ref: '#/components/responses/mfaBadRequestError' + '401': + $ref: '#/components/responses/mfaUnauthorizedError' + '403': + $ref: '#/components/responses/mfaForbiddenError' + '500': + $ref: '#/components/responses/mfaInternalServerError' + servers: &ref_2 + - url: https://mfa.bandwidth.com/api/v1 + description: Production + /accounts/{accountId}/code/messaging: + post: + tags: + - MFA + summary: Messaging Authentication Code + description: Send an MFA code via text message (SMS). + operationId: generateMessagingCode + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/codeRequest' + responses: + '200': + $ref: '#/components/responses/messagingCodeResponse' + '400': + $ref: '#/components/responses/mfaBadRequestError' + '401': + $ref: '#/components/responses/mfaUnauthorizedError' + '403': + $ref: '#/components/responses/mfaForbiddenError' + '500': + $ref: '#/components/responses/mfaInternalServerError' + servers: *ref_2 + /accounts/{accountId}/code/verify: + post: + tags: + - MFA + summary: Verify Authentication Code + description: Verify a previously sent MFA code. + operationId: verifyCode + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/codeVerify' + responses: + '200': + $ref: '#/components/responses/verifyCodeResponse' + '400': + $ref: '#/components/responses/mfaBadRequestError' + '401': + $ref: '#/components/responses/mfaUnauthorizedError' + '403': + $ref: '#/components/responses/mfaForbiddenError' + '429': + $ref: '#/components/responses/mfaTooManyRequestsError' + '500': + $ref: '#/components/responses/mfaInternalServerError' + servers: *ref_2 + /accounts/{accountId}/phoneNumberLookup: + post: + summary: Create Synchronous Number Lookup + description: >- + Creates a synchronous phone number lookup request. Maximum of 100 + telephone numbers per request. + operationId: createSyncLookup + tags: + - Phone Number Lookup + parameters: + - $ref: '#/components/parameters/accountId1' + requestBody: + $ref: '#/components/requestBodies/createSyncLookupRequest' + responses: + '200': + $ref: '#/components/responses/createSyncLookupResponse' + default: + $ref: '#/components/responses/tnLookupDefaultResponse' + servers: &ref_3 + - url: https://api.bandwidth.com/v2 + description: Production + /accounts/{accountId}/phoneNumberLookup/bulk: + post: + summary: Create Asynchronous Bulk Number Lookup + description: >- + Creates an asynchronous bulk phone number lookup request. Maximum of + 15,000 telephone numbers per request. Use the [Get Asynchronous Bulk + Number Lookup](#tag/Phone-Number-Lookup/operation/getAsyncBulkLookup) + endpoint to check the status of the request and view the results. + operationId: createAsyncBulkLookup + tags: + - Phone Number Lookup + parameters: + - $ref: '#/components/parameters/accountId1' + requestBody: + $ref: '#/components/requestBodies/createAsyncBulkLookupRequest' + responses: + '202': + $ref: '#/components/responses/createAsyncBulkLookupResponse' + default: + $ref: '#/components/responses/tnLookupDefaultResponse' + servers: *ref_3 + /accounts/{accountId}/phoneNumberLookup/bulk/{requestId}: + get: + summary: Get Asynchronous Bulk Number Lookup + description: >- + Get an existing [Asynchronous Bulk Number + Lookup](#tag/Phone-Number-Lookup/operation/createAsyncBulkLookup). Use + this endpoint to check the status of the request and view the results. + operationId: getAsyncBulkLookup + tags: + - Phone Number Lookup + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/requestId' + responses: + '200': + $ref: '#/components/responses/getAsyncBulkLookupResponse' + default: + $ref: '#/components/responses/tnLookupDefaultResponse' + servers: *ref_3 + /accounts/{accountId}/tollFreeVerification: + post: + tags: + - Toll-Free Verification + summary: Request Toll-Free Verification + description: Submit a request for verification of a toll-free phone number. + operationId: requestTollFreeVerification + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/requestTollFreeVerificationRequest' + responses: + '202': + description: Accepted + '400': + $ref: '#/components/responses/tfvPostBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + callbacks: + tfVerificationStatus: + $ref: '#/components/callbacks/tfVerificationStatus' + servers: &ref_4 + - url: https://api.bandwidth.com/api/v2 + description: Production + /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification: + get: + tags: + - Toll-Free Verification + summary: Get Toll-Free Verification Status + description: >- + Gets the verification status for a phone number that is provisioned to + your account. + + Submission information will be appended to the response if it is + available. + operationId: getTollFreeVerificationStatus + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/tfPhoneNumberPathParam' + responses: + '200': + $ref: '#/components/responses/getTollFreeVerificationStatusResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + put: + tags: + - Toll-Free Verification + summary: Update Toll-Free Verification Request + description: >- + Updates a toll-free verification request. + + Submissions are only eligible for resubmission for 7 days within being + processed and if resubmission is allowed (resubmitAllowed field is + true). + operationId: updateTollFreeVerificationRequest + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/tfPhoneNumberPathParam' + requestBody: + $ref: '#/components/requestBodies/updateTollFreeVerificationRequestRequest' + responses: + '202': + description: Accepted + '400': + $ref: '#/components/responses/tfvPostBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + callbacks: + tfVerificationStatus: + $ref: '#/components/callbacks/tfVerificationStatus' + delete: + description: Delete a toll-free verification submission for a toll-free number. + operationId: deleteVerificationRequest + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/tfPhoneNumberPathParam' + responses: + '204': + $ref: '#/components/responses/noContentResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + summary: Delete a Toll-Free Verification Submission + tags: + - Toll-Free Verification + servers: *ref_4 + /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions: + get: + tags: + - Toll-Free Verification + summary: List Webhook Subscriptions + description: >- + Lists all webhook subscriptions that are registered to receive status + updates for the toll-free verification requests submitted under this + account (password will not be returned through this API + + If `basicAuthentication` is defined, the `password` property of that + object will be null). + operationId: listWebhookSubscriptions + parameters: + - $ref: '#/components/parameters/accountId' + responses: + '200': + $ref: '#/components/responses/listWebhookSubscriptionsResponse' + '400': + $ref: '#/components/responses/tfvPostBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + post: + tags: + - Toll-Free Verification + summary: Create Webhook Subscription + description: >- + Create a new webhook subscription (this webhook will be called for every + update on every submission). + + In addition to a `callbackUrl`, this subscription can provide optional + HTTP basic authentication credentials (a username and a password). + + The returned subscription object will contain an ID that can be used to + modify or delete the subscription at a later time. + operationId: createWebhookSubscription + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/webhookSubscriptionRequest' + responses: + '201': + $ref: '#/components/responses/createWebhookSubscriptionResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + servers: *ref_4 + /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}: + delete: + tags: + - Toll-Free Verification + summary: Delete Webhook Subscription + description: Delete a webhook subscription by ID. + operationId: deleteWebhookSubscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/webhookSubscriptionIdPathParam' + responses: + '204': + $ref: '#/components/responses/noContentResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + put: + tags: + - Toll-Free Verification + summary: Update Webhook Subscription + description: >- + Update an existing webhook subscription (`callbackUrl` and + `basicAuthentication` can be updated). + operationId: updateWebhookSubscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/webhookSubscriptionIdPathParam' + requestBody: + $ref: '#/components/requestBodies/webhookSubscriptionRequest' + responses: + '200': + $ref: '#/components/responses/updateWebhookSubscriptionResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + servers: *ref_4 + /tollFreeVerification/useCases: + get: + tags: + - Toll-Free Verification + summary: List Toll-Free Use Cases + description: Lists valid toll-free use cases. + operationId: listTollFreeUseCases + responses: + '200': + $ref: '#/components/responses/listTollFreeUseCasesResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + servers: *ref_4 + /accounts/{accountId}/endpoints: + get: + tags: + - Endpoints + summary: List Endpoints + description: Returns a list of endpoints associated with the specified account. + operationId: listEndpoints + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointType' + - $ref: '#/components/parameters/endpointStatus' + - $ref: '#/components/parameters/afterCursor' + - $ref: '#/components/parameters/limit1' + responses: + '200': + $ref: '#/components/responses/listEndpointsResponse' + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + post: + tags: + - Endpoints + summary: Create Endpoint + description: Creates a new Endpoint for the specified account. + operationId: createEndpoint + parameters: + - $ref: '#/components/parameters/accountId2' + requestBody: + $ref: '#/components/requestBodies/createEndpointRequest' + responses: + '201': + $ref: '#/components/responses/createEndpointResponse' + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + callbacks: + endpointEventCallback: + $ref: '#/components/callbacks/endpointEvent' + servers: &ref_5 + - url: https://api.bandwidth.com/v2 + description: Production + /accounts/{accountId}/endpoints/{endpointId}: + get: + tags: + - Endpoints + summary: Get Endpoint + description: Returns information about the specified endpoint. + operationId: getEndpoint + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointId' + responses: + '200': + $ref: '#/components/responses/getEndpointResponse' + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + delete: + tags: + - Endpoints + summary: Delete Endpoint + description: >- + Deletes the specified endpoint. If the endpoint is actively streaming + media, the media stream will be terminated. + operationId: deleteEndpoint + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointId' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + servers: *ref_5 + /accounts/{accountId}/endpoints/{endpointId}/bxml: + put: + tags: + - Endpoints + summary: Update Endpoint BXML + description: Updates the BXML for the specified endpoint. + operationId: updateEndpointBxml + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointId' + requestBody: + $ref: '#/components/requestBodies/updateEndpointBxmlRequest' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + servers: *ref_5 +components: + schemas: + applicationId: + type: string + description: >- + The ID of the Application your from number or senderId is associated + with in the Bandwidth Phone Number Dashboard. + example: 93de2206-9669-4e07-948d-329f4b722ee2 + priorityEnum: + type: string + description: >- + Specifies the message's sending priority with respect to other messages + in your account. For best results and optimal throughput, reserve the + 'high' priority setting for critical messages only. + enum: + - default + - high + example: default + messageStatusEnum: + type: string + description: >- + The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED + DELIVERED ACCEPTED UNDELIVERED. + enum: + - RECEIVED + - QUEUED + - SENDING + - SENT + - FAILED + - DELIVERED + - ACCEPTED + - UNDELIVERED + example: RECEIVED + listMessageDirectionEnum: + type: string + description: The direction of the message. One of INBOUND OUTBOUND. + enum: + - INBOUND + - OUTBOUND + example: INBOUND + messageDirectionEnum: + type: string + description: The direction of the message. One of in out. + enum: + - in + - out + example: in + messageTypeEnum: + type: string + description: The type of message. Either SMS or MMS. + enum: + - sms + - mms + - rcs + example: sms + productTypeEnum: + type: string + description: The type of product associated with the message. + enum: + - LOCAL_A2P + - P2P + - SHORT_CODE_REACH + - TOLL_FREE + - HOSTED_SHORT_CODE + - ALPHA_NUMERIC + - RBM_MEDIA + - RBM_RICH + - RBM_CONVERSATIONAL + example: P2P + fieldError: + type: object + properties: + fieldName: + type: string + description: The name of the field that contains the error + example: from + description: + type: string + description: The error associated with the field + example: >- + '+invalid' must be replaced with a valid E164 formatted telephone + number + messagesList: + title: MessagesList + type: object + properties: + totalCount: + type: integer + description: >- + The total number of messages matched by the search. When the request + has limitTotalCount set to true this value is limited to 10,000. + example: 100 + pageInfo: + $ref: '#/components/schemas/pageInfo' + messages: + type: array + items: + $ref: '#/components/schemas/listMessageItem' + listMessageItem: + title: listMessageItem + type: object + properties: + messageId: + type: string + description: The message id + example: 1589228074636lm4k2je7j7jklbn2 + accountId: + type: string + description: The account id associated with this message. + example: '9900000' + sourceTn: + type: string + description: The source phone number of the message. + example: '+15554443333' + destinationTn: + type: string + description: The recipient phone number of the message. + example: '+15554442222' + messageStatus: + $ref: '#/components/schemas/messageStatusEnum' + messageDirection: + $ref: '#/components/schemas/listMessageDirectionEnum' + messageType: + $ref: '#/components/schemas/messageTypeEnum' + segmentCount: + $ref: '#/components/schemas/segmentCount' + errorCode: + type: integer + description: The numeric error code of the message. + example: 9902 + receiveTime: + type: string + format: date-time + description: The ISO 8601 datetime of the message. + example: 2020-04-07T14:03:07.000Z + carrierName: + type: string + nullable: true + description: >- + The name of the carrier. Not currently supported for MMS coming + soon. + example: other + messageSize: + type: integer + description: The size of the message including message content and headers. + nullable: true + example: 27 + messageLength: + type: integer + description: The length of the message content. + example: 18 + attachmentCount: + type: integer + description: The number of attachments the message has. + nullable: true + example: 1 + recipientCount: + type: integer + description: The number of recipients the message has. + nullable: true + example: 1 + campaignClass: + type: string + description: The campaign class of the message if it has one. + nullable: true + example: T + campaignId: + type: string + description: The campaign ID of the message if it has one. + nullable: true + example: CJEUMDK + bwLatency: + type: integer + description: >- + The Bandwidth latency of the message in seconds. Only available for + accounts with the Advanced Quality Metrics feature enabled. + nullable: true + example: 20 + carrierLatency: + type: integer + description: >- + The carrier latency of the message in seconds. Only available for + OUTBOUND messages from accounts with the Advanced Quality Metrics + feature enabled. + nullable: true + example: 20 + callingNumberCountryA3: + type: string + description: The A3 country code of the calling number. + nullable: true + example: USA + calledNumberCountryA3: + type: string + description: The A3 country code of the called number. + nullable: true + example: USA + product: + type: string + description: The messaging product associated with the message. + nullable: true + example: P2P + location: + type: string + description: The location ID associated with this message. + nullable: true + example: 123ID + pageInfo: + title: PageInfo + type: object + properties: + prevPage: + type: string + description: The link to the previous page for pagination. + example: >- + https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902 + nextPage: + type: string + description: The link to the next page for pagination. + example: >- + https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C + prevPageToken: + type: string + description: The isolated pagination token for the previous page. + example: DLAPE902 + nextPageToken: + type: string + description: The isolated pagination token for the next page. + example: GL83PD3C + messagingRequestError: + title: MessagingRequestError + type: object + properties: + type: + type: string + description: + type: string + required: + - type + - description + createMessageRequestError: + title: CreateMessageRequestError + type: object + properties: + type: + type: string + description: + type: string + fieldErrors: + type: array + items: + $ref: '#/components/schemas/fieldError' + required: + - type + - description + id: + type: string + description: The ID of the message. + example: 1589228074636lm4k2je7j7jklbn2 + media: + title: Media + type: object + properties: + content: + type: string + contentLength: + type: integer + mediaName: + type: string + segmentCount: + type: integer + description: >- + The number of segments the user's message is broken into before sending + over carrier networks. + example: 1 + tag: + title: Tag + type: string + description: >- + A custom string that will be included in callback events of the message. + Max 1024 characters. + example: custom string + expiration: + type: string + format: date-time + description: >- + A string with the date/time value that the message will automatically + expire by. This must be a valid RFC-3339 value, e.g., + 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time + in the future. + example: '2021-02-01T11:29:18-05:00' + carrierName: + type: string + description: >- + The name of the Authorized Message Provider (AMP) that handled this + message. + + In the US, this is the carrier that the message was sent to. + + This field is present only when this account feature has been enabled. + example: AT&T + message: + title: Message + type: object + properties: + id: + type: string + description: The id of the message. + example: 1589228074636lm4k2je7j7jklbn2 + owner: + type: string + description: The Bandwidth phone number associated with the message. + example: '+15554443333' + applicationId: + $ref: '#/components/schemas/applicationId' + time: + type: string + format: date-time + description: The datetime stamp of the message in ISO 8601 + example: 2024-12-02T20:15:57.278Z + segmentCount: + $ref: '#/components/schemas/segmentCount' + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + description: The phone number recipients of the message. + example: + - '+15552223333' + from: + type: string + description: The phone number the message was sent from. + example: '+15553332222' + media: + uniqueItems: true + type: array + items: + type: string + description: >- + The list of media URLs sent in the message. Including a `filename` + field in the `Content-Disposition` header of the media linked with a + URL will set the displayed file name. This is a best practice to + ensure that your media has a readable file name. + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + text: + type: string + description: The contents of the message. + example: Hello world + tag: + $ref: '#/components/schemas/tag' + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + $ref: '#/components/schemas/expiration' + messageRequest: + title: MessageRequest + type: object + required: + - applicationId + - to + - from + properties: + applicationId: + $ref: '#/components/schemas/applicationId' + to: + uniqueItems: true + type: array + description: The phone number(s) the message should be sent to in E164 format. + example: + - '+15554443333' + - '+15552223333' + items: + type: string + from: + type: string + description: >- + Either an alphanumeric sender ID or the sender's Bandwidth phone + number in E.164 format, which must be hosted within Bandwidth and + linked to the account that is generating the message. + + Alphanumeric Sender IDs can contain up to 11 characters, upper-case + letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, + plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must + contain at least one letter. + example: '+15551113333' + text: + $ref: '#/components/schemas/messageText' + media: + $ref: '#/components/schemas/messageMedia' + tag: + $ref: '#/components/schemas/tag' + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + $ref: '#/components/schemas/expiration' + messageText: + type: string + description: The contents of the text message. Must be 2048 characters or less. + maxLength: 2048 + example: Hello world + messageMedia: + type: array + items: + type: string + format: uri + maxLength: 4096 + description: |- + A list of URLs to include as media attachments as part of the message. + Each URL can be at most 4096 characters. + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + createMultiChannelMessageResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + example: [] + data: + $ref: '#/components/schemas/multiChannelMessageResponseData' + errors: + type: array + items: + $ref: '#/components/schemas/errorObject' + example: [] + multiChannelError: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + example: [] + data: + type: object + nullable: true + example: null + errors: + type: array + items: + $ref: '#/components/schemas/errorObject' + link: + type: object + properties: + rel: + type: string + href: + type: string + errorObject: + type: object + properties: + type: + description: A concise summary of the error used for categorization. + type: string + description: + description: A detailed explanation of the error. + type: string + source: + $ref: '#/components/schemas/errorSource' + required: + - type + - description + - source + errorSource: + title: Error Source + type: object + description: Specifies relevant sources of the error, if any. + properties: + parameter: + type: string + description: The relevant URI query parameter causing the error + field: + type: string + description: The request body field that led to the error + header: + type: string + description: The header field that contributed to the error + reference: + type: string + description: A resource ID or path linked to the error + multiChannelMessageChannelEnum: + description: The channel of the multi-channel message. + type: string + enum: + - RBM + - SMS + - MMS + example: RBM + multiChannelSenderId: + type: string + description: The sender ID of the message. This could be an alphanumeric sender ID. + example: BandwidthRBM + multiChannelDestination: + type: string + description: The phone number the message should be sent to in E164 format. + example: '+15552223333' + multiChannelDestinations: + uniqueItems: true + type: array + description: The destination phone number(s) of the message, in E164 format. + example: + - '+15554443333' + items: + type: string + rbmMessageContentText: + title: RBM Text + type: object + properties: + text: + type: string + description: >- + The text associated with the message. Must be 3270 characters or + less + maxLength: 3270 + example: Hello world + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - text + rbmMediaHeightEnum: + type: string + description: The height of the media. + enum: + - SHORT + - MEDIUM + - TALL + example: SHORT + rbmMessageContentFile: + title: RBM Rich Media File + type: object + properties: + fileUrl: + type: string + format: uri + description: The URL of the media file. 100MB is the maximum file size. + example: https://dev.bandwidth.com/images/bandwidth-logo.png + maxLength: 1000 + thumbnailUrl: + type: string + format: uri + description: The URL of the thumbnail image. Applies only to video file media. + example: https://dev.bandwidth.com/images/bandwidth-logo.png + maxLength: 1000 + required: + - fileUrl + mmsMessageContentFile: + title: MMS Media File + type: object + properties: + fileUrl: + type: string + format: uri + description: >- + The URL of a media attachment. + + + For MMS, the API limits file size to 3.5MB. Specific carriers and + channels may have a smaller limit that could cause a large file to + fail, see + [here](https://support.bandwidth.com/hc/en-us/articles/360014235473-What-are-the-MMS-file-size-limits) + for more details. + example: https://dev.bandwidth.com/images/bandwidth-logo.png + maxLength: 1000 + required: + - fileUrl + rbmMessageMedia: + title: RBM Media + type: object + properties: + media: + $ref: '#/components/schemas/rbmMessageContentFile' + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - media + rbmCardContent: + type: object + properties: + title: + type: string + description: The title of the card. Must be 200 characters or less. + maxLength: 200 + example: Bandwidth + description: + type: string + description: The description of the card. Must be 2000 characters or less. + maxLength: 2000 + example: Bandwidth is a communications platform as a service (CPaaS) company. + media: + allOf: + - $ref: '#/components/schemas/rbmMessageContentFile' + - type: object + properties: + height: + $ref: '#/components/schemas/rbmMediaHeightEnum' + required: + - height + suggestions: + description: >- + An array of suggested actions for the recipient that will be + displayed on the rich card. + type: array + items: + $ref: '#/components/schemas/multiChannelAction' + maxItems: 4 + rbmStandaloneCard: + title: Standalone Card + type: object + properties: + orientation: + $ref: '#/components/schemas/standaloneCardOrientationEnum' + thumbnailImageAlignment: + $ref: '#/components/schemas/thumbnailAlignmentEnum' + cardContent: + $ref: '#/components/schemas/rbmCardContent' + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - orientation + - thumbnailImageAlignment + - cardContent + standaloneCardOrientationEnum: + type: string + enum: + - HORIZONTAL + - VERTICAL + example: VERTICAL + thumbnailAlignmentEnum: + type: string + description: >- + The alignment of the thumbnail image in the card. Only applicable if the + card using horizontal orientation. + enum: + - LEFT + - RIGHT + example: LEFT + rbmMessageCarouselCard: + title: Carousel + type: object + properties: + cardWidth: + $ref: '#/components/schemas/cardWidthEnum' + cardContents: + type: array + items: + $ref: '#/components/schemas/rbmCardContent' + maxItems: 10 + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - cardContents + - cardWidth + cardWidthEnum: + type: string + enum: + - SMALL + - MEDIUM + example: SMALL + smsMessageContent: + title: SMS Text + type: object + properties: + text: + $ref: '#/components/schemas/messageText' + required: + - text + mmsMessageContent: + title: MMS Message + type: object + properties: + text: + $ref: '#/components/schemas/messageText' + media: + type: array + items: + $ref: '#/components/schemas/mmsMessageContentFile' + rbmMessageContentRichCard: + title: RBM Rich Card + oneOf: + - $ref: '#/components/schemas/rbmStandaloneCard' + - $ref: '#/components/schemas/rbmMessageCarouselCard' + rbmActionTypeEnum: + type: string + enum: + - REPLY + - DIAL_PHONE + - SHOW_LOCATION + - CREATE_CALENDAR_EVENT + - OPEN_URL + - REQUEST_LOCATION + example: REPLY + rbmOpenUrlEnum: + type: string + description: >- + Specifies how the URL should be opened on a mobile device. + + - `BROWSER` Opens the URL in the device's default browser. If + application is not set or the device doesn’t support WebView, this + option is used by default. + + - `WEBVIEW` Opens the URL in an in-app WebView. + enum: + - BROWSER + - WEBVIEW + example: WEBVIEW + rbmWebViewEnum: + type: string + description: >- + Defines the layout of the WebView on a mobile device. It must be defined + when application is set to `WEBVIEW` + + - `FULL` WebView takes the full screen. + + - `HALF` WebView takes half of the screen. + + - `TALL` WebView takes three-quarters of the screen. + enum: + - FULL + - HALF + - TALL + rbmActionText: + title: Text + type: string + description: Displayed text for user to click + maxLength: 25 + example: Hello world + rbmActionPostbackData: + title: Post Back Data + type: string + format: byte + description: Base64 payload the customer receives when the reply is clicked. + maxLength: 2048 + example: SGVsbG8gd29ybGQ= + rbmActionBase: + type: object + properties: + type: + $ref: '#/components/schemas/rbmActionTypeEnum' + text: + $ref: '#/components/schemas/rbmActionText' + postbackData: + $ref: '#/components/schemas/rbmActionPostbackData' + required: + - text + - postbackData + - type + rbmActionDial: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Dial Phone + type: object + properties: + phoneNumber: + type: string + description: The phone number to dial. Must be E164 format. + example: '+15552223333' + required: + - phoneNumber + rbmActionViewLocation: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Show Location + type: object + properties: + latitude: + type: string + format: double + description: The latitude of the location. + example: '37.7749' + longitude: + type: string + format: double + description: The longitude of the location. + example: '-122.4194' + label: + type: string + description: The label of the location. + example: San Francisco + maxLength: 100 + required: + - latitude + - longitude + multiChannelActionCalendarEvent: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Calendar Event + type: object + properties: + title: + type: string + description: The title of the event. + example: Meeting with John + maxLength: 100 + startTime: + type: string + format: date-time + description: The start time of the event. + example: 2022-09-14T18:20:16.000Z + endTime: + type: string + format: date-time + description: The end time of the event. + example: 2022-09-14T18:20:16.000Z + description: + type: string + description: The description of the event. + example: Discuss the new project + maxLength: 500 + required: + - title + - startTime + - endTime + rbmActionOpenUrl: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Open URL + type: object + properties: + url: + type: string + format: uri + description: The URL to open in browser. + example: https://dev.bandwidth.com + maxLength: 2048 + application: + $ref: '#/components/schemas/rbmOpenUrlEnum' + webviewViewMode: + $ref: '#/components/schemas/rbmWebViewEnum' + required: + - url + multiChannelFullActions: + type: array + description: An array of suggested actions for the recipient. + items: + $ref: '#/components/schemas/multiChannelAction' + maxItems: 11 + multiChannelAction: + anyOf: + - $ref: '#/components/schemas/rbmActionBase' + - $ref: '#/components/schemas/rbmActionDial' + - $ref: '#/components/schemas/rbmActionViewLocation' + - $ref: '#/components/schemas/multiChannelActionCalendarEvent' + - $ref: '#/components/schemas/rbmActionOpenUrl' + discriminator: + propertyName: type + mapping: + REPLY: '#/components/schemas/rbmActionBase' + DIAL_PHONE: '#/components/schemas/rbmActionDial' + SHOW_LOCATION: '#/components/schemas/rbmActionViewLocation' + CREATE_CALENDAR_EVENT: '#/components/schemas/multiChannelActionCalendarEvent' + OPEN_URL: '#/components/schemas/rbmActionOpenUrl' + REQUEST_LOCATION: '#/components/schemas/rbmActionBase' + multiChannelChannelListObjectBase: + type: object + properties: + from: + $ref: '#/components/schemas/multiChannelSenderId' + applicationId: + $ref: '#/components/schemas/applicationId' + channel: + $ref: '#/components/schemas/multiChannelMessageChannelEnum' + required: + - from + - applicationId + - channel + multiChannelChannelListRBMObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - type: object + properties: + content: + description: The content of the message. + oneOf: + - $ref: '#/components/schemas/rbmMessageContentText' + - $ref: '#/components/schemas/rbmMessageMedia' + - $ref: '#/components/schemas/rbmMessageContentRichCard' + required: + - content + multiChannelChannelListSMSObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - type: object + properties: + content: + $ref: '#/components/schemas/smsMessageContent' + required: + - content + multiChannelChannelListMMSObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - type: object + properties: + content: + $ref: '#/components/schemas/mmsMessageContent' + required: + - content + multiChannelChannelListRBMResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + multiChannelChannelListSMSResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListSMSObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + multiChannelChannelListMMSResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListMMSObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + multiChannelChannelListRequestObject: + anyOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMObject' + - $ref: '#/components/schemas/multiChannelChannelListSMSObject' + - $ref: '#/components/schemas/multiChannelChannelListMMSObject' + discriminator: + propertyName: channel + mapping: + RBM: '#/components/schemas/multiChannelChannelListRBMObject' + SMS: '#/components/schemas/multiChannelChannelListSMSObject' + MMS: '#/components/schemas/multiChannelChannelListMMSObject' + multiChannelChannelListOwnerObject: + type: object + properties: + owner: + type: string + description: >- + The Bandwidth senderId associated with the message. Identical to + 'from'. + required: + - owner + multiChannelChannelListResponseObject: + anyOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMResponseObject' + - $ref: '#/components/schemas/multiChannelChannelListSMSResponseObject' + - $ref: '#/components/schemas/multiChannelChannelListMMSResponseObject' + discriminator: + propertyName: channel + mapping: + RBM: '#/components/schemas/multiChannelChannelListRBMResponseObject' + SMS: '#/components/schemas/multiChannelChannelListSMSResponseObject' + MMS: '#/components/schemas/multiChannelChannelListMMSResponseObject' + multiChannelMessageRequest: + description: Multi-Channel Message Request + type: object + properties: + to: + $ref: '#/components/schemas/multiChannelDestination' + channelList: + type: array + description: >- + A list of message bodies. The messages will be attempted in the + order they are listed. Once a message sends successfully, the others + will be ignored. + items: + $ref: '#/components/schemas/multiChannelChannelListRequestObject' + maxItems: 4 + tag: + $ref: '#/components/schemas/tag' + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + $ref: '#/components/schemas/expiration' + required: + - to + - channelList + multiChannelMessageResponseData: + description: The data returned in a multichannel message response. + type: object + properties: + id: + $ref: '#/components/schemas/id' + time: + description: The time the message was received by the Bandwidth API. + type: string + format: date-time + example: 2025-01-01T18:20:16.000Z + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + $ref: '#/components/schemas/multiChannelDestinations' + channelList: + type: array + description: >- + A list of message bodies. The messages will be attempted in the + order they are listed. Once a message sends successfully, the others + will be ignored. + items: + $ref: '#/components/schemas/multiChannelChannelListResponseObject' + maxItems: 4 + tag: + $ref: '#/components/schemas/tag' + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + $ref: '#/components/schemas/expiration' + required: + - id + - time + - direction + - to + - channelList + multiChannelMessageContent: + description: The structure of the content field of a multichannel message. + type: object + properties: + text: + type: string + media: + $ref: '#/components/schemas/rbmMessageContentFile' + rbmSuggestionResponse: + type: object + properties: + text: + type: string + description: The text associated with the suggestion response. + example: Yes, I would like to proceed + postbackData: + $ref: '#/components/schemas/rbmActionPostbackData' + rbmLocationResponse: + type: object + properties: + latitude: + type: string + format: double + description: The latitude of the client's location. + example: '37.7749' + longitude: + type: string + format: double + description: The longitude of the client's location. + example: '-122.4194' + callback: + description: >- + Callbacks are divided into two types based on direction of the related + message: + + - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM + message. + + - `inboundCallback` indicates an inbound MO message or a multichannel + message client's response to a suggestion or location request. + type: object + oneOf: + - $ref: '#/components/schemas/statusCallback' + - $ref: '#/components/schemas/inboundCallback' + discriminator: + propertyName: type + mapping: + message-sent: '#/components/schemas/statusCallback' + message-delivered: '#/components/schemas/statusCallback' + message-failed: '#/components/schemas/statusCallback' + message-read: '#/components/schemas/statusCallback' + message-received: '#/components/schemas/inboundCallback' + request-location-response: '#/components/schemas/inboundCallback' + suggestion-response: '#/components/schemas/inboundCallback' + statusCallback: + type: object + description: >- + Represents a status callback for an outbound MT SMS or MMS or RBM + message. + properties: + time: + type: string + format: date-time + example: 2024-12-02T20:15:57.278Z + eventTime: + type: string + description: >- + Represents the time at which the message was read, for + `message-read` callbacks. + format: date-time + example: 2024-12-02T20:15:58.278Z + type: + $ref: '#/components/schemas/statusCallbackTypeEnum' + to: + type: string + description: >- + The destination phone number the message was sent to. + + For status callbacks, this the the Bandwidth user's client phone + number. + example: '+15552223333' + description: + type: string + description: A detailed description of the event described by the callback. + example: Message delivered to carrier. + message: + $ref: '#/components/schemas/statusCallbackMessage' + errorCode: + type: integer + description: Optional error code, applicable only when type is `message-failed`. + example: 4405 + carrierName: + $ref: '#/components/schemas/carrierName' + required: + - time + - type + - to + - description + - message + inboundCallback: + type: object + description: Represents an inbound callback. + properties: + time: + type: string + format: date-time + example: 2024-12-02T20:15:57.278Z + type: + $ref: '#/components/schemas/inboundCallbackTypeEnum' + to: + type: string + description: > + The destination phone number the message was sent to. + + For inbound callbacks, this is the Bandwidth number or alphanumeric + identifier that received the message. + example: '+15552223333' + description: + type: string + description: A detailed description of the event described by the callback. + example: Incoming message received + message: + $ref: '#/components/schemas/inboundCallbackMessage' + carrierName: + $ref: '#/components/schemas/carrierName' + required: + - time + - type + - to + - description + - message + statusCallbackTypeEnum: + type: string + description: >- + The possible status callbacks when sending an MT SMS or MMS or RBM + message: + + - `message-sending` indicates that Bandwidth is sending the message to + the upstream provider. + + - `message-delivered` indicates that the message was successfully sent. + + - `message-failed` indicates that the message could not be sent to the + intended recipient. + + - `message-read` indicates that the RBM message was read by the + recipient. + enum: + - message-sending + - message-delivered + - message-failed + - message-read + example: message-delivered + inboundCallbackTypeEnum: + type: string + description: >- + The possible inbound callback types originating from MO messages or + multichannel message client responses: + + - `message-received` indicates an MO message from a Bandwidth user's + client to a Bandwidth number. + + - `request-location-response` indicates a response to a location request + sent by the Bandwidth user's client after receiving an RBM message. + + - `suggestion-response` indicates a response to a suggestion sent by the + Bandwidth user's client after receiving an RBM message. + enum: + - message-received + - request-location-response + - suggestion-response + example: message-received + statusCallbackMessage: + description: Message payload schema within a callback + type: object + properties: + id: + type: string + description: A unique identifier of the message. + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + description: >- + The Bandwidth phone number or alphanumeric identifier associated + with the message. + example: '+15553332222' + applicationId: + $ref: '#/components/schemas/applicationId' + time: + type: string + format: date-time + example: 2024-12-02T20:15:57.666Z + segmentCount: + $ref: '#/components/schemas/segmentCount' + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + description: The phone number recipients of the message. + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + description: >- + The Bandwidth phone number or alphanumeric identifier the message + was sent from. + example: '+15553332222' + text: + type: string + example: Hello world + tag: + $ref: '#/components/schemas/tag' + media: + type: array + description: Optional media, not applicable for sms + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + channel: + $ref: '#/components/schemas/multiChannelMessageChannelEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + inboundCallbackMessage: + allOf: + - $ref: '#/components/schemas/statusCallbackMessage' + - type: object + properties: + content: + $ref: '#/components/schemas/multiChannelMessageContent' + suggestionResponse: + $ref: '#/components/schemas/rbmSuggestionResponse' + locationResponse: + $ref: '#/components/schemas/rbmLocationResponse' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + callbackMethodEnum: + type: string + nullable: true + default: POST + enum: + - GET + - POST + description: >- + The HTTP method to use to deliver the callback. GET or POST. Default + value is POST. + example: POST + redirectMethodEnum: + type: string + nullable: true + default: POST + enum: + - GET + - POST + description: >- + The HTTP method to use for the request to `redirectUrl`. GET + + or POST. Default value is POST.

Not allowed if `state` is + `completed`. + example: POST + recordingStateEnum: + type: string + enum: + - paused + - recording + description: |- + The recording state. Possible values: + + `paused` to pause an active recording + + `recording` to resume a paused recording + example: paused + callDirectionEnum: + type: string + enum: + - inbound + - outbound + description: The direction of the call. + example: inbound + fileFormatEnum: + type: string + enum: + - mp3 + - wav + description: The format that the recording is stored in. + example: wav + callStateEnum: + nullable: true + type: string + default: active + enum: + - active + - completed + description: >- + The call state. Possible values:
`active` to redirect the + + call (default)
`completed` to hang up the call if it is answered, + cancel + + it if it is an unanswered outbound call, or reject it if it an + unanswered + + inbound call + example: completed + conferenceStateEnum: + nullable: true + type: string + default: active + enum: + - active + - completed + description: >- + Setting the conference state to `completed` ends the conference and + ejects all members. + example: completed + machineDetectionModeEnum: + type: string + default: async + enum: + - sync + - async + description: >- + The machine detection mode. If set to 'async', the detection + + result will be sent in a 'machineDetectionComplete' callback. If set to + + 'sync', the 'answer' callback will wait for the machine detection to + complete + + and will include its result. + example: async + callTranscriptionDetectedLanguageEnum: + type: string + enum: + - en-US + - es-US + - fr-FR + description: The detected language for this transcription. + example: en-US + callTranscriptionTrackEnum: + type: string + enum: + - inbound + - outbound + description: Which `track` this transcription is derived from. + example: inbound + createCall: + type: object + required: + - answerUrl + - applicationId + - from + - to + properties: + to: + type: string + description: >- + The destination to call (must be an E.164 formatted number + + (e.g. `+15555551212`) or a SIP URI (e.g. + `sip:user@server.example`)). + example: '+19195551234' + from: + type: string + description: >- + A Bandwidth phone number on your account the call should come + + from (must be in E.164 format, like `+15555551212`) even if + `privacy` is set to true. + example: '+15555551212' + privacy: + nullable: true + type: boolean + description: >- + Hide the calling number. The `displayName` field can be used to + customize the displayed name. + example: false + displayName: + nullable: true + type: string + description: >- + The caller display name to use when the call is created. + + May not exceed 256 characters nor contain control characters such as + new lines. + + If `privacy` is true, only the following values are valid: + `Restricted`, `Anonymous`, `Private`, or `Unavailable`. + maxLength: 256 + example: John Doe + uui: + nullable: true + type: string + example: >- + eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64 + description: >- + A comma-separated list of 'User-To-User' headers to be sent + + in the INVITE when calling a SIP URI. Each value must end with an + 'encoding' + + parameter as described in RFC + + 7433. Only 'jwt', 'base64' and 'hex' encodings are allowed. The + entire value + + cannot exceed 350 characters, including parameters and separators. + applicationId: + type: string + description: The id of the application associated with the `from` number. + example: 1234-qwer-5679-tyui + answerUrl: + type: string + format: uri + description: >- + The full URL to send the Answer + + event to when the called party answers. This endpoint should return + the + + first BXML document to be executed in + the + + call. + + + Must use `https` if specifying `username` and `password`. + maxLength: 2048 + example: https://www.myCallbackServer.example/webhooks/answer + answerMethod: + $ref: '#/components/schemas/callbackMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + answerFallbackUrl: + nullable: true + type: string + format: uri + description: >- + A fallback url which, if provided, will be used to retry the + + `answer` webhook delivery in case `answerUrl` fails to respond + + + Must use `https` if specifying `fallbackUsername` and + `fallbackPassword`. + maxLength: 2048 + example: https://www.myFallbackServer.example/webhooks/answer + answerFallbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + disconnectUrl: + nullable: true + type: string + format: uri + description: >- + The URL to send the Disconnect event to when + the call ends. This event does not expect a BXML response. + maxLength: 2048 + example: https://www.myCallbackServer.example/webhooks/disconnect + disconnectMethod: + $ref: '#/components/schemas/callbackMethodEnum' + callTimeout: + nullable: true + type: number + format: double + description: >- + The timeout (in seconds) for the callee to answer the call + + after it starts ringing. If the call does not start ringing within + 30s, + + the call will be cancelled regardless of this value. Can be any + numeric + + value (including decimals) between 1 and 300. + minimum: 1 + maximum: 300 + default: 30 + example: 30 + callbackTimeout: + nullable: true + type: number + format: double + description: >- + This is the timeout (in seconds) to use when delivering webhooks + + for the call. Can be any numeric value (including decimals) between + 1 + + and 25. + minimum: 1 + maximum: 25 + default: 15 + example: 15 + machineDetection: + $ref: '#/components/schemas/machineDetectionConfiguration' + priority: + nullable: true + type: integer + minimum: 1 + maximum: 5 + default: 5 + description: >- + The priority of this call over other calls from your account. For + example, if during a call + + your application needs to place a new call and bridge it with the + current + + call, you might want to create the call with priority 1 so that it + will + + be the next call picked off your queue, ahead of other less time + sensitive + + calls. A lower value means higher priority, so a priority 1 call + takes + + precedence over a priority 2 call. + example: 5 + tag: + nullable: true + type: string + description: >- + A custom string that will be sent with all webhooks for this + + call unless overwritten by a future `` + + verb or `tag` attribute on another verb, or cleared. + + + May be cleared by setting `tag=""` + + + Max length 256 characters. + maxLength: 256 + example: arbitrary text here + createCallResponse: + type: object + required: + - accountId + - answerMethod + - answerUrl + - applicationId + - callId + - callUrl + - disconnectMethod + - from + - to + properties: + applicationId: + type: string + example: 04e88489-df02-4e34-a0ee-27a91849555f + description: The id of the application associated with the `from` number. + accountId: + type: string + example: '9900000' + description: The bandwidth account ID associated with the call. + callId: + type: string + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + description: Programmable Voice API Call ID. + to: + type: string + example: '+19195551234' + description: Recipient of the outgoing call. + from: + type: string + example: '+19195554321' + description: Phone number that created the outbound call. + enqueuedTime: + nullable: true + type: string + format: date-time + description: The time at which the call was accepted into the queue. + example: '2022-06-16T13:15:07.160Z' + callUrl: + type: string + format: uri + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + description: The URL to update this call's state. + callTimeout: + type: number + format: double + example: 30 + description: >- + The timeout (in seconds) for the callee to answer the call after it + starts ringing. + callbackTimeout: + type: number + format: double + example: 15 + description: >- + This is the timeout (in seconds) to use when delivering webhooks for + the call. + tag: + nullable: true + type: string + example: My custom tag value + description: Custom tag value. + answerMethod: + $ref: '#/components/schemas/callbackMethodEnum' + answerUrl: + type: string + format: uri + example: https://myServer.example/bandwidth/webhooks/answer + description: URL to deliver the `answer` event webhook. + answerFallbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + answerFallbackUrl: + nullable: true + type: string + format: uri + example: https://myFallbackServer.example/bandwidth/webhooks/answer + description: Fallback URL to deliver the `answer` event webhook. + disconnectMethod: + $ref: '#/components/schemas/callbackMethodEnum' + disconnectUrl: + nullable: true + type: string + format: uri + example: https://myServer.example/bandwidth/webhooks/disconnect + description: URL to deliver the `disconnect` event webhook. + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + priority: + nullable: true + type: integer + example: 5 + description: The priority of this call over other calls from your account. + callState: + type: object + properties: + applicationId: + type: string + description: The application id associated with the call. + example: 04e88489-df02-4e34-a0ee-27a91849555f + accountId: + type: string + description: The account id associated with the call. + example: '9900000' + callId: + type: string + description: The programmable voice API call ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + parentCallId: + nullable: true + type: string + description: >- + The A-leg call id, set only if this call is the B-leg of a + [``](/docs/voice/bxml/transfer). + example: c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + to: + type: string + description: >- + The phone number that received the call, in E.164 format (e.g. + +15555555555), or if the call was to a SIP URI, the SIP URI. + example: '+19195551234' + from: + type: string + description: >- + The phone number that made the call, in E.164 format (e.g. + +15555555555). + example: '+19195554321' + direction: + $ref: '#/components/schemas/callDirectionEnum' + state: + description: >- + The current state of the call. Current possible values are + + `queued`, `initiated`, `answered` and `disconnected`. Additional + states + + may be added in the future, so your application must be tolerant of + unknown + + values. + type: string + example: disconnected + stirShaken: + nullable: true + type: object + description: >- + For inbound calls, the Bandwidth STIR/SHAKEN implementation will + verify the information provided in the inbound invite request + `Identity` header. + + The verification status is stored in the call state `stirShaken` + property as follows. + + + | Property | Description | + + |:------------------|:------------| + + | verstat | (optional) The verification status indicating whether + the verification was successful or not. Possible values are + `TN-Validation-Passed` or `TN-Validation-Failed`. | + + | attestationIndicator | (optional) The attestation level verified + by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` + (gateway). | + + | originatingId | (optional) A unique origination identifier. | + + + Note that these are common properties but that the `stirShaken` + object is free form and can contain other key-value pairs. + + + More information: [Understanding + STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). + additionalProperties: + type: string + example: + verstat: TN-Validation-Passed + attestationIndicator: A + originatingId: abc123 + identity: + nullable: true + type: string + description: >- + The value of the `Identity` header from the inbound invite + + request. Only present for inbound calls and if the account is + configured + + to forward this header. + example: >- + eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken + enqueuedTime: + nullable: true + type: string + format: date-time + description: The time this call was placed in queue. + example: '2022-06-16T13:15:07.160Z' + startTime: + nullable: true + type: string + format: date-time + description: >- + The time the call was initiated, in ISO 8601 format. `null` if the + call is still in your queue. + example: '2022-06-16T13:15:07.160Z' + answerTime: + nullable: true + type: string + format: date-time + description: >- + Populated once the call has been answered, with the time in ISO 8601 + format. + example: '2022-06-16T13:15:18.126Z' + endTime: + nullable: true + type: string + format: date-time + description: Populated once the call has ended, with the time in ISO 8601 format. + example: '2022-06-16T13:15:18.314Z' + disconnectCause: + nullable: true + type: string + description: >- + | Cause | Description | + + |:------|:------------| + + | `hangup`| One party hung up the call, a + [``](../../bxml/verbs/hangup.md) verb was executed, or there + was no more BXML to execute; it indicates that the call ended + normally. | + + | `busy` | Callee was busy. | + + | `timeout` | Call wasn't answered before the `callTimeout` was + reached. | + + | `cancel` | Call was cancelled by its originator while it was + ringing. | + + | `rejected` | Call was rejected by the callee. | + + | `callback-error` | BXML callback couldn't be delivered to your + callback server. | + + | `invalid-bxml` | Invalid BXML was returned in response to a + callback. | + + | `application-error` | An unsupported action was tried on the call, + e.g. trying to play a .ogg audio. | + + | `account-limit` | Account rate limits were reached. | + + | `node-capacity-exceeded` | System maximum capacity was reached. | + + | `error` | Some error not described in any of the other causes + happened on the call. | + + | `unknown` | Unknown error happened on the call. | + + + Note: This list is not exhaustive and other values can appear in the + future. + errorMessage: + nullable: true + type: string + description: >- + Populated only if the call ended with an error, with text explaining + the reason. + example: null + errorId: + nullable: true + type: string + description: >- + Populated only if the call ended with an error, with a Bandwidth + internal id that references the error event. + example: null + lastUpdate: + type: string + format: date-time + description: The last time the call had a state update, in ISO 8601 format. + example: '2022-06-16T13:15:18.314Z' + updateCall: + type: object + properties: + state: + $ref: '#/components/schemas/callStateEnum' + redirectUrl: + description: |- + The URL to send the [Redirect](/docs/voice/bxml/redirect) event + to which will provide new BXML. + + Required if `state` is `active`. + + Not allowed if `state` is `completed`. + nullable: true + type: string + format: uri + example: https://myServer.example/bandwidth/webhooks/redirect + redirectMethod: + $ref: '#/components/schemas/redirectMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + redirectFallbackUrl: + nullable: true + type: string + format: uri + description: |- + A fallback url which, if provided, will be used to retry the + redirect callback delivery in case `redirectUrl` fails to respond. + example: https://myFallbackServer.example/bandwidth/webhooks/redirect + redirectFallbackMethod: + $ref: '#/components/schemas/redirectMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + tag: + nullable: true + type: string + description: >- + A custom string that will be sent with this and all future + + callbacks unless overwritten by a future `tag` attribute or + [``](/docs/voice/bxml/tag) + + verb, or cleared. + + + May be cleared by setting `tag=""`. + + + Max length 256 characters. + + + Not allowed if `state` is `completed`. + maxLength: 256 + example: My Custom Tag + updateCallRecording: + type: object + required: + - state + properties: + state: + $ref: '#/components/schemas/recordingStateEnum' + accountStatistics: + type: object + properties: + currentCallQueueSize: + type: integer + description: The number of calls currently enqueued. + example: 0 + maxCallQueueSize: + type: integer + description: >- + The maximum size of the queue before outgoing calls start being + rejected. + example: 900 + callRecordingMetadata: + type: object + properties: + applicationId: + $ref: '#/components/schemas/applicationId1' + accountId: + $ref: '#/components/schemas/accountId' + callId: + $ref: '#/components/schemas/callId' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + to: + $ref: '#/components/schemas/to' + from: + $ref: '#/components/schemas/from' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + duration: + $ref: '#/components/schemas/duration' + direction: + $ref: '#/components/schemas/callDirectionEnum' + channels: + $ref: '#/components/schemas/channels' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + status: + $ref: '#/components/schemas/status' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + transcription: + $ref: '#/components/schemas/recordingTranscriptionMetadata' + recordingName: + $ref: '#/components/schemas/recordingName' + conference: + type: object + properties: + id: + type: string + description: The Bandwidth-generated conference ID. + example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + name: + type: string + description: The name of the conference, as specified by your application. + example: my-conference-name + createdTime: + type: string + format: date-time + description: The time the conference was initiated, in ISO 8601 format. + example: '2022-06-17T22:19:40.375Z' + completedTime: + nullable: true + type: string + format: date-time + description: The time the conference was terminated, in ISO 8601 format. + example: '2022-06-17T22:20:00.000Z' + conferenceEventUrl: + nullable: true + type: string + format: uri + description: The URL to send the conference-related events. + example: https://myServer.example/bandwidth/webhooks/conferenceEvent + conferenceEventMethod: + $ref: '#/components/schemas/callbackMethodEnum' + tag: + nullable: true + type: string + description: >- + The custom string attached to the conference that will be sent with + callbacks. + example: my custom tag + activeMembers: + type: array + nullable: true + items: + $ref: '#/components/schemas/conferenceMember' + description: >- + A list of active members of the conference. Omitted if this + + is a response to the [Get Conferences + endpoint](/apis/voice#tag/Conferences/operation/listConferences). + updateConference: + type: object + properties: + status: + $ref: '#/components/schemas/conferenceStateEnum' + redirectUrl: + nullable: true + type: string + format: uri + description: >- + The URL to send the + [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) + + event which will provide new BXML. Not allowed if `state` is + `completed`, + + but required if `state` is `active`. + example: https://myServer.example/bandwidth/webhooks/conferenceRedirect + redirectMethod: + $ref: '#/components/schemas/redirectMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + redirectFallbackUrl: + nullable: true + type: string + format: uri + description: >- + A fallback url which, if provided, will be used to retry the + + `conferenceRedirect` webhook delivery in case `redirectUrl` fails to + respond. Not + + allowed if `state` is `completed`. + example: >- + https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect + redirectFallbackMethod: + $ref: '#/components/schemas/redirectMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + conferenceMember: + type: object + properties: + callId: + $ref: '#/components/schemas/callId' + conferenceId: + $ref: '#/components/schemas/conferenceId' + memberUrl: + type: string + format: uri + description: >- + A URL that may be used to retrieve information about or update + + the state of this conference member. This is the URL of this + member's + + [Get Conference + Member](/apis/voice-apis/voice/#tag/Conferences/operation/getConferenceMember) + endpoint + + and [Modify Conference + Member](/apis/voice-apis/voice/#tag/Conferences/operation/updateConferenceMember) + + endpoint. + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + mute: + type: boolean + description: >- + Whether or not this member is currently muted. Members who are muted + are still able to hear other participants. + + + If used in a PUT request, updates this member's mute status. Has no + effect if omitted. + example: false + hold: + type: boolean + description: >- + Whether or not this member is currently on hold. Members who are on + hold are not able to hear or speak in the conference. + + + If used in a PUT request, updates this member's hold status. Has no + effect if omitted. + example: false + callIdsToCoach: + nullable: true + type: array + items: + type: string + description: >- + If this member had a value set for `callIdsToCoach` in its + [Conference](/docs/voice/bxml/conference) verb or this list was + added with a previous PUT request to modify the member, this is that + list of calls. + + + If present in a PUT request, modifies the calls that this member is + coaching. Has no effect if omitted. See the documentation for the + [Conference](/docs/voice/bxml/conference) verb for more details + about coaching. + + Note that this will not add the matching calls to the conference; + each call must individually execute a Conference verb to join. + example: + - c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + updateConferenceMember: + type: object + properties: + mute: + type: boolean + description: >- + Whether or not this member is currently muted. Members who are muted + are still able to hear other participants. + + + Updates this member's mute status. Has no effect if omitted. + example: false + hold: + type: boolean + description: >- + Whether or not this member is currently on hold. Members who are on + hold are not able to hear or speak in the conference. + + + Updates this member's hold status. Has no effect if omitted. + example: false + callIdsToCoach: + nullable: true + type: array + items: + type: string + description: >- + If this member had a value set for `callIdsToCoach` in its + [Conference](/docs/voice/bxml/conference) verb or this list was + added with a previous PUT request to modify the member, this is that + list of calls. + + + Modifies the calls that this member is coaching. Has no effect if + omitted. See the documentation for the + [Conference](/docs/voice/bxml/conference) verb for more details + about coaching. + + + Note that this will not add the matching calls to the conference; + each call must individually execute a Conference verb to join. + example: + - c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + conferenceRecordingMetadata: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + recordingId: + $ref: '#/components/schemas/recordingId' + duration: + $ref: '#/components/schemas/duration' + channels: + $ref: '#/components/schemas/channels' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + status: + $ref: '#/components/schemas/status' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + recordingName: + $ref: '#/components/schemas/recordingName' + machineDetectionConfiguration: + type: object + description: >- + The machine detection request used to perform machine detection on the + call. Currently, there is an issue where decimal values are not getting + processed correctly. Please use whole number values. We are working to + resolve this issue. Please contact Bandwidth Support if you need more + information. + properties: + mode: + $ref: '#/components/schemas/machineDetectionModeEnum' + detectionTimeout: + nullable: true + type: number + format: double + description: >- + The timeout used for the whole operation, in seconds. If no + + result is determined in this period, a callback with a `timeout` + result + + is sent. + default: 15 + example: 15 + silenceTimeout: + nullable: true + type: number + format: double + description: >- + If no speech is detected in this period, a callback with a 'silence' + result is sent. + default: 10 + example: 10 + speechThreshold: + nullable: true + type: number + format: double + description: >- + When speech has ended and a result couldn't be determined based + + on the audio content itself, this value is used to determine if the + speaker + + is a machine based on the speech duration. If the length of the + speech + + detected is greater than or equal to this threshold, the result will + be + + 'answering-machine'. If the length of speech detected is below this + threshold, + + the result will be 'human'. + default: 10 + example: 10 + speechEndThreshold: + nullable: true + type: number + format: double + description: >- + Amount of silence (in seconds) before assuming the callee has + finished speaking. + default: 5 + example: 5 + machineSpeechEndThreshold: + nullable: true + type: number + format: double + description: >- + When an answering machine is detected, the amount of silence (in + seconds) before assuming the message has finished playing. + + If not provided it will default to the speechEndThreshold value. + example: 5 + delayResult: + nullable: true + type: boolean + description: >- + If set to 'true' and if an answering machine is detected, the + + 'answering-machine' callback will be delayed until the machine is + done + + speaking, or an end of message tone is detected, or until the + 'detectionTimeout' is exceeded. If false, the 'answering-machine' + + result is sent immediately. + default: false + example: false + callbackUrl: + nullable: true + description: >- + The URL to send the 'machineDetectionComplete' webhook when the + detection is completed. Only for 'async' mode. + type: string + format: uri + maxLength: 2048 + example: https://myServer.example/bandwidth/webhooks/machineDetectionComplete + callbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + fallbackUrl: + nullable: true + type: string + format: uri + description: >- + A fallback URL which, if provided, will be used to retry the + + machine detection complete webhook delivery in case `callbackUrl` + fails + + to respond + maxLength: 2048 + example: >- + https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete + fallbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + transcribeRecording: + type: object + properties: + callbackUrl: + type: string + format: uri + description: >- + The URL to send the + [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) + + event to. You should not include sensitive or + personally-identifiable + + information in the callbackUrl field! Always use the proper username + and + + password fields for authorization. + example: https://myServer.example/bandwidth/webhooks/transcriptionAvailable + callbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + tag: + $ref: '#/components/schemas/tag1' + callbackTimeout: + nullable: true + type: number + format: double + minimum: 1 + maximum: 25 + default: 15 + description: >- + This is the timeout (in seconds) to use when delivering the + + webhook to `callbackUrl`. Can be any numeric value (including + decimals) + + between 1 and 25. + example: 5.5 + detectLanguage: + type: boolean + nullable: true + description: >- + A boolean value to indicate that the recording may not be in + English, and the transcription service will need to detect the + dominant language the recording is in and transcribe accordingly. + Current supported languages are English, French, and Spanish. + default: false + example: true + recordingTranscriptions: + type: object + properties: + transcripts: + type: array + items: + $ref: '#/components/schemas/transcription' + callTranscriptionMetadataList: + type: array + items: + $ref: '#/components/schemas/callTranscriptionMetadata' + example: + - transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + transcriptionName: live_transcription + transcriptionUrl: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + callTranscriptionMetadata: + type: object + properties: + transcriptionId: + type: string + description: The programmable voice API transcription ID. + example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + transcriptionName: + type: string + description: >- + The programmable voice API transcription name. This name could be + provided by the user when creating the transcription. + example: live_transcription + transcriptionUrl: + type: string + description: >- + A URL that may be used to retrieve the transcription itself. This + points to the + + [Get Call + Transcription](/apis/voice-apis/voice/#tag/Transcriptions/operation/getRealTimeTranscription) + endpoint. + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + callTranscriptionResponse: + type: object + properties: + accountId: + type: string + description: The user account associated with the call. + example: '9900000' + callId: + type: string + description: The call id associated with the event. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + transcriptionId: + type: string + description: The programmable voice API transcription ID. + example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + tracks: + type: array + items: + $ref: '#/components/schemas/callTranscription' + example: + - detectedLanguage: en-US + track: inbound + transcript: Hello World! This is an example. + confidence: 0.9 + callTranscription: + type: object + properties: + detectedLanguage: + $ref: '#/components/schemas/callTranscriptionDetectedLanguageEnum' + track: + $ref: '#/components/schemas/callTranscriptionTrackEnum' + transcript: + type: string + description: The transcription itself. + example: Hello World! This is an example. + confidence: + type: number + format: double + minimum: 0 + maximum: 1 + description: >- + How confident the transcription engine was in transcribing the + associated audio (from `0` to `1`). + example: 0.9 + recordingTranscriptionMetadata: + nullable: true + type: object + description: If the recording was transcribed, metadata about the transcription + properties: + id: + type: string + description: The unique transcription ID + example: t-387bd648-18f3-4823-9d16-746bca0003c9 + status: + $ref: '#/components/schemas/status' + completedTime: + type: string + format: date-time + description: The time that the transcription was completed + example: '2022-06-13T18:46:29.715Z' + url: + type: string + format: uri + description: The URL of the [transcription](#operation/getCallTranscription) + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription + voiceApiError: + type: object + properties: + type: + type: string + description: + type: string + id: + nullable: true + type: string + answerCallback: + type: object + description: >- + The Answer event is sent to the answerUrl specified in the createCall + request when an outbound call is answered. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + machineDetectionResult: + $ref: '#/components/schemas/machineDetectionResult' + bridgeCompleteCallback: + type: object + description: >- + If the target call leaves the , then this callback is sent to + the bridgeCompleteUrl, and the BXML returned in it is executed on the + call. If this webhook is sent, the Bridge Target Complete webhook is NOT + sent. This callback is also sent if any problem occurs that prevents the + calls to be bridged. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + bridgeTargetCompleteCallback: + type: object + description: >- + If the originating call leaves the , then this callback is sent + to the bridgeTargetCompleteUrl, and the BXML returned in it is executed + on the target call. If this webhook is sent, the Bridge Complete webhook + is NOT sent. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + conferenceCreatedCallback: + type: object + description: >- + The Conference Created event is fired whenever a new conference that + specified a callbackUrl is created. The response may be either empty or + a BXML document. Only the following verbs are valid for conferences: + PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, + ResumeRecording. Audio verbs will be heard by all members of the + conference. Recordings capture audio from all members who are not muted + or on hold, as well as any audio verbs that are played into the + conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + tag: + $ref: '#/components/schemas/tag1' + conferenceRedirectCallback: + type: object + description: >- + The Conference Redirect event is fired whenever an existing conference + is modified via a POST request made to the /conferences/{conferenceId} + endpoint. The response may be either empty or a BXML document. Only the + following verbs are valid for conferences: PlayAudio, SpeakSentence, + StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio + verbs will be heard by all members of the conference. Recordings capture + audio from all members who are not muted or on hold, as well as any + audio verbs that are played into the conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + tag: + $ref: '#/components/schemas/tag1' + conferenceMemberJoinCallback: + type: object + description: >- + The Conference Member Join event is fired whenever a caller joins a + conference that specified a callbackUrl. The response may be either + empty or a BXML document. Only the following verbs are valid for + conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, + PauseRecording, ResumeRecording. Audio verbs will be heard by all + members of the conference. Recordings capture audio from all members who + are not muted or on hold, as well as any audio verbs that are played + into the conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + tag: + $ref: '#/components/schemas/tag1' + conferenceMemberExitCallback: + type: object + description: >- + The Conference Member Exit event is fired whenever a caller exits a + conference that specified a callbackUrl. The response may be either + empty or a BXML document. Only the following verbs are valid for + conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, + PauseRecording, ResumeRecording. Audio verbs will be heard by all + members of the conference. Recordings capture audio from all members who + are not muted or on hold, as well as any audio verbs that are played + into the conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + tag: + $ref: '#/components/schemas/tag1' + conferenceCompletedCallback: + type: object + description: >- + The Conference Completed event is fired when the last member leaves the + conference. The response to this event may not contain BXML. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + tag: + $ref: '#/components/schemas/tag1' + conferenceRecordingAvailableCallback: + type: object + description: >- + The Conference Recording Available event is sent after a conference + recording has been processed. It indicates that the recording is + available for download. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + accountId: + $ref: '#/components/schemas/accountId' + recordingId: + $ref: '#/components/schemas/recordingId' + channels: + $ref: '#/components/schemas/channels' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + tag: + $ref: '#/components/schemas/tag1' + status: + $ref: '#/components/schemas/status' + disconnectCallback: + type: object + description: The Disconnect event is fired when a call ends, for any reason. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + endTime: + $ref: '#/components/schemas/endTime' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + tag: + $ref: '#/components/schemas/tag1' + dtmfCallback: + type: object + description: >- + The DTMF event is sent for every digit detected after a + verb is executed. You may not respond to this event with BXML. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + direction: + $ref: '#/components/schemas/callDirectionEnum' + digit: + $ref: '#/components/schemas/digit' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + parentCallId: + $ref: '#/components/schemas/parentCallId' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + tag: + $ref: '#/components/schemas/tag1' + gatherCallback: + type: object + description: >- + The gather event is sent after a verb is executed. Its purpose + is to report the gathered digits to the calling application. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + digits: + $ref: '#/components/schemas/digits' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + parentCallId: + $ref: '#/components/schemas/parentCallId' + terminatingDigit: + $ref: '#/components/schemas/terminatingDigit' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + tag: + $ref: '#/components/schemas/tag1' + initiateCallback: + type: object + description: >- + The Initiate event is fired when an inbound call is received for a + Telephone Number on your Account. It is sent to the URL specified in the + application associated with the location (sip-peer) that the called + telephone number belongs to. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + startTime: + $ref: '#/components/schemas/startTime' + diversion: + $ref: '#/components/schemas/diversion' + stirShaken: + $ref: '#/components/schemas/stirShaken' + uui: + $ref: '#/components/schemas/uui' + machineDetectionCompleteCallback: + type: object + description: >- + This event is sent to the url informed when requesting a machine + detection operation. It contains the machine detection operation result, + which can be: human, answering-machine, silence, timeout, error. This + event is not sent when sync answering machine detection mode is chosen. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + machineDetectionResult: + $ref: '#/components/schemas/machineDetectionResult' + recordingCompleteCallback: + type: object + description: >- + The Record Complete event is sent after a verb has executed if + the call is still active. The BXML returned by this callback is executed + next. When the recording is available for download, a Recording + Available event will be sent. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + channels: + $ref: '#/components/schemas/channels' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + recordingAvailableCallback: + type: object + description: >- + The Recording Available event is sent after a recording has been + processed. It indicates that the recording is available for download. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + channels: + $ref: '#/components/schemas/channels' + tag: + $ref: '#/components/schemas/tag1' + status: + $ref: '#/components/schemas/status' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + redirectCallback: + type: object + description: >- + The Redirect event is fired when a verb is executed. Its + purpose is to get the next set of verbs from the calling application. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + transcriptionAvailableCallback: + type: object + description: >- + The Transcription Available event is sent when the recording + transcription is available to be downloaded. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + tag: + $ref: '#/components/schemas/tag1' + transcription: + $ref: '#/components/schemas/transcription' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + transferAnswerCallback: + type: object + description: >- + When processing a verb, this event is sent when a called + party (B-leg) answers. The event is sent to the endpoint specified in + the transferAnswerUrl attribute of the tag that answered. + BXML returned by this callback will be executed for the called party + only. After all BXML has been executed, the called party will be bridged + to the original call. Most BXML verbs are allowed in response to a + transferAnswer event, but some are not allowed. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + transferCompleteCallback: + type: object + description: >- + This event is sent to the transferCompleteUrl of the A-leg's + verb when the transferred call (B-leg) completes. In a simultaneous + ringing scenario, only one B-leg succeeds and this event corresponds to + that successful leg. If none of the calls were answered, the + transferComplete event corresponds to one of the legs. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + transferDisconnectCallback: + type: object + description: >- + This event is sent to the transferDisconnectUrl of each + tag when its respective call leg ends for any reason. The event is sent + in the normal case, when the transferred leg is answered and later hung + up, but is also sent if the new leg was never answered in the first + place, if it was rejected, and if the original call leg hung up before + the transferred leg. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + endTime: + $ref: '#/components/schemas/endTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + eventType: + type: string + description: >- + The event type, value can be one of the following: answer, + bridgeComplete, bridgeTargetComplete, conferenceCreated, + conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, + conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, + gather, initiate, machineDetectionComplete, recordingComplete, + recordingAvailable, redirect, transcriptionAvailable, transferAnswer, + transferComplete, transferDisconnect. + example: bridgeComplete + eventTime: + type: string + format: date-time + description: >- + The approximate UTC date and time when the event was generated by the + Bandwidth server, in ISO 8601 format. This may not be exactly the time + of event execution. + example: '2022-06-17T22:19:40.375Z' + accountId: + type: string + description: The user account associated with the call. + example: '9900000' + applicationId1: + type: string + description: The id of the application associated with the call. + example: 04e88489-df02-4e34-a0ee-27a91849555f + to: + type: string + description: >- + The phone number that received the call, in E.164 format (e.g. + +15555555555). + example: '+15555555555' + from: + type: string + description: >- + The provided identifier of the caller. Must be a phone number in E.164 + format (e.g. +15555555555). + example: '+15555555555' + conferenceId: + type: string + description: The unique, Bandwidth-generated ID of the conference that was recorded + example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + name: + type: string + description: The user-specified name of the conference that was recorded + example: my-conference-name + recordingId: + type: string + description: The unique ID of this recording + example: r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833 + duration: + type: string + description: The duration of the recording in ISO-8601 format + example: PT13.67S + channels: + type: integer + format: int32 + description: >- + Always `1` for conference recordings; multi-channel recordings are not + supported on conferences. + example: 1 + digit: + type: string + description: The digit collected in the call. + example: '2' + digits: + type: string + description: >- + (optional) The digits, letters, and/or symbols entered by the user. The + string is empty if a timeout occurred before any buttons were pressed. + example: '123' + terminatingDigit: + type: string + description: >- + (optional) The digit the user pressed to end the gather. Empty string + value if no terminating digit was pressed. + example: '#' + startTime: + type: string + format: date-time + description: Time the call was started, in ISO 8601 format. + example: '2022-06-17T22:19:40.375Z' + enqueuedTime: + type: string + format: date-time + description: >- + (optional) If call queueing is enabled and this is an outbound call, + time the call was queued, in ISO 8601 format. + example: '2022-06-17T22:20:00.000Z' + nullable: true + answerTime: + type: string + format: date-time + description: Time the call was answered, in ISO 8601 format. + example: '2022-06-17T22:20:00.000Z' + nullable: true + endTime: + type: string + format: date-time + description: The time that the recording ended in ISO-8601 format + example: '2022-06-17T22:20:00.000Z' + status: + type: string + description: >- + The current status of the process. For recording, current possible + values are 'processing', 'partial', 'complete', 'deleted', and 'error'. + For transcriptions, current possible values are 'none', 'processing', + 'available', 'error', 'timeout', 'file-size-too-big', and + 'file-size-too-small'. Additional states may be added in the future, so + your application must be tolerant of unknown values. + example: completed + transferCallerId: + type: string + description: >- + The phone number used as the from field of the B-leg call, in E.164 + format (e.g. +15555555555). + example: '+15555555555' + transferTo: + type: string + description: >- + The phone number used as the to field of the B-leg call, in E.164 format + (e.g. +15555555555). + example: '+15555555555' + mediaUrl: + nullable: true + type: string + format: uri + description: >- + The URL that can be used to download the recording. Only present if the + recording is finished and may be downloaded. + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media + callId: + type: string + description: The call id associated with the event. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + recordingName: + type: string + description: A name to identify this recording. + example: my-recording-name + callUrl: + type: string + format: uri + description: The URL of the call associated with the event. + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + parentCallId: + type: string + description: >- + (optional) If the event is related to the B leg of a , the + call id of the original call leg that executed the . + Otherwise, this field will not be present. + example: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d + tag1: + type: string + description: >- + (optional) The tag specified on call creation. If no tag was specified + or it was previously cleared, this field will not be present. + example: exampleTag + nullable: true + cause: + type: string + description: >- + Reason the call failed - hangup, busy, timeout, cancel, rejected, + callback-error, invalid-bxml, application-error, account-limit, + node-capacity-exceeded, error, or unknown. + example: busy + errorMessage: + type: string + description: >- + Text explaining the reason that caused the call to fail in case of + errors. + example: >- + Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged + with another call + nullable: true + errorId: + type: string + description: Bandwidth's internal id that references the error event. + example: 4642074b-7b58-478b-96e4-3a60955c6765 + nullable: true + machineDetectionResult: + type: object + description: >- + (optional) if machine detection was requested in sync mode, the result + will be specified here. Possible values are the same as the async + counterpart: Machine Detection Complete + properties: + value: + type: string + description: >- + Possible values are answering-machine, human, silence, timeout, or + error. + example: answering-machine + duration: + type: string + description: The amount of time it took to determine the result. + example: PT4.9891287S + nullable: true + diversion: + type: object + properties: + reason: + type: string + description: >- + The reason for the diversion. Common values: unknown, user-busy, + no-answer, unavailable, unconditional, time-of-day, do-not-disturb, + deflection, follow-me, out-of-service, away. + example: unavailable + privacy: + type: string + description: off or full + example: 'off' + screen: + type: string + description: >- + No if the number was provided by the user, yes if the number was + provided by the network + example: 'no' + counter: + type: string + description: The number of diversions that have occurred + example: '2' + limit: + type: string + description: The maximum number of diversions allowed for this session + example: '3' + unknown: + type: string + description: >- + The normal list of values is not exhaustive. Your application must + be tolerant of unlisted keys and unlisted values of those keys. + example: unknownValue + origTo: + type: string + description: >- + Always present. Indicates the last telephone number that the call + was diverted from. + example: '+15558884444' + transcription: + type: object + properties: + text: + type: string + description: The transcribed text + example: Nice talking to you, friend! + confidence: + type: number + format: double + description: >- + The confidence on the recognized content, ranging from `0.0` to + `1.0` with `1.0` being the highest confidence. + example: 0.9 + stirShaken: + type: object + properties: + verstat: + type: string + description: >- + (optional) The verification status indicating whether the + verification was successful or not. Possible values are + TN-Validation-Passed and TN-Validation-Failed. + example: Tn-Validation-Passed + attestationIndicator: + type: string + description: >- + (optional) The attestation level verified by Bandwidth. Possible + values are A (full), B (partial) or C (gateway). + example: A + originatingId: + type: string + description: (optional) A unique origination identifier. + example: 99759086-1335-11ed-9bcf-5f7d464e91af + uui: + type: string + description: >- + The value of the `User-To-User` header to send within the initial + `INVITE`. Must include the encoding parameter as specified in RFC 7433. + Only `base64`, `jwt` and `hex` encoding are currently allowed. This + value, including the encoding specifier, may not exceed 256 characters. + example: bXktdXVp + maxLength: 256 + codeRequest: + type: object + properties: + to: + type: string + description: The phone number to send the mfa code to. + pattern: ^\+[1-9]\d{1,14}$ + example: '+19195551234' + from: + type: string + description: The application phone number, the sender of the mfa code. + pattern: ^\+[1-9]\d{1,14}$ + maxLength: 32 + example: '+19195554321' + applicationId: + type: string + description: The application unique ID, obtained from Bandwidth. + maxLength: 50 + example: 66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1 + scope: + type: string + description: >- + An optional field to denote what scope or action the mfa code is + addressing. If not supplied, defaults to "2FA". + maxLength: 25 + example: 2FA + message: + type: string + description: >- + The message format of the mfa code. There are three values that the + system will replace "{CODE}", "{NAME}", "{SCOPE}". The "{SCOPE}" + and "{NAME} value template are optional, while "{CODE}" must be + supplied. As the name would suggest, code will be replace with the + actual mfa code. Name is replaced with the application name, + configured during provisioning of mfa. The scope value is the same + value sent during the call and partitioned by the server. + maxLength: 2048 + example: Your temporary {NAME} {SCOPE} code is {CODE} + digits: + type: integer + description: >- + The number of digits for your mfa code. The valid number ranges + from 2 to 8, inclusively. + minimum: 4 + maximum: 8 + example: 6 + required: + - to + - from + - applicationId + - message + - digits + voiceCodeResponse: + type: object + properties: + callId: + type: string + description: Programmable Voice API Call ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + messagingCodeResponse: + type: object + properties: + messageId: + type: string + description: Messaging API Message ID. + example: 1589228074636lm4k2je7j7jklbn2 + verifyCodeRequest: + type: object + properties: + to: + type: string + description: The phone number to send the mfa code to. + pattern: ^\+[1-9]\d{1,14}$ + example: '+19195551234' + scope: + type: string + description: >- + An optional field to denote what scope or action the mfa code is + addressing. If not supplied, defaults to "2FA". + example: 2FA + expirationTimeInMinutes: + type: number + description: >- + The time period, in minutes, to validate the mfa code. By setting + this to 3 minutes, it will mean any code generated within the last 3 + minutes are still valid. The valid range for expiration time is + between 0 and 15 minutes, exclusively and inclusively, respectively. + minimum: 1 + maximum: 15 + example: 3 + code: + type: string + description: The generated mfa code to check if valid. + minLength: 4 + maxLength: 8 + example: '123456' + required: + - to + - expirationTimeInMinutes + - code + verifyCodeResponse: + type: object + properties: + valid: + type: boolean + description: Whether or not the supplied code is valid. + example: true + mfaRequestError: + type: object + properties: + error: + type: string + description: A message describing the error with your request. + example: 400 Request is malformed or invalid + requestId: + type: string + description: The associated requestId from AWS. + example: 354cc8a3-6701-461e-8fa7-8671703dd898 + mfaUnauthorizedRequestError: + type: object + properties: + message: + type: string + description: Unauthorized + example: Unauthorized + mfaForbiddenRequestError: + type: object + properties: + message: + type: string + description: >- + The message containing the reason behind the request being + forbidden. + example: Missing Authentication Token + completedLookupStatusEnum: + type: string + enum: + - COMPLETE + - PARTIAL_COMPLETE + - FAILED + example: COMPLETE + inProgressLookupStatusEnum: + type: string + enum: + - IN_PROGRESS + - COMPLETE + - PARTIAL_COMPLETE + - FAILED + example: COMPLETE + deactivationEventEnum: + type: string + description: > + [DNI-Only](#section/DNI-Only). + + `DEACTIVATED` if the carrier reported a deactivation event for this + phone number. + enum: + - DEACTIVATED + latestMessageDeliveryStatusEnum: + type: string + description: >- + [DNI-Only](#section/DNI-Only). The current delivery status of the phone + number. + + - ACTIVE: A message was successfully sent to the number (delivery code + 0). + + - DEACTIVATED: A message was not delivered to a number (delivery code + 720) + + - UNKNOWN: Bandwidth cannot find an delivery status entry for the + number. + enum: + - ACTIVE + - DEACTIVATED + - UNKNOWN + lineTypeEnum: + type: string + enum: + - FIXED + - VOIP-FIXED + - MOBILE + - VOIP + example: MOBILE + requestId: + type: string + format: uuid + description: The phone number lookup request ID from Bandwidth. + example: 004223a0-8b17-41b1-bf81-20732adf5590 + linkSchema: + title: Link + type: object + properties: + href: + type: string + description: URI of the link. + example: /relative/uri + rel: + type: string + description: Specifies the relationship between this link and the resource. + example: aRelatedResource + method: + type: string + description: HTTP method to be used. + example: GET + lookupErrorSchema: + type: object + properties: + code: + type: string + description: Validation error code + example: NO-MATCH + description: + type: string + description: Description of validation error + example: Example error description + type: + type: string + description: Type of validation error + example: NumberInventory + meta: + type: object + properties: + phoneNumbers: + type: array + items: + type: string + description: Phone number experiencing the error. + example: + - '+13992077164' + - '+19196104424' + message: + type: string + description: Message describing the error + example: Invalid TNs + code: + type: integer + description: Error code associated with the message + example: 1001 + syncLookupRequest: + type: object + properties: + phoneNumbers: + description: Telephone numbers in E.164 format. + type: array + minimum: 1 + maximum: 100 + items: + type: string + pattern: ^\+[1-9]\d{1,14}$ + required: + - phoneNumbers + asyncLookupRequest: + type: object + properties: + phoneNumbers: + description: Telephone numbers in E.164 format. + type: array + minimum: 1 + maximum: 15000 + items: + type: string + pattern: ^\+[1-9]\d{1,14}$ + required: + - phoneNumbers + createSyncLookupResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/linkSchema' + example: [] + data: + type: object + description: The phone number lookup response data + properties: + requestId: + $ref: '#/components/schemas/requestId' + status: + $ref: '#/components/schemas/completedLookupStatusEnum' + results: + type: array + description: >- + The carrier information results for the specified telephone + numbers. + items: + $ref: '#/components/schemas/lookupResult' + errors: + type: array + items: + $ref: '#/components/schemas/lookupErrorSchema' + createAsyncBulkLookupResponse: + type: object + properties: + links: + type: array + description: Links for pagination (if applicable) + items: + $ref: '#/components/schemas/linkSchema' + data: + type: object + description: The phone number lookup response data + properties: + requestId: + $ref: '#/components/schemas/requestId' + status: + $ref: '#/components/schemas/inProgressLookupStatusEnum' + errors: + type: array + items: + $ref: '#/components/schemas/lookupErrorSchema' + getAsyncBulkLookupResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/linkSchema' + example: [] + data: + type: object + description: The phone number lookup response data + properties: + requestId: + $ref: '#/components/schemas/requestId' + status: + $ref: '#/components/schemas/inProgressLookupStatusEnum' + results: + type: array + description: >- + The carrier information results for the specified telephone + number. + items: + $ref: '#/components/schemas/lookupResult' + errors: + type: array + items: + $ref: '#/components/schemas/lookupErrorSchema' + lookupErrorResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/linkSchema' + example: [] + data: + type: object + description: The phone number lookup response data + errors: + type: array + items: + $ref: '#/components/schemas/lookupErrorSchema' + lookupResult: + type: object + description: Carrier information results for the specified telephone number. + properties: + phoneNumber: + type: string + description: The telephone number in E.164 format. + example: '+10072904498' + lineType: + $ref: '#/components/schemas/lineTypeEnum' + messagingProvider: + type: string + description: The messaging service provider of the telephone number. + example: Verizon Wireless + voiceProvider: + type: string + description: The voice service provider of the telephone number. + example: Verizon Wireless + countryCodeA3: + type: string + description: >- + The country code of the telephone number in ISO 3166-1 alpha-3 + format. + example: USA + deactivationReporter: + type: string + description: > + [DNI-Only](#section/DNI-Only). + + The carrier that reported a deactivation event for this phone + number. + deactivationDate: + type: string + format: date-time-local + description: >- + [DNI-Only](#section/DNI-Only). The datetime the carrier reported a + deactivation event. + example: 2025-06-20 18:35 + deactivationEvent: + $ref: '#/components/schemas/deactivationEventEnum' + latestMessageDeliveryStatus: + $ref: '#/components/schemas/latestMessageDeliveryStatusEnum' + initialMessageDeliveryStatusDate: + type: string + format: date + description: >- + [DNI-Only](#section/DNI-Only). The date the phone number entered the + status described in `latestMessageDeliveryStatus`. + + Think of this as the "start time" for that status. + + Value resets every time the `latestMessageDeliveryStatus` changes. + example: '2025-06-20' + latestMessageDeliveryStatusDate: + type: string + format: date + description: >- + [DNI-Only](#section/DNI-Only). The date bandwidth last received + delivery status information for this phone number. + + Use this field to understand how up-to-date the + `latestMessageDeliveryStatus` is. + + Value resets every time the `latestMessageDeliveryStatus` changes. + example: '2025-06-21' + accountId1: + type: string + description: User's account ID. + example: '1234567' + tfPhoneNumber: + type: string + description: Toll-free telephone number in E.164 format. + minLength: 12 + maxLength: 12 + nullable: false + pattern: ^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$ + example: '+18005555555' + tfvWebhookErrors: + type: array + description: Details of the errors that were encountered when processing the request. + items: + type: string + example: 'optInWorkflowImageURLs: Entries must be a valid array of objects.' + tfvCallbackStatusEnum: + type: string + enum: + - VERIFIED + - UNVERIFIED + example: VERIFIED + tfvUnverifiedStatus: + type: string + default: UNVERIFIED + example: UNVERIFIED + declineReasonDescription: + type: string + description: Explanation for why a verification request was declined. + nullable: false + example: >- + Invalid Information - Can't Validate URL - Website is not accessible / + not available + denialStatusCode: + description: Reason code for denial. + type: integer + example: 511 + resubmitAllowed: + description: >- + Whether a Toll-Free Verification request qualifies for resubmission via + PUT. + example: true + type: boolean + blocked: + description: >- + Whether a Toll-Free Verification is blocked. This attribute will only be + defined when the number is blocked. + example: true + type: boolean + blockedReason: + description: >- + The reason why the Toll-Free Verification is blocked. This attribute + will only be defined when the number is blocked. + example: Toll-free number was used to send spam messages + type: string + privacyPolicyUrl: + description: The Toll-Free Verification request privacy policy URL. + example: http://your-company.com/privacyPolicy + type: string + termsAndConditionsUrl: + description: The Toll-Free Verification request terms and conditions policy URL. + example: http://your-company.com/termsAndConditions + type: string + businessDba: + description: The company 'Doing Business As'. + example: Another Company Name Inc. + type: string + businessRegistrationNumber: + type: string + description: >- + US Federal Tax ID Number (EIN) or Canada Business Number (CBN). Optional + until early 2026. If a value is provided for this field, a value must be + provided for `businessRegistrationType` and `businessEntityType`. + Available starting October 1st, 2025. + nullable: true + maxLength: 500 + example: 12-3456789 + businessRegistrationTypeEnum: + type: string + description: >- + The type of business registration number. Optional until early 2026; + required if `businessRegistrationNumber` is provided. Available starting + October 1st, 2025. + enum: + - EIN + - CBN + nullable: true + businessEntityTypeEnum: + type: string + description: >- + The type of registered business. If no option is applicable, please + provide "SOLE_PROPRIETOR" as a value. Optional until early 2026; + required if `businessRegistrationNumber` is provided. Available starting + October 1st, 2025. + enum: + - SOLE_PROPRIETOR + - PRIVATE_PROFIT + - PUBLIC_PROFIT + - NON_PROFIT + - GOVERNMENT + nullable: true + helpMessageResponse: + type: string + description: A message that gets sent to users requesting help. + nullable: true + maxLength: 500 + example: Please contact support for assistance. + ageGatedContent: + type: boolean + description: Indicates whether the content is age-gated. + example: false + additionalDenialReason: + properties: + statusCode: + $ref: '#/components/schemas/denialStatusCode' + reason: + $ref: '#/components/schemas/declineReasonDescription' + resubmitAllowed: + $ref: '#/components/schemas/resubmitAllowed' + required: + - statusCode + - reason + - resubmitAllowed + type: object + internalTicketNumber: + type: string + format: uuid + description: >- + Unique identifier (UUID) generated by Bandwidth to assist in tracking + the verification status of a toll-free number - included in all webhook + payloads. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + internalTicketNumberForWebhook: + type: string + format: uuid + description: >- + Unique identifier (UUID) generated by Bandwidth to assist in tracking + the verification status of a toll-free number. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + businessContactPhoneNumber: + description: Contact telephone number + type: string + minLength: 1 + maxLength: 500 + nullable: false + example: '+19192654500' + verificationRequest: + type: object + required: + - businessAddress + - businessContact + - messageVolume + - phoneNumbers + - useCase + - useCaseSummary + - productionMessageContent + - optInWorkflow + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + type: integer + description: Estimated monthly volume of messages from the toll-free number. + minimum: 10 + maximum: 10000000 + example: 10000 + phoneNumbers: + type: array + minItems: 1 + maxItems: 10 + items: + $ref: '#/components/schemas/tfPhoneNumber' + useCase: + $ref: '#/components/schemas/useCase' + useCaseSummary: + $ref: '#/components/schemas/useCaseSummary' + productionMessageContent: + $ref: '#/components/schemas/productionMessageContent' + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + type: string + description: Any additional information. + minLength: 0 + maxLength: 500 + nullable: true + example: Any additional information + isvReseller: + $ref: '#/components/schemas/isvReseller' + privacyPolicyUrl: + $ref: '#/components/schemas/privacyPolicyUrl' + termsAndConditionsUrl: + $ref: '#/components/schemas/termsAndConditionsUrl' + businessDba: + $ref: '#/components/schemas/businessDba' + businessRegistrationNumber: + $ref: '#/components/schemas/businessRegistrationNumber' + businessRegistrationType: + $ref: '#/components/schemas/businessRegistrationTypeEnum' + businessEntityType: + $ref: '#/components/schemas/businessEntityTypeEnum' + helpMessageResponse: + $ref: '#/components/schemas/helpMessageResponse' + ageGatedContent: + $ref: '#/components/schemas/ageGatedContent' + verificationUpdateRequest: + type: object + required: + - businessAddress + - businessContact + - messageVolume + - useCase + - useCaseSummary + - productionMessageContent + - optInWorkflow + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + type: integer + description: Estimated monthly volume of messages from the toll-free number. + minimum: 10 + maximum: 10000000 + example: 10000 + useCase: + $ref: '#/components/schemas/useCase' + useCaseSummary: + $ref: '#/components/schemas/useCaseSummary' + productionMessageContent: + $ref: '#/components/schemas/productionMessageContent' + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + $ref: '#/components/schemas/additionalInformation' + isvReseller: + $ref: '#/components/schemas/isvReseller' + privacyPolicyUrl: + $ref: '#/components/schemas/privacyPolicyUrl' + termsAndConditionsUrl: + $ref: '#/components/schemas/termsAndConditionsUrl' + businessDba: + $ref: '#/components/schemas/businessDba' + businessRegistrationNumber: + $ref: '#/components/schemas/businessRegistrationNumber' + businessRegistrationType: + $ref: '#/components/schemas/businessRegistrationTypeEnum' + businessEntityType: + $ref: '#/components/schemas/businessEntityTypeEnum' + helpMessageResponse: + $ref: '#/components/schemas/helpMessageResponse' + ageGatedContent: + $ref: '#/components/schemas/ageGatedContent' + tfvBasicAuthentication: + type: object + properties: + username: + type: string + maxLength: 100 + example: username + password: + type: string + maxLength: 200 + example: password + required: + - username + - password + webhookSubscriptionRequestSchema: + type: object + properties: + basicAuthentication: + $ref: '#/components/schemas/tfvBasicAuthentication' + callbackUrl: + $ref: '#/components/schemas/webhookUrl' + sharedSecretKey: + $ref: '#/components/schemas/sharedSecretKey' + required: + - callbackUrl + failureWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + errorCode: + type: string + description: >- + An error code indicating what error was encountered. This code can + be interpreted as an HTTP status code in regards to the error that + was encountered. + example: '400' + errorMessage: + type: string + description: A description of the error that was encountered. + example: cannot process request. + errors: + $ref: '#/components/schemas/tfvWebhookErrors' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + verificationDenialWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + additionalDenialReasons: + description: >- + An optional list of denial reasons in addition to + declineReasonDescription when multiple reasons apply. + items: + $ref: '#/components/schemas/additionalDenialReason' + example: + - statusCode: 512 + reason: Reason A + resubmitAllowed: true + - statusCode: 513 + reason: Reason B + resubmitAllowed: true + type: array + declineReasonDescription: + $ref: '#/components/schemas/declineReasonDescription' + denialStatusCode: + $ref: '#/components/schemas/denialStatusCode' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + resubmitAllowed: + $ref: '#/components/schemas/resubmitAllowed' + status: + $ref: '#/components/schemas/tfvUnverifiedStatus' + blocked: + $ref: '#/components/schemas/blocked' + blockedReason: + $ref: '#/components/schemas/blockedReason' + verificationWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + status: + $ref: '#/components/schemas/tfvCallbackStatusEnum' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + blockedWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + status: + $ref: '#/components/schemas/tfvCallbackStatusEnum' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + blocked: + $ref: '#/components/schemas/blocked' + blockedReason: + $ref: '#/components/schemas/blockedReason' + tfvSubmissionWrapper: + type: object + properties: + submission: + $ref: '#/components/schemas/verificationUpdateRequest' + address: + type: object + nullable: false + required: + - name + - addr1 + - city + - state + - zip + - url + properties: + name: + type: string + description: The name of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: Bandwidth Inc. + addr1: + type: string + description: The address of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: 2230 Bandmate Way + addr2: + type: string + description: The address of the business using the toll-free number. + minLength: 0 + maxLength: 500 + nullable: true + example: 2230 Bandmate Way + city: + type: string + description: The city of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: Raleigh + state: + type: string + description: The state of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: NC + zip: + type: string + description: The zip of the business using the toll-free number. + nullable: false + example: '27606' + pattern: '[- A-Za-z0-9]{0,500}' + url: + type: string + format: url + description: The website of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: https://www.example.com/path/to/resource + additionalInformation: + type: string + description: Any additional information. + minLength: 0 + maxLength: 500 + nullable: true + example: Any additional information + optInWorkflow: + type: object + nullable: false + required: + - description + - imageUrls + properties: + description: + type: string + minLength: 1 + maxLength: 500 + nullable: false + example: Opt In Flow + imageUrls: + type: array + items: + type: string + minLength: 1 + maxLength: 500 + nullable: false + example: https://www.example.com/path/to/resource + pattern: >- + ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) + confirmationResponse: + type: string + minLength: 0 + maxLength: 500 + nullable: true + example: Thank you for opting in! + isvReseller: + type: string + description: ISV name. + minLength: 0 + maxLength: 500 + nullable: true + example: Test ISV + contact: + type: object + nullable: false + required: + - firstName + - lastName + - email + - phoneNumber + properties: + firstName: + type: string + description: The first name of the business contact using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: John + lastName: + type: string + description: The last name of the business contact using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: Doe + email: + $ref: '#/components/schemas/email' + phoneNumber: + $ref: '#/components/schemas/businessContactPhoneNumber' + email: + type: string + format: email + minLength: 0 + maxLength: 500 + nullable: false + pattern: >- + ^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$ + example: foo@bar.com + useCases: + type: array + items: + type: string + example: + - 2FA + - App Notifications + - Appointments + - Auctions + - Auto Repair Services + - Bank Transfers + - Billing + - Booking Confirmations + - Business Updates + - COVID-19 Alerts + useCase: + type: string + description: The category of the use case. + minLength: 0 + maxLength: 500 + example: 2FA + useCaseSummary: + type: string + description: A general idea of the use case and customer. + minLength: 0 + maxLength: 500 + nullable: false + example: Text summarizing the use case for the toll-free number + productionMessageContent: + type: string + description: Example of message content. + minLength: 0 + maxLength: 500 + nullable: false + example: Production message content + webhookSubscriptionsListBody: + description: >- + A list of all webhook subscriptions registered for this account ID for + this particular feature (unpaginated). + type: object + required: + - data + properties: + links: + $ref: '#/components/schemas/linksObject' + errors: + type: array + items: + $ref: '#/components/schemas/error' + data: + items: + $ref: '#/components/schemas/webhookSubscription' + type: array + linksObject: + type: object + properties: + first: + description: The first (or only) page of results matching the query. + type: string + next: + description: >- + If more results exist than specified by 'size', this link returns + the next page of 'size' results. + type: string + previous: + description: >- + If the results are more than one page, this link returns the + previous page of 'size' results. + type: string + last: + description: >- + If more results exist than specified by 'size', this link return the + last page of result. + type: string + error: + type: object + properties: + code: + type: integer + description: + type: string + telephoneNumbers: + type: array + items: + $ref: '#/components/schemas/telephoneNumber' + telephoneNumber: + type: object + properties: + telephoneNumber: + description: Simple Telephone Number. + type: string + webhookSubscriptionTypeEnum: + type: string + enum: + - TOLLFREE_VERIFICATION_STATUS + - MESSAGING_PORTOUT_APPROVAL_STATUS + example: TOLLFREE_VERIFICATION_STATUS + webhookSubscription: + description: >- + Information about a webhook that Bandwidth should send upon the + completion of event customer has subscribed to. + type: object + required: + - callbackUrl + properties: + id: + type: string + example: 7hICGStfAfeGxEq3N0lQwO + accountId: + type: string + example: '1234567' + callbackUrl: + $ref: '#/components/schemas/webhookUrl' + type: + $ref: '#/components/schemas/webhookSubscriptionTypeEnum' + basicAuthentication: + description: >- + Basic authentication credentials are not required, but if present, + both username and password must be provided. + type: object + required: + - username + - password + properties: + username: + type: string + maxLength: 100 + password: + type: string + maxLength: 200 + createdDate: + type: string + format: date-time + example: '2023-05-15T13:56:39.965Z' + modifiedDate: + type: string + format: date-time + example: '2023-05-15T13:56:39.965Z' + webhookUrl: + description: >- + Callback URL to receive status updates from Bandwidth. When a webhook + subscription is registered with Bandwidth under a given account ID, it + will be used to send status updates for all requests submitted under + that account ID. + type: string + format: url + minLength: 0 + maxLength: 2000 + nullable: true + example: https://www.example.com/path/to/resource + pattern: >- + ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) + tfvError: + description: A generic error object. + properties: + type: + type: string + example: Error Type + description: + type: string + example: Error Message + errors: + type: object + description: >- + Each key of this errors object refers to a field of the submitted + object (using dot notation for nested objects), with the field being + a key to an array of one or more errors for that field. + example: + field: error message + type: object + tfvStatus: + type: object + properties: + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + status: + $ref: '#/components/schemas/tfvStatusEnum' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumber' + declineReasonDescription: + $ref: '#/components/schemas/declineReasonDescription' + resubmitAllowed: + $ref: '#/components/schemas/resubmitAllowed' + createdDateTime: + type: string + description: Date and time the verification request was created. + format: date-time + example: '2021-06-08T06:45:13.0Z' + modifiedDateTime: + type: string + description: Date and time the verification request was last modified. + format: date-time + example: '2021-06-08T06:45:13.0Z' + submission: + $ref: '#/components/schemas/tfvSubmissionInfo' + blocked: + $ref: '#/components/schemas/blocked' + blockedReason: + $ref: '#/components/schemas/blockedReason' + tfvSubmissionInfo: + type: object + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + type: integer + description: Estimated monthly volume of messages from the toll-free number. + minimum: 10 + maximum: 10000000 + example: 10000 + useCase: + $ref: '#/components/schemas/useCase' + useCaseSummary: + $ref: '#/components/schemas/useCaseSummary' + productionMessageContent: + $ref: '#/components/schemas/productionMessageContent' + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + $ref: '#/components/schemas/additionalInformation' + isvReseller: + $ref: '#/components/schemas/isvReseller' + privacyPolicyUrl: + $ref: '#/components/schemas/privacyPolicyUrl' + termsAndConditionsUrl: + $ref: '#/components/schemas/termsAndConditionsUrl' + businessDba: + $ref: '#/components/schemas/businessDba' + businessRegistrationNumber: + $ref: '#/components/schemas/businessRegistrationNumber' + description: >- + US Federal Tax ID Number (EIN) or Canada Business Number (CBN). + Available starting October 1st, 2025. + businessRegistrationType: + $ref: '#/components/schemas/businessRegistrationTypeEnum' + description: >- + The type of business registration number. Available starting October + 1st, 2025. + businessEntityType: + $ref: '#/components/schemas/businessEntityTypeEnum' + description: >- + The type of registered business. If no option is applicable, please + provide "SOLE_PROPRIETOR" as a value. Available starting October + 1st, 2025. + tfvStatusEnum: + type: string + enum: + - VERIFIED + - UNVERIFIED + - PENDING + example: VERIFIED + sharedSecretKey: + description: >- + An ASCII string submitted by the user as a shared secret key for + generating an HMAC header for callbacks. + example: This is my $3cret + maxLength: 64 + minLength: 16 + nullable: true + pattern: ^[ -~]{16,64}$ + type: string + endpointId: + type: string + description: The unique ID of the endpoint. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + endpointStatusEnum: + type: string + enum: + - CONNECTED + - DISCONNECTED + deviceStatusEnum: + type: string + enum: + - CONNECTED + - DISCONNECTED + endpointTypeEnum: + type: string + enum: + - WEBRTC + endpointDirectionEnum: + type: string + enum: + - INBOUND + - OUTBOUND + - BIDIRECTIONAL + sipCredentials: + type: object + properties: + username: + type: string + description: The username for the SIP connection. + example: username + password: + type: string + description: The password for the SIP connection. + example: password + sipConnectionMetadata: + title: SIP Connection + type: object + properties: + ipAddress: + type: string + format: ipv4 + description: The IP address of the SIP connection. + example: 192.168.0.0 + port: + type: integer + description: The port of the SIP connection. + example: 5060 + credentials: + $ref: '#/components/schemas/sipCredentials' + uuiHeader: + type: string + description: The User-to-User Information header for the SIP connection. + example: my-uui-header + webRtcConnectionMetadata: + title: WebRTC Connection + type: object + endpointToken: + type: string + description: >- + The json web token specific to the endpoint. Used to authenticate the + client with the media gateway. + example: xxxxx.yyyyy.zzzzz + endpointTag: + type: string + description: A tag for the endpoint. + example: my-tag + maximum: 1024 + device: + type: object + properties: + deviceId: + type: string + description: The unique ID of the device. + example: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: + type: string + description: The name of the device. + maximum: 1024 + example: David's iPhone + status: + $ref: '#/components/schemas/deviceStatusEnum' + creationTimestamp: + type: string + format: date-time + description: The time the device was created. In ISO-8601 format. + example: '2021-01-01T00:00:00Z' + required: + - deviceId + - status + - creationTimestamp + endpoints: + type: object + properties: + endpointId: + $ref: '#/components/schemas/endpointId' + type: + $ref: '#/components/schemas/endpointTypeEnum' + status: + $ref: '#/components/schemas/endpointStatusEnum' + creationTimestamp: + type: string + format: date-time + description: The time the endpoint was created. In ISO-8601 format. + example: '2021-01-01T00:00:00Z' + expirationTimestamp: + type: string + format: date-time + description: >- + The time the endpoint token will expire. In ISO-8601 format. Tokens + last 24 hours. + example: '2021-01-02T00:00:00Z' + tag: + $ref: '#/components/schemas/endpointTag' + required: + - endpointId + - type + - status + - creationTimestamp + - expirationTimestamp + endpoint: + type: object + allOf: + - $ref: '#/components/schemas/endpoints' + - type: object + properties: + devices: + type: array + items: + $ref: '#/components/schemas/device' + createWebRtcConnectionRequest: + allOf: + - $ref: '#/components/schemas/createEndpointRequestBase' + - type: object + properties: + connectionMetadata: + $ref: '#/components/schemas/webRtcConnectionMetadata' + createEndpointRequestBase: + type: object + properties: + type: + $ref: '#/components/schemas/endpointTypeEnum' + direction: + $ref: '#/components/schemas/endpointDirectionEnum' + eventCallbackUrl: + type: string + format: uri + description: The URL to send event callbacks to. + example: https://myapp.com/callback + eventFallbackUrl: + type: string + format: uri + description: The URL to send event fallbacks to. + example: https://fallback.myapp.com/callback + tag: + $ref: '#/components/schemas/endpointTag' + required: + - type + - direction + createEndpointRequest: + oneOf: + - $ref: '#/components/schemas/createWebRtcConnectionRequest' + discriminator: + propertyName: type + mapping: + WEBRTC: '#/components/schemas/createWebRtcConnectionRequest' + createEndpointResponseObject: + allOf: + - $ref: '#/components/schemas/endpoint' + - type: object + properties: + token: + $ref: '#/components/schemas/endpointToken' + required: + - token + endpointEventTypeEnum: + type: string + enum: + - DEVICE_CONNECTED + - DEVICE_DISCONNECTED + endpointEvent: + description: An event that occurred on an endpoint. + allOf: + - $ref: '#/components/schemas/endpoints' + - type: object + properties: + eventTime: + type: string + format: date-time + description: The time the event occurred. In ISO-8601 format. + example: '2021-01-01T00:00:00Z' + eventType: + $ref: '#/components/schemas/endpointEventTypeEnum' + device: + $ref: '#/components/schemas/device' + required: + - eventType + - eventTime + page: + type: object + properties: + pageSize: + type: integer + description: The number of items per page. + minimum: 0 + example: 10 + totalElements: + type: integer + description: The total number of items. + minimum: 0 + example: 100 + totalPages: + type: integer + description: The total number of pages. + minimum: 0 + example: 10 + pageNumber: + type: integer + description: The current page number. + minimum: 0 + example: 0 + required: + - pageSize + listEndpointsResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + page: + $ref: '#/components/schemas/page' + data: + type: array + items: + $ref: '#/components/schemas/endpoints' + errors: + type: array + items: + $ref: '#/components/schemas/error' + required: + - links + - data + - errors + endpointResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + data: + $ref: '#/components/schemas/endpoint' + errors: + type: array + items: + $ref: '#/components/schemas/error' + required: + - links + - data + - errors + createEndpointResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + data: + $ref: '#/components/schemas/createEndpointResponseObject' + errors: + type: array + items: + $ref: '#/components/schemas/error' + required: + - links + - data + - errors + errorResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + data: + type: object + nullable: true + additionalProperties: false + errors: + type: array + items: + $ref: '#/components/schemas/error' + required: + - links + - data + - errors + responses: + createMessageResponse: + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/message' + createMultiChannelMessageResponse: + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/createMultiChannelMessageResponse' + listMessagesResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/messagesList' + getMediaResponse: + description: OK + content: + application/octet-stream: + schema: + type: string + description: Successful Operation + format: binary + listMediaResponse: + description: OK + headers: + Continuation-Token: + description: Continuation token used to retrieve subsequent media. + schema: + type: string + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/media' + messagingBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingNotAcceptableError: + description: Not Acceptable + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + createMessageBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/createMessageRequestError' + messagingUnauthorizedError: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingForbiddenError: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingNotFoundError: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingMethodNotAllowedError: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingInvalidMediaTypeError: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingTooManyRequestsError: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingInternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + multiChannelBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: request-validation + description: >- + The 'channelList[0].from' field must contain exactly one + telephone number + source: + field: channelList[0].from + multiChannelNotAcceptableError: + description: Not Acceptable + multiChannelUnauthorizedError: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: unauthorized + description: Authentication Failed + source: {} + multiChannelForbiddenError: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: forbidden + description: Access Denied + source: {} + multiChannelNotFoundError: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: forbidden + description: Resource not found. + source: {} + multiChannelMethodNotAllowedError: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: method-not-allowed + description: Method 'PUT' not supported for this resource. + source: {} + multiChannelInvalidMediaTypeError: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: unsupported-content-type + description: >- + Content-Type 'application/xml;charset=UTF-8' is not supported. + Please use 'application/json' + source: + header: Content-Type + multiChannelTooManyRequestsError: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: rate-limit-exceeded + description: >- + You have exceeded your rate limit for this endpoint. Please + retry later. + source: {} + multiChannelInternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: internal-server-error + description: Internal server error. No further information available + source: {} + createCallResponse: + description: Created + headers: + Location: + description: The URL for further interactions with this call + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/createCallResponse' + examples: + createCall Response: + $ref: '#/components/examples/createCallResponseExample' + getCallStateResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/callState' + updateCallResponse: + description: OK + listCallsResponse: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/callState' + getStatisticsResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/accountStatistics' + updateRecordingResponse: + description: OK + listCallRecordingsResponse: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/callRecordingMetadata' + getCallRecordingResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/callRecordingMetadata' + downloadRecordingMediaResponse: + description: OK + content: + audio/vnd.wave: + schema: + type: string + format: binary + audio/mpeg: + schema: + type: string + format: binary + getRecordingTranscriptionResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/recordingTranscriptions' + listTranscriptionsResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/callTranscriptionMetadataList' + getCallTranscriptionResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/callTranscriptionResponse' + deleteCallTranscriptionResponse: + description: No Content + listConferencesResponse: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/conference' + examples: + listConferences Response: + $ref: '#/components/examples/listConferencesResponseExample' + getConferenceResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/conference' + getConferenceMemberResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/conferenceMember' + listConferenceRecordingsResponse: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/conferenceRecordingMetadata' + getConferenceRecordingResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/conferenceRecordingMetadata' + voiceBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + badRequestErrorExample: + $ref: '#/components/examples/voiceBadRequestErrorExample' + voiceUnauthorizedError: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + unauthorizedErrorExample: + $ref: '#/components/examples/voiceUnauthorizedErrorExample' + voiceForbiddenError: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + forbiddenErrorExample: + $ref: '#/components/examples/voiceForbiddenErrorExample' + voiceNotFoundError: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + notFoundErrorExample: + $ref: '#/components/examples/voiceNotFoundErrorExample' + voiceNotAllowedError: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + notAllowedErrorExample: + $ref: '#/components/examples/voiceNotAllowedErrorExample' + voiceConflictError: + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + conflictErrorExample: + $ref: '#/components/examples/voiceConflictErrorExample' + voiceUnsupportedMediaTypeError: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceUnsupportedMediaTypeErrorExample' + voiceTooManyRequestsError: + description: Too Many Requests + headers: + Retry-After: + description: When you should try your request again. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceTooManyRequestsErrorExample' + voiceInternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + internalServerErrorExample: + $ref: '#/components/examples/voiceInternalServerErrorExample' + voiceCodeResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/voiceCodeResponse' + messagingCodeResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/messagingCodeResponse' + verifyCodeResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/verifyCodeResponse' + mfaBadRequestError: + description: Bad Request + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaRequestError' + mfaUnauthorizedError: + description: Unauthorized + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaUnauthorizedRequestError' + mfaForbiddenError: + description: Forbidden + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaForbiddenRequestError' + mfaTooManyRequestsError: + description: Too Many Requests + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaRequestError' + mfaInternalServerError: + description: Internal Server Error + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaRequestError' + createSyncLookupResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/createSyncLookupResponse' + examples: + lookupCompleteWithDniExample: + $ref: '#/components/examples/lookupCompleteWithDniExample' + lookupCompleteExample: + $ref: '#/components/examples/lookupCompleteExample' + lookupPartialExample: + $ref: '#/components/examples/lookupPartialExample' + lookupFailedExample: + $ref: '#/components/examples/lookupFailedExample' + createAsyncBulkLookupResponse: + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/createAsyncBulkLookupResponse' + examples: + lookupInProgressExample: + $ref: '#/components/examples/lookupInProgressExample' + getAsyncBulkLookupResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/getAsyncBulkLookupResponse' + examples: + lookupCompleteWithDniExample: + $ref: '#/components/examples/lookupCompleteWithDniExample' + lookupCompleteExample: + $ref: '#/components/examples/lookupCompleteExample' + lookupInProgressExample: + $ref: '#/components/examples/lookupInProgressExample' + lookupPartialExample: + $ref: '#/components/examples/lookupPartialExample' + lookupFailedExample: + $ref: '#/components/examples/lookupFailedExample' + tnLookupDefaultResponse: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/lookupErrorResponse' + examples: + badRequest: + $ref: '#/components/examples/badRequestExample' + unauthorized: + $ref: '#/components/examples/unauthorizedExample' + forbidden: + $ref: '#/components/examples/forbiddenExample' + mediaType: + $ref: '#/components/examples/unsupportedMediaTypeExample' + notFound: + $ref: '#/components/examples/notFoundExample' + tooManyRequests: + $ref: '#/components/examples/tooManyRequestsExample' + internalServer: + $ref: '#/components/examples/internalServerErrorExample' + getTollFreeVerificationStatusResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/tfvStatus' + listWebhookSubscriptionsResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscriptionsListBody' + createWebhookSubscriptionResponse: + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscription' + updateWebhookSubscriptionResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscription' + listTollFreeUseCasesResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/useCases' + tfvBadRequestResponse: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Cannot process request. + type: bad request + noContentResponse: + description: No Content + tfvPostBadRequestResponse: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: cannot process request. + errors: + businessName: Business name is required. + businessContactEmail: Business contact email is not a valid email address. + optInWorkflowImageURLs: Entries must be a valid array of objects. + tfvUnauthorizedResponse: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + tfvForbiddenResponse: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Client is not authorized for the action. + type: forbidden + tfvNotFoundResponse: + description: Cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Cannot find the requested resource. + type: Not Found + tfvNotAllowedResponse: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Method is not allowed. + type: Method Not Allowed + tfvTooManyRequestsResponse: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Throttling error. Too many requests. + type: Too Many Requests + tfvServerErrorResponse: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Internal Server Error. + type: Internal Server Error + tfvServiceUnavailableResponse: + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Service Unavailable Error. + type: Service Unavailable + listEndpointsResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/listEndpointsResponse' + examples: + listEndpointsResponseExample: + $ref: '#/components/examples/listEndpointsResponseExample' + createEndpointResponse: + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/createEndpointResponse' + examples: + createEndpointResponseExample: + $ref: '#/components/examples/createEndpointResponseExample' + getEndpointResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/endpointResponse' + examples: + getEndpointResponseExample: + $ref: '#/components/examples/getEndpointResponseExample' + badRequestErrorResponse: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + badRequestErrorExample: + $ref: '#/components/examples/badRequestErrorExample' + unauthorizedErrorResponse: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + unauthorizedErrorExample: + $ref: '#/components/examples/unauthorizedErrorExample' + forbiddenErrorResponse: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + forbiddenErrorExample: + $ref: '#/components/examples/forbiddenErrorExample' + notFoundErrorResponse: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + notFoundErrorExample: + $ref: '#/components/examples/notFoundErrorExample' + methodNotAllowedErrorResponse: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + methodNotAllowedErrorExample: + $ref: '#/components/examples/methodNotAllowedErrorExample' + unsupportedMediaTypeErrorResponse: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + unsuppotedMediaTypeErrorExample: + $ref: '#/components/examples/unsupportedMediaTypeErrorExample' + tooManyRequestsErrorResponse: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/tooManyRequestsErrorExample' + serviceUnavailableErrorResponse: + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + serviceUnavailableErrorExample: + $ref: '#/components/examples/serviceUnavailableErrorExample' + parameters: + accountId: + in: path + name: accountId + required: true + schema: + type: string + description: Your Bandwidth Account ID. + example: '9900000' + mediaId: + in: path + name: mediaId + required: true + description: Media ID to retrieve. + example: 14762070468292kw2fuqty55yp2b2/0/bw.png + schema: + type: string + contentType: + in: header + name: Content-Type + style: simple + explode: false + description: The media type of the entity-body. + example: audio/wav + schema: + type: string + cacheControl: + in: header + name: Cache-Control + style: simple + explode: false + description: >- + General-header field is used to specify directives that MUST be obeyed + by all caching mechanisms along the request/response chain. + example: no-cache + schema: + type: string + continuationToken: + in: header + name: Continuation-Token + description: Continuation token used to retrieve subsequent media. + example: >- + 1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39 + schema: + type: string + messageId: + in: query + name: messageId + required: false + description: >- + The ID of the message to search for. Special characters need to be + encoded using URL encoding. Message IDs could come in different formats, + e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and + 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that + you must include at least one query parameter. + example: 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 + schema: + type: string + sourceTn: + in: query + name: sourceTn + required: false + description: >- + The phone number that sent the message. Accepted values are: a single + full phone number a comma separated list of full phone numbers (maximum + of 10) or a single partial phone number (minimum of 5 characters e.g. + '%2B1919'). + example: '%2B15554443333' + schema: + type: string + destinationTn: + in: query + name: destinationTn + required: false + description: >- + The phone number that received the message. Accepted values are: a + single full phone number a comma separated list of full phone numbers + (maximum of 10) or a single partial phone number (minimum of 5 + characters e.g. '%2B1919'). + example: '%2B15554443333' + schema: + type: string + messageStatus: + in: query + name: messageStatus + required: false + description: >- + The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED + DELIVERED ACCEPTED UNDELIVERED. + schema: + $ref: '#/components/schemas/messageStatusEnum' + messageDirection: + in: query + name: messageDirection + required: false + description: The direction of the message. One of INBOUND OUTBOUND. + schema: + $ref: '#/components/schemas/listMessageDirectionEnum' + carrierName: + in: query + name: carrierName + required: false + description: >- + The name of the carrier used for this message. Possible values include + but are not limited to Verizon and TMobile. Special characters need to + be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + example: Verizon + schema: + type: string + messageType: + in: query + name: messageType + required: false + description: The type of message. Either sms or mms. + schema: + $ref: '#/components/schemas/messageTypeEnum' + errorCode: + in: query + name: errorCode + required: false + description: The error code of the message. + example: 9902 + schema: + type: integer + fromDateTime: + in: query + name: fromDateTime + required: false + description: >- + The start of the date range to search in ISO 8601 format. Uses the + message receive time. The date range to search in is currently 14 days. + example: 2022-09-14T18:20:16.000Z + schema: + type: string + toDateTime: + in: query + name: toDateTime + required: false + description: >- + The end of the date range to search in ISO 8601 format. Uses the message + receive time. The date range to search in is currently 14 days. + example: 2022-09-14T18:20:16.000Z + schema: + type: string + campaignId: + in: query + name: campaignId + required: false + description: The campaign ID of the message. + example: CJEUMDK + schema: + type: string + fromBwLatency: + in: query + name: fromBwLatency + required: false + description: >- + The minimum Bandwidth latency of the message in seconds. Only available + for accounts with the Advanced Quality Metrics feature enabled. + example: 5 + schema: + type: integer + bwQueued: + in: query + name: bwQueued + required: false + description: >- + A boolean value indicating whether the message is queued in the + Bandwidth network. + example: true + schema: + type: boolean + product: + in: query + name: product + required: false + description: Messaging product associated with the message. + example: P2P + schema: + $ref: '#/components/schemas/productTypeEnum' + location: + in: query + name: location + required: false + description: Location Id associated with the message. + example: 123ABC + schema: + type: string + carrierQueued: + in: query + name: carrierQueued + required: false + description: >- + A boolean value indicating whether the message is queued in the carrier + network. Only available for OUTBOUND messages from accounts with the + Advanced Quality Metrics feature enabled. + example: true + schema: + type: boolean + fromCarrierLatency: + in: query + name: fromCarrierLatency + required: false + description: >- + The minimum carrier latency of the message in seconds. Only available + for OUTBOUND messages from accounts with the Advanced Quality Metrics + feature enabled. + example: 50 + schema: + type: integer + callingNumberCountryA3: + in: query + name: callingNumberCountryA3 + required: false + description: Calling number country in A3 format. + example: USA + schema: + type: string + calledNumberCountryA3: + in: query + name: calledNumberCountryA3 + required: false + description: Called number country in A3 format. + example: USA + schema: + type: string + fromSegmentCount: + in: query + name: fromSegmentCount + required: false + description: Segment count (start range). + example: 1 + schema: + type: integer + toSegmentCount: + in: query + name: toSegmentCount + required: false + description: Segment count (end range). + example: 3 + schema: + type: integer + fromMessageSize: + in: query + name: fromMessageSize + required: false + description: Message size (start range). + example: 100 + schema: + type: integer + toMessageSize: + in: query + name: toMessageSize + required: false + description: Message size (end range). + example: 120 + schema: + type: integer + sort: + in: query + name: sort + required: false + description: >- + The field and direction to sort by combined with a colon. Direction is + either asc or desc. + example: sourceTn:desc + schema: + type: string + pageToken: + in: query + name: pageToken + required: false + description: A base64 encoded value used for pagination of results. + example: gdEewhcJLQRB5 + schema: + type: string + limit: + in: query + name: limit + required: false + description: >- + The maximum records requested in search result. Default 100. The sum of + limit and after cannot be more than 10000. + schema: + type: integer + example: 50 + limitTotalCount: + in: query + name: limitTotalCount + required: false + description: >- + When set to true, the response's totalCount field will have a maximum + value of 10,000. When set to false, or excluded, this will give an + accurate totalCount of all messages that match the provided filters. If + you are experiencing latency, try using this parameter to limit your + results. + example: true + schema: + type: boolean + callId: + name: callId + in: path + required: true + schema: + type: string + description: Programmable Voice API Call ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + recordingId: + name: recordingId + in: path + required: true + schema: + type: string + description: Programmable Voice API Recording ID. + example: r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + conferenceId: + name: conferenceId + in: path + required: true + schema: + type: string + description: Programmable Voice API Conference ID. + example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + memberId: + name: memberId + in: path + required: true + schema: + type: string + description: Programmable Voice API Conference Member ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + transcriptionId: + name: transcriptionId + in: path + required: true + schema: + type: string + description: Programmable Voice API Transcription ID. + example: t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + to: + name: to + in: query + required: false + schema: + type: string + description: Filter results by the `to` field. + example: '%2b19195551234' + from: + name: from + in: query + required: false + schema: + type: string + description: Filter results by the `from` field. + example: '%2b19195554321' + name: + name: name + in: query + required: false + schema: + type: string + description: Filter results by the `name` field. + example: my-custom-name + minCreatedTime: + name: minCreatedTime + in: query + required: false + schema: + type: string + description: >- + Filter results to conferences which have a `createdTime` after or at + `minCreatedTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + maxCreatedTime: + name: maxCreatedTime + in: query + required: false + schema: + type: string + description: >- + Filter results to conferences which have a `createdTime` before or at + `maxCreatedTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + minStartTime: + name: minStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to recordings which have a `startTime` after or including + `minStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + maxStartTime: + name: maxStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to recordings which have a `startTime` before + `maxStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + pageSize: + name: pageSize + in: query + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 1000 + default: 1000 + description: Specifies the max number of conferences that will be returned. + example: 500 + minStartTimeCalls: + name: minStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to calls which have a `startTime` after or including + `minStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + maxStartTimeCalls: + name: maxStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to calls which have a `startTime` before or including + `maxStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + pageSizeCalls: + name: pageSize + in: query + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 10000 + default: 1000 + description: Specifies the max number of calls that will be returned. + example: 500 + pageToken1: + name: pageToken + in: query + required: false + schema: + type: string + description: >- + Not intended for explicit use. To use pagination, follow the links in + the `Link` header of the response, as indicated in the endpoint + description. + example: eyJwYWdlVG9rZW4iOiJ0b2tlbiJ9 + disconnectCause: + name: disconnectCause + in: query + required: false + schema: + type: string + description: Filter results to calls with specified call Disconnect Cause. + example: hangup + accountId1: + in: path + name: accountId + required: true + schema: + type: string + description: Your Bandwidth Account ID. + example: '9900000' + requestId: + in: path + name: requestId + required: true + schema: + type: string + format: uuid + description: The phone number lookup request ID from Bandwidth. + example: 004223a0-8b17-41b1-bf81-20732adf5590 + tfPhoneNumberPathParam: + in: path + name: phoneNumber + required: true + schema: + $ref: '#/components/schemas/tfPhoneNumber' + description: Valid Toll-Free telephone number in E.164 format. + example: '+18885555555' + webhookSubscriptionIdPathParam: + in: path + name: id + required: true + schema: + type: string + description: Webhook subscription ID + example: 7bt57JcsVYJrN9K1OcV1Nu + accountId2: + name: accountId + in: path + required: true + schema: + type: string + example: '5500123' + description: Your Bandwidth Account ID. + endpointId: + name: endpointId + in: path + required: true + schema: + type: string + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + description: BRTC Endpoint ID. + endpointType: + name: type + in: query + schema: + $ref: '#/components/schemas/endpointTypeEnum' + description: The type of endpoint. + endpointStatus: + name: status + in: query + schema: + $ref: '#/components/schemas/endpointStatusEnum' + description: The status of the endpoint. + afterCursor: + name: afterCursor + in: query + schema: + type: string + example: TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ== + description: >- + The cursor to use for pagination. This is the value of the `next` link + in the previous response. + limit1: + name: limit + in: query + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 100 + example: 2 + description: The maximum number of endpoints to return in the response. + examples: + smsMessageReceivedCallbackExample: + summary: An example of a sms message-received callback body. + value: + time: '2025-01-06T15:43:35.502180Z' + type: message-received + to: '+12345678902' + description: Incoming message received + message: + id: 14762070468292kw2fuqty55yp2b2 + owner: '+12345678902' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + time: '2025-01-06T15:43:34.000000Z' + segmentCount: 1 + direction: in + to: + - '+12345678902' + from: '+12345678901' + text: Hey, check out this SMS! + mmsMessageReceivedCallbackExample: + summary: An example of a mms message-received callback body. + value: + time: '2024-09-14T18:20:45.160744Z' + type: message-received + to: '+12345678902' + description: Incoming message received + message: + id: 14762070468292kw2fuqty55yp2b2 + owner: '+12345678902' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + time: '2024-09-14T18:20:45.160744Z' + segmentCount: 1 + direction: in + to: + - '+12345678902' + - '+12345678903' + from: '+12345678901' + text: Hey, check out the MMS! + media: + - >- + https://messaging.bandwidth.com/api/v2/users/9900902/media/14762070468292kw2fuqty55yp2b2/0/bw.png + messageSendingCallbackExample: + summary: An example of a message-sending callback body. + value: + time: '2024-06-25T18:42:36.979456Z' + type: message-sending + to: '+15554443333' + description: Message is sending to carrier. + message: + id: 1593110555875xo7watq5px6rbe5d + owner: '+15552221111' + applicationId: cfd4fb83-7531-4acc-b471-42d0bb76a65c + time: '2024-06-25T18:42:35.876906Z' + segmentCount: 1 + direction: out + to: + - '+15554443333' + from: '+15552221111' + text: '' + media: + - https://dev.bandwidth.com/images/bandwidth-logo.png + tag: your tag here + smsMessageDeliveredCallbackExample: + summary: An example of a sms message-delivered callback body. + value: + type: message-delivered + time: '2024-09-14T18:20:11.160744Z' + description: Message delivered to carrier. + to: '+12345678902' + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-09-14T18:20:11.160744Z' + to: + - '+12345678902' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: '+12345678902' + direction: out + segmentCount: 1 + mmsMessageDeliveredCallbackExample: + summary: An example of a mms message-delivered callback body. + value: + type: message-delivered + time: '2024-09-14T18:20:24.160544Z' + description: Message delivered to carrier. + to: '+12345678902' + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-09-14T18:20:24.160544Z' + to: + - '+12345678902' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: '+12345678902' + direction: out + segmentCount: 1 + media: + - https://dev.bandwidth.com/images/bandwidth-logo.png + groupMmsMessageDeliveredCallbackExample: + summary: An example of a group mms message-delivered callback body. + value: + type: message-delivered + time: '2024-09-14T18:20:17.160544Z' + description: Message delivered to carrier. + to: '+12345678902' + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-09-14T18:20:17.160544Z' + to: + - '+12345678902' + - '+12345678903' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: '+12345678902' + direction: out + segmentCount: 1 + messageFailedCallbackExample: + summary: An example of a message-failed callback body. + value: + type: message-failed + time: '2024-12-18T16:51:27.704450Z' + description: forbidden to country + to: '+52345678903' + errorCode: 4432 + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-12-18T16:51:27.704450Z' + to: + - '+12345678902' + - '+52345678903' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + media: + - https://dev.bandwidth.com/images/bandwidth-logo.png + owner: '+12345678901' + direction: out + segmentCount: 1 + createCallResponseExample: + summary: Example of a createCall Response + value: + applicationId: 04e88489-df02-4e34-a0ee-27a91849555f + accountId: '9900000' + callId: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + to: '+19195551234' + from: '+19195554312' + enqueuedTime: '2022-06-16T13:15:07.160Z' + callUrl: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + callTimeout: 30 + callbackTimeout: 15 + tag: My custom tag value + answerMethod: POST + answerUrl: https://myServer.example/bandwidth/webhooks/answer + answerFallbackMethod: POST + answerFallbackUrl: https://myServer.example/bandwidth/webhooks/answerFallback + disconnectMethod: POST + disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect + username: mySecretUsername + password: '*****' + fallbackUsername: mySecretUsername + fallbackPassword: '*****' + priority: 5 + listConferencesResponseExample: + summary: Example of a listConferences Response + value: + - id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + name: my-conference-name + createdTime: '2022-06-17T22:19:40.375Z' + completedTime: '2022-06-17T22:20:00.000Z' + conferenceEventUrl: https://myServer.example/bandwidth/webhooks/conferenceEvent + conferenceEventMethod: POST + tag: my custom tag + voiceBadRequestErrorExample: + summary: Example of a Bad Request (400) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceUnauthorizedErrorExample: + summary: Example of an Unauthorized (401) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceForbiddenErrorExample: + summary: Example of a Forbidden (403) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceNotFoundErrorExample: + summary: Example of a Not Found (404) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceNotAllowedErrorExample: + summary: Example of a Not Allowed (405) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceConflictErrorExample: + summary: Example of a Conflict (409) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceUnsupportedMediaTypeErrorExample: + summary: Example of an Unsupported Media Type (415) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceTooManyRequestsErrorExample: + summary: Example of a Too Many Requests (429) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceInternalServerErrorExample: + summary: Example of an Internal Server (500) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + singleNumberRequestExample: + summary: Number Lookup Request + value: + phoneNumbers: + - '+19196104423' + multipleNumberRequestExample: + summary: Number Lookup Request for Multiple Numbers + value: + phoneNumbers: + - '+19196104423' + - '+19196104424' + lookupInProgressExample: + summary: Numbers Lookup In Progress + value: + links: + - href: href + rel: rel + method: GET + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: IN_PROGRESS + results: [] + errors: [] + lookupFailedExample: + summary: Numbers Lookup Failed + value: + links: + - href: href + rel: rel + method: GET + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: FAILED + results: [] + errors: + - code: NO-MATCH + description: The following TNs could not be found in the Number Industry data + meta: + phoneNumbers: + - '+13992077164' + message: Invalid TNs + code: 1001 + type: NumberInventory + lookupPartialExample: + summary: Numbers Lookup Partial Complete + value: + links: + - href: href + rel: rel + method: GET + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: PARTIAL_COMPLETE + results: + - phoneNumber: '+19196104423' + lineType: MOBILE + messagingProvider: Verizon Wireless + voiceProvider: Verizon Wireless + countryCodeA3: USA + - phoneNumber: '+19196104424' + lineType: MOBILE + messagingProvider: T-Mobile USA + voiceProvider: T-Mobile USA + countryCodeA3: USA + errors: + - code: NO-MATCH + description: The following TNs could not be found in the Number Industry data + meta: + phoneNumbers: + - '+13992077164' + message: Invalid TNs + code: 1001 + type: NumberInventory + lookupCompleteExample: + summary: Numbers Lookup Complete (without DNI) + value: + links: + - href: href + rel: rel + method: GET + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + results: + - phoneNumber: '+10072904497' + lineType: MOBILE + messagingProvider: Verizon Wireless + voiceProvider: Verizon Wireless + countryCodeA3: USA + - phoneNumber: '+10072904498' + lineType: MOBILE + messagingProvider: T-Mobile USA + voiceProvider: T-Mobile USA + countryCodeA3: USA + errors: [] + lookupCompleteWithDniExample: + summary: Numbers Lookup Complete (with DNI) + value: + links: + - href: href + rel: rel + method: GET + data: + requestId: 20732adf-bf81-8b17-41b1-004223a05590 + status: COMPLETE + results: + - phoneNumber: '+10072904497' + countryCodeA3: USA + lineType: MOBILE + messagingProvider: T-MOBILE USA INC + voiceProvider: T-MOBILE USA INC + latestMessageDeliveryStatus: ACTIVE + initialMessageDeliveryStatusDate: '2025-05-14' + latestMessageDeliveryStatusDate: '2025-05-18' + - phoneNumber: '+10072904498' + countryCodeA3: USA + lineType: FIXED + voiceProvider: VERIZON + latestMessageDeliveryStatus: DEACTIVATED + initialMessageDeliveryStatusDate: '2025-09-05' + latestMessageDeliveryStatusDate: '2025-09-05' + - phoneNumber: '+10072904499' + lineType: MOBILE + countryCodeA3: USA + messagingProvider: VERIZON + voiceProvider: VERIZON + deactivationReporter: Verizon Wireless + deactivationDate: '2025-09-29 01:23:00' + deactivationEvent: DEACTIVATED + latestMessageDeliveryStatus: UNKNOWN + errors: [] + badRequestExample: + summary: Example Bad Request Error + value: + links: [] + data: {} + errors: + - type: bad-request + description: >- + Bad Request. Ensure that you have set the requestId as a URL path + parameter. + unauthorizedExample: + summary: Unauthorized Error + value: + links: [] + data: {} + errors: + - type: Unauthorized + description: You are not authorized to access this resource. + code: '1' + page: null + forbiddenExample: + summary: Forbidden Error + value: + links: [] + data: {} + errors: + - type: Forbidden + description: You do not have permission to access this resource. + code: '2' + page: null + unsupportedMediaTypeExample: + summary: Unsupported Media Type Error + value: + links: [] + data: {} + errors: + - type: invalid-content-type + description: >- + Invalid content-type. Ensure that your content-type header is set + to application/json. + notFoundExample: + summary: Not Found Error + value: + links: [] + data: {} + errors: + - type: not-found + description: >- + RequestId not found. Ensure that the requestId used in the URL + path is valid and maps to a previous request that was submitted. + tooManyRequestsExample: + summary: Too Many Requests Error + value: + links: [] + data: {} + errors: + - type: rate-limiting + description: >- + Rate limit exceeded. Wait for the time specified in the + Retry-After header before sending another request. + internalServerErrorExample: + summary: Internal Server Error + value: + links: [] + data: {} + errors: + - code: '500' + type: unexpected-error + description: >- + Unexpected error. Please contact Bandwidth Support if your + requests are receiving this status code for an extended period of + time. + listEndpointsResponseExample: + summary: List Endpoints Paginated Response + value: + links: + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2 + rel: self + method: GET + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2&afterCursor=TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ== + rel: next + method: GET + page: + pageSize: 2 + totalElements: 10 + totalPages: 5 + pageNumber: 0 + data: + - endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + tag: my-tag + - endpointId: e-2cb0-4a07-b215-b22865662d85-15ac29a2-1331029c + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + tag: my-tag + errors: [] + createEndpointResponseExample: + summary: Create Endpoint Response + value: + links: + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + rel: endpoint + method: GET + data: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + token: xxxxx.yyyyy.zzzzz + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + devices: [] + tag: my-tag + errors: [] + getEndpointResponseExample: + summary: Get Endpoint Response + value: + links: + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + rel: self + method: GET + data: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + devices: [] + tag: my-tag + errors: [] + createSipEndpointRequestExample: + summary: SIP Endpoint Example + value: + type: SIP + connectionMetadata: + ipAddress: 0.0.0.0 + port: 3000 + credentials: + username: username + password: '********' + uuiHeader: 123456;encoding=jwt + direction: INBOUND + eventCallbackUrl: https://myEventCallbackUrl.com/callbacks/bandwidth + eventFallbackUrl: https://fallback.myEventCallbackUrl.com/callbacks/bandwidth + tag: '{"myTag": "myTagValue"}' + createWeRtcEndpointExample: + summary: WebRTC Endpoint Example + value: + type: WEBRTC + direction: BIDIRECTIONAL + eventCallbackUrl: https://myEventCallbackUrl.com/callbacks/bandwidth + eventFallbackUrl: https://fallback.myEventCallbackUrl.com/callbacks/bandwidth + tag: '{"myTag": "myTagValue"}' + updateEndpointBxmlRequestExample: + summary: Update Endpoint BXML Request Example + value: + endpointDisconnectedEventExample: + summary: Endpoint Disconnected Event + value: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: DISCONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + eventTime: '2021-01-01T00:00:00Z' + eventType: DEVICE_DISCONNECTED + tag: my-tag + badRequestErrorExample: + summary: Bad Request Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: invalid_parameter + description: accountId must not contain any characters other than numbers. + code: '400' + source: + parameter: accountId + unauthorizedErrorExample: + summary: Unauthorized Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: unauthorized + description: >- + The provided credentials are not authorized to access this + resource. + code: '401' + source: + header: Authorization + forbiddenErrorExample: + summary: Forbidden Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: forbidden + description: >- + The provided credentials are not authorized to access this + resource. + code: '403' + source: + header: Authorization + notFoundErrorExample: + summary: Not Found Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: resource_not_found + description: The requested resource was not found. + code: '404' + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + methodNotAllowedErrorExample: + summary: Method Not Allowed Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: method_not_allowed + description: The requested method is not allowed on this resource. + code: '405' + source: + parameter: accountId + unsupportedMediaTypeErrorExample: + summary: Unsupported Media Type Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: unsupported_media_type + description: The provided media type is not supported. + code: '415' + source: + header: Content-Type + tooManyRequestsErrorExample: + summary: Too Many Requests Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: too_many_requests + description: The client has sent too many requests in a given amount of time. + code: '429' + serviceUnavailableErrorExample: + summary: Service Unavailable Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: service_unavailable + description: The service is currently unavailable. + code: '500' + requestBodies: + createMessageRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/messageRequest' + required: true + createMultiChannelMessageRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelMessageRequest' + required: true + uploadMediaRequest: + content: + application/json: + schema: + type: string + format: binary + application/ogg: + schema: + type: string + format: binary + application/pdf: + schema: + type: string + format: binary + application/rtf: + schema: + type: string + format: binary + application/zip: + schema: + type: string + format: binary + application/x-tar: + schema: + type: string + format: binary + application/xml: + schema: + type: string + format: binary + application/gzip: + schema: + type: string + format: binary + application/x-bzip2: + schema: + type: string + format: binary + application/x-gzip: + schema: + type: string + format: binary + application/smil: + schema: + type: string + format: binary + application/javascript: + schema: + type: string + format: binary + audio/mp4: + schema: + type: string + format: binary + audio/mpeg: + schema: + type: string + format: binary + audio/ogg: + schema: + type: string + format: binary + audio/flac: + schema: + type: string + format: binary + audio/webm: + schema: + type: string + format: binary + audio/wav: + schema: + type: string + format: binary + audio/amr: + schema: + type: string + format: binary + audio/3gpp: + schema: + type: string + format: binary + image/bmp: + schema: + type: string + format: binary + image/gif: + schema: + type: string + format: binary + image/heic: + schema: + type: string + format: binary + image/heif: + schema: + type: string + format: binary + image/jpeg: + schema: + type: string + format: binary + image/pjpeg: + schema: + type: string + format: binary + image/png: + schema: + type: string + format: binary + image/svg+xml: + schema: + type: string + format: binary + image/tiff: + schema: + type: string + format: binary + image/webp: + schema: + type: string + format: binary + image/x-icon: + schema: + type: string + format: binary + text/css: + schema: + type: string + format: binary + text/csv: + schema: + type: string + format: binary + text/calendar: + schema: + type: string + format: binary + text/html: + schema: + type: string + format: binary + text/plain: + schema: + type: string + format: binary + text/javascript: + schema: + type: string + format: binary + text/vcard: + schema: + type: string + format: binary + text/vnd.wap.wml: + schema: + type: string + format: binary + text/xml: + schema: + type: string + format: binary + video/avi: + schema: + type: string + format: binary + video/mp4: + schema: + type: string + format: binary + video/mpeg: + schema: + type: string + format: binary + video/ogg: + schema: + type: string + format: binary + video/quicktime: + schema: + type: string + format: binary + video/webm: + schema: + type: string + format: binary + video/x-ms-wmv: + schema: + type: string + format: binary + video/x-flv: + schema: + type: string + format: binary + required: true + createCallRequest: + description: JSON object containing information to create an outbound call + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/createCall' + updateCallRequest: + description: >- + JSON object containing information to redirect an existing call to a new + BXML document + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateCall' + updateCallBxmlRequest: + required: true + content: + application/xml: + schema: + type: string + description: A valid BXML document to replace the call's current BXML. + examples: + speakSentence: + summary: Speak Sentence + value: |- + + + This is a test sentence. + + redirectUrl: + summary: Redirect + value: |- + + + + + updateCallRecordingRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateCallRecording' + transcribeRecordingRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/transcribeRecording' + updateConferenceRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateConference' + updateConferenceBxmlRequest: + required: true + content: + application/xml: + schema: + type: string + description: A valid BXML document to replace the call's current BXML. + examples: + stopRecording: + summary: Stop Recording + value: |- + + + + + updateConferenceMemberRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateConferenceMember' + codeRequest: + description: MFA code request body. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/codeRequest' + codeVerify: + description: MFA code verify request body. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/verifyCodeRequest' + createSyncLookupRequest: + description: Synchronous phone number lookup request. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/syncLookupRequest' + examples: + singleNumberRequestExample: + $ref: '#/components/examples/singleNumberRequestExample' + multipleNumberRequestExample: + $ref: '#/components/examples/multipleNumberRequestExample' + createAsyncBulkLookupRequest: + description: Asynchronous bulk phone number lookup request. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/asyncLookupRequest' + examples: + multipleNumberRequestExample: + $ref: '#/components/examples/multipleNumberRequestExample' + requestTollFreeVerificationRequest: + description: Request for verification of a toll-free phone number. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/verificationRequest' + updateTollFreeVerificationRequestRequest: + description: Update a request for verification of a toll-free phone number. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/tfvSubmissionWrapper' + verificationWebhookRequest: + description: Verification callback status of a toll-free phone number. + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/verificationWebhook' + - $ref: '#/components/schemas/verificationDenialWebhook' + - $ref: '#/components/schemas/failureWebhook' + - $ref: '#/components/schemas/blockedWebhook' + webhookSubscriptionRequest: + description: >- + Information about a webhook that Bandwidth should send upon the + completion of event customer is trying to subscribe to. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscriptionRequestSchema' + createEndpointRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/createEndpointRequest' + examples: + createWebRtcEndpointRequestExample: + $ref: '#/components/examples/createWeRtcEndpointExample' + updateEndpointBxmlRequest: + required: true + content: + application/xml: + schema: + type: string + description: >- + The BXML document to update the endpoint with. This BXML document + will be executed against the endpoint when it is updated. + + For more information, please refer to our [BXML + documentation](/docs/voice/bxml/). + examples: + updateEndpointBxmlRequestExample: + $ref: '#/components/examples/updateEndpointBxmlRequestExample' + securitySchemes: + Basic: + type: http + scheme: basic + description: >- + Basic authentication is a simple authentication scheme built into the + HTTP protocol. To use it, send your HTTP requests with an + `Authorization` header that contains the word `Basic` followed by a + space and a Base64-encoded string `username:password`. + + + - Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==` + OAuth2: + type: oauth2 + flows: + clientCredentials: + tokenUrl: https://api.bandwidth.com/api/v1/oauth2/token + scopes: {} + callbacks: + inboundCallback: + '{inboundCallbackUrl}': + post: + requestBody: + required: true + description: >- +

This Inbound Message Webhook is an envelope containing either a + received (MO) message to your + + message-enabled Bandwidth telephone number or a multichannel + client's response to a suggestion response + + or location request. + +

The payload type will be one of message-received, + suggestion-response, or + location-request-response. + +

Note that suggestion-response and + location-request-response callback types are + pertinent only for RBM messages sent from the + /messages/multiChannel endpoint. + +

Please visit Webhooks

+ content: + application/json: + schema: + $ref: '#/components/schemas/inboundCallback' + examples: + smsMessageReceivedCallback: + $ref: '#/components/examples/smsMessageReceivedCallbackExample' + mmsMessageReceivedCallback: + $ref: '#/components/examples/mmsMessageReceivedCallbackExample' + responses: + '200': + description: OK + '202': + description: Accepted + statusCallback: + '{statusCallbackUrl}': + post: + requestBody: + required: true + description: >- +

This Outbound Message Webhook is an envelope containing status + information regarding a message sent (MT) + + from your message-enabled Bandwidth telephone number. +

The payload type will be one of message-sending, message-delivered, message-failed or message-read. +

Note that message-read callbacks are pertinent only for RBM messages sent from the /messages/multiChannel endpoint. +

Please visit Webhooks

+ content: + application/json: + schema: + $ref: '#/components/schemas/statusCallback' + examples: + messageSendingCallback: + $ref: '#/components/examples/messageSendingCallbackExample' + smsMessageDeliveredCallback: + $ref: '#/components/examples/smsMessageDeliveredCallbackExample' + mmsMessageDeliveredCallback: + $ref: '#/components/examples/mmsMessageDeliveredCallbackExample' + groupMmsMessageDeliveredCallback: + $ref: >- + #/components/examples/groupMmsMessageDeliveredCallbackExample + messageFailedCallback: + $ref: '#/components/examples/messageFailedCallbackExample' + responses: + '200': + description: OK + '202': + description: Accepted + tfVerificationStatus: + your_url.com/webhookService: + post: + summary: TFV status updates sent to customer's webhook URL. + description: >- + Unique webhook URL provided by customers to which Bandwidth sends a + POST request to notify customer regarding TFV status updates. + operationId: tfvRequest + parameters: + - description: >- + 64-character lowercase hexidecimal HMAC calculated with a shared + secret key, the canonicalized request body, and SHA256. It is + only included when a shared secret key is set through webhook + subscription. + example: ca7b9e9816c90d336f5dca529e733354b81535c7af027b81878ac98afb2dbaa2 + in: header + name: x-bandwidth-signature-hmac-sha256 + schema: + type: string + requestBody: + $ref: '#/components/requestBodies/verificationWebhookRequest' + responses: + '204': + $ref: '#/components/responses/noContentResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + endpointEvent: + '{request.body#/eventCallbackUrl}': + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/endpointEvent' + examples: + endpointDisconnectedEventExample: + $ref: '#/components/examples/endpointDisconnectedEventExample' + responses: + '204': + description: Event was successfully received. From 018a212f51c259d8f6aaf00685fcb0dcf6e5b9fb Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Thu, 15 Jan 2026 16:01:28 -0500 Subject: [PATCH 04/10] Add integration and unit tests for Bandwidth's WebRTC Endpoints API - Implement integration tests for creating, retrieving, listing, and deleting WebRTC endpoints in `test/smoke/test_endpoints_api.py`. - Add unit tests for models related to endpoint requests and responses, including `CreateEndpointRequestBase`, `CreateEndpointResponse`, `CreateEndpointResponseObject`, `Device`, and their respective enums in the `test/unit/models` directory. - Ensure tests cover various scenarios including unauthorized and forbidden access attempts. - Validate the functionality of endpoint events and status enums with dedicated unit tests. --- test/smoke/test_endpoints_api.py | 289 ++++++++++++++++++ .../test_create_endpoint_request_base.py | 70 +++++ .../models/test_create_endpoint_response.py | 69 +++++ .../test_create_endpoint_response_object.py | 91 ++++++ test/unit/models/test_device.py | 69 +++++ test/unit/models/test_device_status_enum.py | 54 ++++ test/unit/models/test_endpoint.py | 90 ++++++ .../models/test_endpoint_direction_enum.py | 63 ++++ test/unit/models/test_endpoint_event.py | 94 ++++++ .../models/test_endpoint_event_type_enum.py | 54 ++++ test/unit/models/test_endpoint_response.py | 67 ++++ test/unit/models/test_endpoint_status_enum.py | 54 ++++ test/unit/models/test_endpoint_type_enum.py | 45 +++ test/unit/models/test_endpoints.py | 75 +++++ .../models/test_list_endpoints_response.py | 112 +++++++ 15 files changed, 1296 insertions(+) create mode 100644 test/smoke/test_endpoints_api.py create mode 100644 test/unit/models/test_create_endpoint_request_base.py create mode 100644 test/unit/models/test_create_endpoint_response.py create mode 100644 test/unit/models/test_create_endpoint_response_object.py create mode 100644 test/unit/models/test_device.py create mode 100644 test/unit/models/test_device_status_enum.py create mode 100644 test/unit/models/test_endpoint.py create mode 100644 test/unit/models/test_endpoint_direction_enum.py create mode 100644 test/unit/models/test_endpoint_event.py create mode 100644 test/unit/models/test_endpoint_event_type_enum.py create mode 100644 test/unit/models/test_endpoint_response.py create mode 100644 test/unit/models/test_endpoint_status_enum.py create mode 100644 test/unit/models/test_endpoint_type_enum.py create mode 100644 test/unit/models/test_endpoints.py create mode 100644 test/unit/models/test_list_endpoints_response.py diff --git a/test/smoke/test_endpoints_api.py b/test/smoke/test_endpoints_api.py new file mode 100644 index 00000000..65714080 --- /dev/null +++ b/test/smoke/test_endpoints_api.py @@ -0,0 +1,289 @@ +""" +Integration test for Bandwidth's WebRTC Endpoints API +""" +import unittest +import time + +from hamcrest import assert_that, has_properties, not_none, instance_of, equal_to + +from bandwidth import ApiClient, ApiResponse, Configuration +from bandwidth.api.endpoints_api import EndpointsApi +from bandwidth.models.create_web_rtc_connection_request import CreateWebRtcConnectionRequest +from bandwidth.models.create_endpoint_response import CreateEndpointResponse +from bandwidth.models.endpoint_response import EndpointResponse +from bandwidth.models.list_endpoints_response import ListEndpointsResponse +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from bandwidth.models.endpoint_direction_enum import EndpointDirectionEnum +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException +from test.utils.env_variables import * + + +class TestEndpointsApi(unittest.TestCase): + """EndpointsApi integration Test""" + + @classmethod + def setUpClass(cls) -> None: + configuration = Configuration( + client_id=BW_CLIENT_ID, + client_secret=BW_CLIENT_SECRET + ) + api_client = ApiClient(configuration) + cls.endpoints_api_instance = EndpointsApi(api_client) + + # Unauthorized API Client + unauthorized_configuration = Configuration( + username='bad_username', + password='bad_password' + ) + unauthorized_api_client = ApiClient(unauthorized_configuration) + cls.unauthorized_api_instance = EndpointsApi(unauthorized_api_client) + + # Forbidden API Client + forbidden_configuration = Configuration( + username=FORBIDDEN_USERNAME, + password=FORBIDDEN_PASSWORD + ) + forbidden_api_client = ApiClient(forbidden_configuration) + cls.forbidden_api_instance = EndpointsApi(forbidden_api_client) + + cls.account_id = BW_ACCOUNT_ID + cls.endpoint_id_array = [] + cls.TEST_SLEEP = 2 + + @classmethod + def tearDownClass(cls): + """Clean up endpoints created during tests""" + for endpoint_id in cls.endpoint_id_array: + try: + cls.endpoints_api_instance.delete_endpoint(cls.account_id, endpoint_id) + time.sleep(1) + except Exception as e: + print(f"Failed to cleanup endpoint {endpoint_id}: {e}") + + def test_create_endpoint(self): + """Test creating a new WebRTC endpoint with all parameters""" + time.sleep(self.TEST_SLEEP) + + create_request = CreateWebRtcConnectionRequest( + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.BIDIRECTIONAL, + event_callback_url=BASE_CALLBACK_URL + "/endpoint/callback", + event_fallback_url=BASE_CALLBACK_URL + "/endpoint/fallback", + tag="python-sdk-test-endpoint" + ) + + response: ApiResponse = self.endpoints_api_instance.create_endpoint_with_http_info( + self.account_id, + create_request + ) + + assert_that(response.status_code, equal_to(201)) + assert_that(response.data, instance_of(CreateEndpointResponse)) + assert_that(response.data.data, has_properties( + 'endpoint_id', instance_of(str), + 'type', EndpointTypeEnum.WEBRTC, + 'status', instance_of(EndpointStatusEnum), + 'token', instance_of(str) + )) + + # Store endpoint ID for cleanup + self.endpoint_id_array.append(response.data.data.endpoint_id) + + def test_create_endpoint_minimal(self): + """Test creating an endpoint with only required parameters""" + time.sleep(self.TEST_SLEEP) + + create_request = CreateWebRtcConnectionRequest( + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.OUTBOUND + ) + + response: CreateEndpointResponse = self.endpoints_api_instance.create_endpoint( + self.account_id, + create_request + ) + + assert_that(response.data, has_properties( + 'endpoint_id', instance_of(str), + 'type', EndpointTypeEnum.WEBRTC, + 'token', not_none() + )) + + # Store endpoint ID for cleanup + self.endpoint_id_array.append(response.data.endpoint_id) + + def test_get_endpoint(self): + """Test retrieving an endpoint by ID""" + time.sleep(self.TEST_SLEEP) + + # First create an endpoint + create_request = CreateWebRtcConnectionRequest( + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.INBOUND, + tag="test-get-endpoint" + ) + + create_response: CreateEndpointResponse = self.endpoints_api_instance.create_endpoint( + self.account_id, + create_request + ) + endpoint_id = create_response.data.endpoint_id + self.endpoint_id_array.append(endpoint_id) + + time.sleep(self.TEST_SLEEP) + + # Now get the endpoint + response: ApiResponse = self.endpoints_api_instance.get_endpoint_with_http_info( + self.account_id, + endpoint_id + ) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(EndpointResponse)) + assert_that(response.data.data, has_properties( + 'endpoint_id', endpoint_id, + 'type', EndpointTypeEnum.WEBRTC, + 'tag', "test-get-endpoint" + )) + + def test_get_endpoint_not_found(self): + """Test getting a non-existent endpoint returns 404""" + time.sleep(self.TEST_SLEEP) + + with self.assertRaises(ApiException) as context: + self.endpoints_api_instance.get_endpoint( + self.account_id, + "non-existent-endpoint-id" + ) + + assert_that(context.exception.status, equal_to(404)) + + def test_list_endpoints(self): + """Test listing endpoints""" + time.sleep(self.TEST_SLEEP) + + # Create a couple of endpoints first + for i in range(2): + create_request = CreateWebRtcConnectionRequest( + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.BIDIRECTIONAL, + tag=f"test-list-endpoint-{i}" + ) + create_response = self.endpoints_api_instance.create_endpoint( + self.account_id, + create_request + ) + self.endpoint_id_array.append(create_response.data.endpoint_id) + time.sleep(1) + + time.sleep(self.TEST_SLEEP) + + # List endpoints + response: ApiResponse = self.endpoints_api_instance.list_endpoints_with_http_info( + self.account_id, + limit=10 + ) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(ListEndpointsResponse)) + assert_that(response.data.data, instance_of(list)) + + def test_list_endpoints_with_filter(self): + """Test listing endpoints with type filter""" + time.sleep(self.TEST_SLEEP) + + response: ListEndpointsResponse = self.endpoints_api_instance.list_endpoints( + self.account_id, + type=EndpointTypeEnum.WEBRTC, + limit=5 + ) + + assert_that(response.data, instance_of(list)) + # Verify all returned endpoints are of type WEBRTC + for endpoint in response.data: + assert_that(endpoint.type, equal_to(EndpointTypeEnum.WEBRTC)) + + def test_delete_endpoint(self): + """Test deleting an endpoint""" + time.sleep(self.TEST_SLEEP) + + # Create an endpoint to delete + create_request = CreateWebRtcConnectionRequest( + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.BIDIRECTIONAL, + tag="test-delete-endpoint" + ) + + create_response: CreateEndpointResponse = self.endpoints_api_instance.create_endpoint( + self.account_id, + create_request + ) + endpoint_id = create_response.data.endpoint_id + + time.sleep(self.TEST_SLEEP) + + # Delete the endpoint + response: ApiResponse = self.endpoints_api_instance.delete_endpoint_with_http_info( + self.account_id, + endpoint_id + ) + + assert_that(response.status_code, equal_to(204)) + + # Verify endpoint is deleted + time.sleep(self.TEST_SLEEP) + with self.assertRaises(ApiException) as context: + self.endpoints_api_instance.get_endpoint(self.account_id, endpoint_id) + + assert_that(context.exception.status, equal_to(404)) + + def test_delete_endpoint_not_found(self): + """Test deleting a non-existent endpoint returns 404""" + time.sleep(self.TEST_SLEEP) + + with self.assertRaises(ApiException) as context: + self.endpoints_api_instance.delete_endpoint( + self.account_id, + "non-existent-endpoint-id" + ) + + assert_that(context.exception.status, equal_to(404)) + + def test_create_endpoint_unauthorized(self): + """Test creating an endpoint with invalid credentials returns 401""" + time.sleep(self.TEST_SLEEP) + + create_request = CreateWebRtcConnectionRequest( + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.BIDIRECTIONAL + ) + + with self.assertRaises(ApiException) as context: + self.unauthorized_api_instance.create_endpoint( + self.account_id, + create_request + ) + + assert_that(context.exception.status, equal_to(401)) + + def test_create_endpoint_forbidden(self): + """Test creating an endpoint with forbidden credentials returns 403""" + time.sleep(self.TEST_SLEEP) + + create_request = CreateWebRtcConnectionRequest( + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.BIDIRECTIONAL + ) + + with self.assertRaises(ApiException) as context: + self.forbidden_api_instance.create_endpoint( + self.account_id, + create_request + ) + + assert_that(context.exception.status, equal_to(403)) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_create_endpoint_request_base.py b/test/unit/models/test_create_endpoint_request_base.py new file mode 100644 index 00000000..cbd1c86f --- /dev/null +++ b/test/unit/models/test_create_endpoint_request_base.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.create_endpoint_request_base import CreateEndpointRequestBase +from bandwidth.models.endpoint_direction_enum import EndpointDirectionEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum + +class TestCreateEndpointRequestBase(unittest.TestCase): + """CreateEndpointRequestBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateEndpointRequestBase: + """Test CreateEndpointRequestBase + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return CreateEndpointRequestBase( + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.BIDIRECTIONAL, + event_callback_url='https://example.com/callback', + event_fallback_url='https://example.com/fallback', + tag='test-request' + ) + else: + return CreateEndpointRequestBase( + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.BIDIRECTIONAL + ) + + def testCreateEndpointRequestBase(self): + """Test CreateEndpointRequestBase""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CreateEndpointRequestBase) + assert instance.type == EndpointTypeEnum.WEBRTC + assert instance.direction == EndpointDirectionEnum.BIDIRECTIONAL + assert instance.event_callback_url == 'https://example.com/callback' + assert instance.event_fallback_url == 'https://example.com/fallback' + assert instance.tag == 'test-request' + + def testCreateEndpointRequestBaseRequiredOnly(self): + """Test CreateEndpointRequestBase with required fields only""" + instance = self.make_instance(False) + assert instance is not None + assert isinstance(instance, CreateEndpointRequestBase) + assert instance.type == EndpointTypeEnum.WEBRTC + assert instance.direction == EndpointDirectionEnum.BIDIRECTIONAL + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_create_endpoint_response.py b/test/unit/models/test_create_endpoint_response.py new file mode 100644 index 00000000..25f7feca --- /dev/null +++ b/test/unit/models/test_create_endpoint_response.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.create_endpoint_response import CreateEndpointResponse +from bandwidth.models.create_endpoint_response_object import CreateEndpointResponseObject +from bandwidth.models.link import Link +from bandwidth.models.error import Error +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum + +class TestCreateEndpointResponse(unittest.TestCase): + """CreateEndpointResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateEndpointResponse: + """Test CreateEndpointResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + return CreateEndpointResponse( + links=[ + Link(href='https://api.bandwidth.com/endpoint-123', rel='self') + ], + data=CreateEndpointResponseObject( + endpoint_id='endpoint-123', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0), + token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test.token' + ), + errors=[] + ) + + def testCreateEndpointResponse(self): + """Test CreateEndpointResponse""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CreateEndpointResponse) + assert isinstance(instance.links, list) + assert len(instance.links) == 1 + assert isinstance(instance.links[0], Link) + assert isinstance(instance.data, CreateEndpointResponseObject) + assert instance.data.endpoint_id == 'endpoint-123' + assert instance.data.token == 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test.token' + assert isinstance(instance.errors, list) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_create_endpoint_response_object.py b/test/unit/models/test_create_endpoint_response_object.py new file mode 100644 index 00000000..674dfe41 --- /dev/null +++ b/test/unit/models/test_create_endpoint_response_object.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.create_endpoint_response_object import CreateEndpointResponseObject +from bandwidth.models.device import Device +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from bandwidth.models.device_status_enum import DeviceStatusEnum + +class TestCreateEndpointResponseObject(unittest.TestCase): + """CreateEndpointResponseObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateEndpointResponseObject: + """Test CreateEndpointResponseObject + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return CreateEndpointResponseObject( + endpoint_id='endpoint-456', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0), + tag='response-endpoint', + devices=[ + Device( + device_id='device-789', + device_name='Response Device', + status=DeviceStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0) + ) + ], + token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.response.token' + ) + else: + return CreateEndpointResponseObject( + endpoint_id='endpoint-456', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0), + token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.response.token' + ) + + def testCreateEndpointResponseObject(self): + """Test CreateEndpointResponseObject""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CreateEndpointResponseObject) + assert instance.endpoint_id == 'endpoint-456' + assert instance.type == EndpointTypeEnum.WEBRTC + assert instance.status == EndpointStatusEnum.CONNECTED + assert isinstance(instance.creation_timestamp, datetime) + assert isinstance(instance.expiration_timestamp, datetime) + assert instance.tag == 'response-endpoint' + assert isinstance(instance.devices, list) + assert len(instance.devices) == 1 + assert instance.token == 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.response.token' + + def testCreateEndpointResponseObjectRequiredOnly(self): + """Test CreateEndpointResponseObject with required fields only""" + instance = self.make_instance(False) + assert instance is not None + assert isinstance(instance, CreateEndpointResponseObject) + assert instance.endpoint_id == 'endpoint-456' + assert instance.token == 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.response.token' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_device.py b/test/unit/models/test_device.py new file mode 100644 index 00000000..0ae818e3 --- /dev/null +++ b/test/unit/models/test_device.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.device import Device +from bandwidth.models.device_status_enum import DeviceStatusEnum + +class TestDevice(unittest.TestCase): + """Device unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Device: + """Test Device + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return Device( + device_id='device-abc-123', + device_name='My Test Device', + status=DeviceStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0) + ) + else: + return Device( + device_id='device-abc-123', + status=DeviceStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0) + ) + + def testDevice(self): + """Test Device""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, Device) + assert instance.device_id == 'device-abc-123' + assert instance.device_name == 'My Test Device' + assert instance.status == DeviceStatusEnum.CONNECTED + assert isinstance(instance.creation_timestamp, datetime) + + def testDeviceRequiredOnly(self): + """Test Device with required fields only""" + instance = self.make_instance(False) + assert instance is not None + assert isinstance(instance, Device) + assert instance.device_id == 'device-abc-123' + assert instance.status == DeviceStatusEnum.CONNECTED + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_device_status_enum.py b/test/unit/models/test_device_status_enum.py new file mode 100644 index 00000000..7e35b479 --- /dev/null +++ b/test/unit/models/test_device_status_enum.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.device_status_enum import DeviceStatusEnum + +class TestDeviceStatusEnum(unittest.TestCase): + """DeviceStatusEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDeviceStatusEnum(self): + """Test DeviceStatusEnum""" + # Test that the enum has the expected values + assert DeviceStatusEnum.CONNECTED == 'CONNECTED' + assert DeviceStatusEnum.DISCONNECTED == 'DISCONNECTED' + + # Test enum instantiation + instance_connected = DeviceStatusEnum.CONNECTED + assert instance_connected is not None + assert isinstance(instance_connected, DeviceStatusEnum) + + instance_disconnected = DeviceStatusEnum.DISCONNECTED + assert instance_disconnected is not None + assert isinstance(instance_disconnected, DeviceStatusEnum) + + # Test from_json + json_str_connected = '"CONNECTED"' + instance_from_json = DeviceStatusEnum.from_json(json_str_connected) + assert instance_from_json == DeviceStatusEnum.CONNECTED + + json_str_disconnected = '"DISCONNECTED"' + instance_from_json = DeviceStatusEnum.from_json(json_str_disconnected) + assert instance_from_json == DeviceStatusEnum.DISCONNECTED + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_endpoint.py b/test/unit/models/test_endpoint.py new file mode 100644 index 00000000..c610d6af --- /dev/null +++ b/test/unit/models/test_endpoint.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.endpoint import Endpoint +from bandwidth.models.device import Device +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from bandwidth.models.device_status_enum import DeviceStatusEnum + +class TestEndpoint(unittest.TestCase): + """Endpoint unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Endpoint: + """Test Endpoint + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return Endpoint( + endpoint_id='endpoint-123', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0), + tag='test-endpoint', + devices=[ + Device( + device_id='device-456', + device_name='Test Device', + status=DeviceStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0) + ) + ] + ) + else: + return Endpoint( + endpoint_id='endpoint-123', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0) + ) + + def testEndpoint(self): + """Test Endpoint""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, Endpoint) + assert instance.endpoint_id == 'endpoint-123' + assert instance.type == EndpointTypeEnum.WEBRTC + assert instance.status == EndpointStatusEnum.CONNECTED + assert isinstance(instance.creation_timestamp, datetime) + assert isinstance(instance.expiration_timestamp, datetime) + assert instance.tag == 'test-endpoint' + assert isinstance(instance.devices, list) + assert len(instance.devices) == 1 + assert isinstance(instance.devices[0], Device) + + def testEndpointRequiredOnly(self): + """Test Endpoint with required fields only""" + instance = self.make_instance(False) + assert instance is not None + assert isinstance(instance, Endpoint) + assert instance.endpoint_id == 'endpoint-123' + assert instance.type == EndpointTypeEnum.WEBRTC + assert instance.status == EndpointStatusEnum.CONNECTED + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_endpoint_direction_enum.py b/test/unit/models/test_endpoint_direction_enum.py new file mode 100644 index 00000000..8d9246d7 --- /dev/null +++ b/test/unit/models/test_endpoint_direction_enum.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.endpoint_direction_enum import EndpointDirectionEnum + +class TestEndpointDirectionEnum(unittest.TestCase): + """EndpointDirectionEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointDirectionEnum(self): + """Test EndpointDirectionEnum""" + # Test that the enum has the expected values + assert EndpointDirectionEnum.INBOUND == 'INBOUND' + assert EndpointDirectionEnum.OUTBOUND == 'OUTBOUND' + assert EndpointDirectionEnum.BIDIRECTIONAL == 'BIDIRECTIONAL' + + # Test enum instantiation + instance_inbound = EndpointDirectionEnum.INBOUND + assert instance_inbound is not None + assert isinstance(instance_inbound, EndpointDirectionEnum) + + instance_outbound = EndpointDirectionEnum.OUTBOUND + assert instance_outbound is not None + assert isinstance(instance_outbound, EndpointDirectionEnum) + + instance_bidirectional = EndpointDirectionEnum.BIDIRECTIONAL + assert instance_bidirectional is not None + assert isinstance(instance_bidirectional, EndpointDirectionEnum) + + # Test from_json + json_str_inbound = '"INBOUND"' + instance_from_json = EndpointDirectionEnum.from_json(json_str_inbound) + assert instance_from_json == EndpointDirectionEnum.INBOUND + + json_str_outbound = '"OUTBOUND"' + instance_from_json = EndpointDirectionEnum.from_json(json_str_outbound) + assert instance_from_json == EndpointDirectionEnum.OUTBOUND + + json_str_bidirectional = '"BIDIRECTIONAL"' + instance_from_json = EndpointDirectionEnum.from_json(json_str_bidirectional) + assert instance_from_json == EndpointDirectionEnum.BIDIRECTIONAL + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_endpoint_event.py b/test/unit/models/test_endpoint_event.py new file mode 100644 index 00000000..2311fa26 --- /dev/null +++ b/test/unit/models/test_endpoint_event.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.endpoint_event import EndpointEvent +from bandwidth.models.device import Device +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum +from bandwidth.models.endpoint_event_type_enum import EndpointEventTypeEnum +from bandwidth.models.device_status_enum import DeviceStatusEnum + +class TestEndpointEvent(unittest.TestCase): + """EndpointEvent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointEvent: + """Test EndpointEvent + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return EndpointEvent( + endpoint_id='endpoint-event-123', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0), + tag='event-endpoint', + event_time=datetime(2026, 1, 15, 11, 30, 0), + event_type=EndpointEventTypeEnum.DEVICE_CONNECTED, + device=Device( + device_id='device-event-456', + device_name='Event Device', + status=DeviceStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 11, 30, 0) + ) + ) + else: + return EndpointEvent( + endpoint_id='endpoint-event-123', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0), + event_time=datetime(2026, 1, 15, 11, 30, 0), + event_type=EndpointEventTypeEnum.DEVICE_CONNECTED + ) + + def testEndpointEvent(self): + """Test EndpointEvent""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, EndpointEvent) + assert instance.endpoint_id == 'endpoint-event-123' + assert instance.type == EndpointTypeEnum.WEBRTC + assert instance.status == EndpointStatusEnum.CONNECTED + assert isinstance(instance.creation_timestamp, datetime) + assert isinstance(instance.expiration_timestamp, datetime) + assert isinstance(instance.event_time, datetime) + assert instance.event_type == EndpointEventTypeEnum.DEVICE_CONNECTED + assert instance.tag == 'event-endpoint' + assert isinstance(instance.device, Device) + assert instance.device.device_id == 'device-event-456' + + def testEndpointEventRequiredOnly(self): + """Test EndpointEvent with required fields only""" + instance = self.make_instance(False) + assert instance is not None + assert isinstance(instance, EndpointEvent) + assert instance.endpoint_id == 'endpoint-event-123' + assert isinstance(instance.event_time, datetime) + assert instance.event_type == EndpointEventTypeEnum.DEVICE_CONNECTED + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_endpoint_event_type_enum.py b/test/unit/models/test_endpoint_event_type_enum.py new file mode 100644 index 00000000..042f5a22 --- /dev/null +++ b/test/unit/models/test_endpoint_event_type_enum.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.endpoint_event_type_enum import EndpointEventTypeEnum + +class TestEndpointEventTypeEnum(unittest.TestCase): + """EndpointEventTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointEventTypeEnum(self): + """Test EndpointEventTypeEnum""" + # Test that the enum has the expected values + assert EndpointEventTypeEnum.DEVICE_CONNECTED == 'DEVICE_CONNECTED' + assert EndpointEventTypeEnum.DEVICE_DISCONNECTED == 'DEVICE_DISCONNECTED' + + # Test enum instantiation + instance_connected = EndpointEventTypeEnum.DEVICE_CONNECTED + assert instance_connected is not None + assert isinstance(instance_connected, EndpointEventTypeEnum) + + instance_disconnected = EndpointEventTypeEnum.DEVICE_DISCONNECTED + assert instance_disconnected is not None + assert isinstance(instance_disconnected, EndpointEventTypeEnum) + + # Test from_json + json_str_connected = '"DEVICE_CONNECTED"' + instance_from_json = EndpointEventTypeEnum.from_json(json_str_connected) + assert instance_from_json == EndpointEventTypeEnum.DEVICE_CONNECTED + + json_str_disconnected = '"DEVICE_DISCONNECTED"' + instance_from_json = EndpointEventTypeEnum.from_json(json_str_disconnected) + assert instance_from_json == EndpointEventTypeEnum.DEVICE_DISCONNECTED + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_endpoint_response.py b/test/unit/models/test_endpoint_response.py new file mode 100644 index 00000000..e6811a3a --- /dev/null +++ b/test/unit/models/test_endpoint_response.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.endpoint_response import EndpointResponse +from bandwidth.models.endpoint import Endpoint +from bandwidth.models.link import Link +from bandwidth.models.error import Error +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum + +class TestEndpointResponse(unittest.TestCase): + """EndpointResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EndpointResponse: + """Test EndpointResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + return EndpointResponse( + links=[ + Link(href='https://api.bandwidth.com/endpoint-999', rel='self') + ], + data=Endpoint( + endpoint_id='endpoint-999', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.DISCONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0) + ), + errors=[] + ) + + def testEndpointResponse(self): + """Test EndpointResponse""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, EndpointResponse) + assert isinstance(instance.links, list) + assert len(instance.links) == 1 + assert isinstance(instance.links[0], Link) + assert isinstance(instance.data, Endpoint) + assert instance.data.endpoint_id == 'endpoint-999' + assert isinstance(instance.errors, list) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_endpoint_status_enum.py b/test/unit/models/test_endpoint_status_enum.py new file mode 100644 index 00000000..7487c5e6 --- /dev/null +++ b/test/unit/models/test_endpoint_status_enum.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum + +class TestEndpointStatusEnum(unittest.TestCase): + """EndpointStatusEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointStatusEnum(self): + """Test EndpointStatusEnum""" + # Test that the enum has the expected values + assert EndpointStatusEnum.CONNECTED == 'CONNECTED' + assert EndpointStatusEnum.DISCONNECTED == 'DISCONNECTED' + + # Test enum instantiation + instance_connected = EndpointStatusEnum.CONNECTED + assert instance_connected is not None + assert isinstance(instance_connected, EndpointStatusEnum) + + instance_disconnected = EndpointStatusEnum.DISCONNECTED + assert instance_disconnected is not None + assert isinstance(instance_disconnected, EndpointStatusEnum) + + # Test from_json + json_str_connected = '"CONNECTED"' + instance_from_json = EndpointStatusEnum.from_json(json_str_connected) + assert instance_from_json == EndpointStatusEnum.CONNECTED + + json_str_disconnected = '"DISCONNECTED"' + instance_from_json = EndpointStatusEnum.from_json(json_str_disconnected) + assert instance_from_json == EndpointStatusEnum.DISCONNECTED + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_endpoint_type_enum.py b/test/unit/models/test_endpoint_type_enum.py new file mode 100644 index 00000000..5b3144e7 --- /dev/null +++ b/test/unit/models/test_endpoint_type_enum.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum + +class TestEndpointTypeEnum(unittest.TestCase): + """EndpointTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEndpointTypeEnum(self): + """Test EndpointTypeEnum""" + # Test that the enum has the expected value + assert EndpointTypeEnum.WEBRTC == 'WEBRTC' + + # Test enum instantiation + instance = EndpointTypeEnum.WEBRTC + assert instance is not None + assert isinstance(instance, EndpointTypeEnum) + + # Test from_json + json_str = '"WEBRTC"' + instance_from_json = EndpointTypeEnum.from_json(json_str) + assert instance_from_json == EndpointTypeEnum.WEBRTC + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_endpoints.py b/test/unit/models/test_endpoints.py new file mode 100644 index 00000000..92b6e16e --- /dev/null +++ b/test/unit/models/test_endpoints.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.endpoints import Endpoints +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum + +class TestEndpoints(unittest.TestCase): + """Endpoints unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Endpoints: + """Test Endpoints + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return Endpoints( + endpoint_id='endpoint-789', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.DISCONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0), + tag='list-endpoint' + ) + else: + return Endpoints( + endpoint_id='endpoint-789', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.DISCONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0) + ) + + def testEndpoints(self): + """Test Endpoints""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, Endpoints) + assert instance.endpoint_id == 'endpoint-789' + assert instance.type == EndpointTypeEnum.WEBRTC + assert instance.status == EndpointStatusEnum.DISCONNECTED + assert isinstance(instance.creation_timestamp, datetime) + assert isinstance(instance.expiration_timestamp, datetime) + assert instance.tag == 'list-endpoint' + + def testEndpointsRequiredOnly(self): + """Test Endpoints with required fields only""" + instance = self.make_instance(False) + assert instance is not None + assert isinstance(instance, Endpoints) + assert instance.endpoint_id == 'endpoint-789' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_list_endpoints_response.py b/test/unit/models/test_list_endpoints_response.py new file mode 100644 index 00000000..cad5b71c --- /dev/null +++ b/test/unit/models/test_list_endpoints_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.list_endpoints_response import ListEndpointsResponse +from bandwidth.models.endpoints import Endpoints +from bandwidth.models.link import Link +from bandwidth.models.error import Error +from bandwidth.models.page import Page +from bandwidth.models.endpoint_status_enum import EndpointStatusEnum +from bandwidth.models.endpoint_type_enum import EndpointTypeEnum + +class TestListEndpointsResponse(unittest.TestCase): + """ListEndpointsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListEndpointsResponse: + """Test ListEndpointsResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return ListEndpointsResponse( + links=[ + Link(href='https://api.bandwidth.com/endpoints', rel='self'), + Link(href='https://api.bandwidth.com/endpoints?page=2', rel='next') + ], + page=Page( + total_count=100, + page_size=10, + page_number=1 + ), + data=[ + Endpoints( + endpoint_id='endpoint-1', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0), + tag='endpoint-1-tag' + ), + Endpoints( + endpoint_id='endpoint-2', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.DISCONNECTED, + creation_timestamp=datetime(2026, 1, 15, 9, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 9, 0, 0) + ) + ], + errors=[] + ) + else: + return ListEndpointsResponse( + links=[ + Link(href='https://api.bandwidth.com/endpoints', rel='self') + ], + data=[ + Endpoints( + endpoint_id='endpoint-1', + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.CONNECTED, + creation_timestamp=datetime(2026, 1, 15, 10, 0, 0), + expiration_timestamp=datetime(2026, 1, 16, 10, 0, 0) + ) + ], + errors=[] + ) + + def testListEndpointsResponse(self): + """Test ListEndpointsResponse""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ListEndpointsResponse) + assert isinstance(instance.links, list) + assert len(instance.links) == 2 + assert isinstance(instance.page, Page) + assert instance.page.total_count == 100 + assert isinstance(instance.data, list) + assert len(instance.data) == 2 + assert isinstance(instance.data[0], Endpoints) + assert instance.data[0].endpoint_id == 'endpoint-1' + assert instance.data[1].endpoint_id == 'endpoint-2' + assert isinstance(instance.errors, list) + + def testListEndpointsResponseRequiredOnly(self): + """Test ListEndpointsResponse with required fields only""" + instance = self.make_instance(False) + assert instance is not None + assert isinstance(instance, ListEndpointsResponse) + assert len(instance.data) == 1 + +if __name__ == '__main__': + unittest.main() From bc3a4985cb0f7f5c47f729df4c639ad90be9a0fa Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Thu, 15 Jan 2026 16:46:11 -0500 Subject: [PATCH 05/10] Refactor EndpointsApi tests to use enum constants and update pagination fields in ListEndpointsResponse tests --- test/unit/api/test_endpoints_api.py | 16 ++++++++-------- test/unit/models/test_list_endpoints_response.py | 6 ++++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/test/unit/api/test_endpoints_api.py b/test/unit/api/test_endpoints_api.py index b6407ffe..a3d744bd 100644 --- a/test/unit/api/test_endpoints_api.py +++ b/test/unit/api/test_endpoints_api.py @@ -49,8 +49,8 @@ def test_create_endpoint(self) -> None: Create Endpoint """ endpoint_body = CreateWebRtcConnectionRequest( - type=EndpointTypeEnum("webrtc"), - direction=EndpointDirectionEnum("inbound"), + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.INBOUND, event_callback_url="https://myServer.com/bandwidth/webhooks/endpoint", event_fallback_url="https://myFallbackServer.com/bandwidth/webhooks/endpoint", tag="test-endpoint", @@ -120,8 +120,8 @@ def test_list_endpoints_with_filters(self) -> None: """ response = self.endpoints_api_instance.list_endpoints_with_http_info( BW_ACCOUNT_ID, - type=EndpointTypeEnum("webrtc"), - status=EndpointStatusEnum("active"), + type=EndpointTypeEnum.WEBRTC, + status=EndpointStatusEnum.CONNECTED, limit=100 ) @@ -171,8 +171,8 @@ def test_create_endpoint_minimal(self) -> None: Create Endpoint with Minimal Fields """ endpoint_body = CreateWebRtcConnectionRequest( - type=EndpointTypeEnum("webrtc"), - direction=EndpointDirectionEnum("outbound") + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.OUTBOUND ) response = self.endpoints_api_instance.create_endpoint_with_http_info( BW_ACCOUNT_ID, @@ -188,8 +188,8 @@ def test_create_endpoint_sip(self) -> None: Create SIP Endpoint """ endpoint_body = CreateWebRtcConnectionRequest( - type=EndpointTypeEnum("sip"), - direction=EndpointDirectionEnum("bidirectional"), + type=EndpointTypeEnum.WEBRTC, + direction=EndpointDirectionEnum.BIDIRECTIONAL, event_callback_url="https://myServer.com/bandwidth/webhooks/sip-endpoint", tag="sip-test-endpoint" ) diff --git a/test/unit/models/test_list_endpoints_response.py b/test/unit/models/test_list_endpoints_response.py index cad5b71c..b1f38aff 100644 --- a/test/unit/models/test_list_endpoints_response.py +++ b/test/unit/models/test_list_endpoints_response.py @@ -45,8 +45,9 @@ def make_instance(self, include_optional) -> ListEndpointsResponse: Link(href='https://api.bandwidth.com/endpoints?page=2', rel='next') ], page=Page( - total_count=100, page_size=10, + total_elements=100, + total_pages=10, page_number=1 ), data=[ @@ -93,7 +94,8 @@ def testListEndpointsResponse(self): assert isinstance(instance.links, list) assert len(instance.links) == 2 assert isinstance(instance.page, Page) - assert instance.page.total_count == 100 + assert instance.page.total_elements == 100 + assert instance.page.page_size == 10 assert isinstance(instance.data, list) assert len(instance.data) == 2 assert isinstance(instance.data[0], Endpoints) From 4139ca5b94a5e04bbd67f01e68f653b52bce28b5 Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Thu, 15 Jan 2026 17:33:20 -0500 Subject: [PATCH 06/10] Update endpoint models to make type and status fields optional --- bandwidth/api/endpoints_api.py | 679 +++++++++--------- .../models/create_endpoint_response_object.py | 25 +- bandwidth/models/endpoint.py | 27 +- bandwidth/models/endpoint_event.py | 27 +- bandwidth/models/endpoints.py | 24 +- bandwidth/models/error_response.py | 22 +- 6 files changed, 409 insertions(+), 395 deletions(-) diff --git a/bandwidth/api/endpoints_api.py b/bandwidth/api/endpoints_api.py index e8b26ba3..5a6b5dcc 100644 --- a/bandwidth/api/endpoints_api.py +++ b/bandwidth/api/endpoints_api.py @@ -340,7 +340,7 @@ def _create_endpoint_serialize( # authentication setting _auth_settings: List[str] = [ - 'Basic', + 'Basic', 'OAuth2' ] @@ -644,7 +644,7 @@ def _delete_endpoint_serialize( # authentication setting _auth_settings: List[str] = [ - 'Basic', + 'Basic', 'OAuth2' ] @@ -948,7 +948,7 @@ def _get_endpoint_serialize( # authentication setting _auth_settings: List[str] = [ - 'Basic', + 'Basic', 'OAuth2' ] @@ -1274,21 +1274,14 @@ def _list_endpoints_serialize( _path_params['accountId'] = account_id # process the query parameters if type is not None: - _query_params.append(('type', type.value)) - if status is not None: - _query_params.append(('status', status.value)) - if after_cursor is not None: - _query_params.append(('afterCursor', after_cursor)) - if limit is not None: - _query_params.append(('limit', limit)) - + # process the header parameters # process the form parameters # process the body parameter @@ -1305,7 +1298,7 @@ def _list_endpoints_serialize( # authentication setting _auth_settings: List[str] = [ - 'Basic', + 'Basic', 'OAuth2' ] @@ -1326,334 +1319,334 @@ def _list_endpoints_serialize( - - @validate_call - def update_endpoint_bxml( - self, - account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], - endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], - body: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, - ) -> None: - """Update Endpoint BXML - - Updates the BXML for the specified endpoint. - - :param account_id: Your Bandwidth Account ID. (required) - :type account_id: str - :param endpoint_id: BRTC Endpoint ID. (required) - :type endpoint_id: str - :param body: (required) - :type body: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_endpoint_bxml_serialize( - account_id=account_id, - endpoint_id=endpoint_id, - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def update_endpoint_bxml_with_http_info( - self, - account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], - endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], - body: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, - ) -> ApiResponse[None]: - """Update Endpoint BXML - - Updates the BXML for the specified endpoint. - - :param account_id: Your Bandwidth Account ID. (required) - :type account_id: str - :param endpoint_id: BRTC Endpoint ID. (required) - :type endpoint_id: str - :param body: (required) - :type body: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_endpoint_bxml_serialize( - account_id=account_id, - endpoint_id=endpoint_id, - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def update_endpoint_bxml_without_preload_content( - self, - account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], - endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], - body: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, - ) -> RESTResponseType: - """Update Endpoint BXML - - Updates the BXML for the specified endpoint. - - :param account_id: Your Bandwidth Account ID. (required) - :type account_id: str - :param endpoint_id: BRTC Endpoint ID. (required) - :type endpoint_id: str - :param body: (required) - :type body: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_endpoint_bxml_serialize( - account_id=account_id, - endpoint_id=endpoint_id, - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_endpoint_bxml_serialize( - self, - account_id, - endpoint_id, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _hosts = [ - 'https://api.bandwidth.com/v2' - ] - _host = _hosts[_host_index] - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if account_id is not None: - _path_params['accountId'] = account_id - if endpoint_id is not None: - _path_params['endpointId'] = endpoint_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/xml' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'Basic', - 'OAuth2' - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/accounts/{accountId}/endpoints/{endpointId}/bxml', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + # NOTE: This endpoint is not yet available in the API + # Uncomment when the endpoint becomes available + # @validate_call + # def update_endpoint_bxml( + # self, + # account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + # endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + # body: StrictStr, + # _request_timeout: Union[ + # None, + # Annotated[StrictFloat, Field(gt=0)], + # Tuple[ + # Annotated[StrictFloat, Field(gt=0)], + # Annotated[StrictFloat, Field(gt=0)] + # ] + # ] = None, + # _request_auth: Optional[Dict[StrictStr, Any]] = None, + # _content_type: Optional[StrictStr] = None, + # _headers: Optional[Dict[StrictStr, Any]] = None, + # _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + # ) -> None: + # ) -> None: + # """Update Endpoint BXML + # + # Updates the BXML for the specified endpoint. + # + # :param account_id: Your Bandwidth Account ID. (required) + # :type account_id: str + # :param endpoint_id: BRTC Endpoint ID. (required) + # :type endpoint_id: str + # :param body: (required) + # :type body: str + # :param _request_timeout: timeout setting for this request. If one + # number provided, it will be total request + # timeout. It can also be a pair (tuple) of + # (connection, read) timeouts. + # :type _request_timeout: int, tuple(int, int), optional + # :param _request_auth: set to override the auth_settings for an a single + # request; this effectively ignores the + # authentication in the spec for a single request. + # :type _request_auth: dict, optional + # :param _content_type: force content-type for the request. + # :type _content_type: str, Optional + # :param _headers: set to override the headers for a single + # request; this effectively ignores the headers + # in the spec for a single request. + # :type _headers: dict, optional + # :param _host_index: set to override the host_index for a single + # request; this effectively ignores the host_index + # in the spec for a single request. + # :type _host_index: int, optional + # :return: Returns the result object. + # """ # noqa: E501 + # + # _param = self._update_endpoint_bxml_serialize( + # account_id=account_id, + # endpoint_id=endpoint_id, + # body=body, + # _request_auth=_request_auth, + # _content_type=_content_type, + # _headers=_headers, + # _host_index=_host_index + # ) + # + # _response_types_map: Dict[str, Optional[str]] = { + # '204': None, + # '400': "ErrorResponse", + # '401': "ErrorResponse", + # '403': "ErrorResponse", + # '404': "ErrorResponse", + # '405': "ErrorResponse", + # '415': "ErrorResponse", + # '429': "ErrorResponse", + # '500': "ErrorResponse", + # } + # response_data = self.api_client.call_api( + # *_param, + # _request_timeout=_request_timeout + # ) + # response_data.read() + # return self.api_client.response_deserialize( + # response_data=response_data, + # response_types_map=_response_types_map, + # ).data + + + # @validate_call + # def update_endpoint_bxml_with_http_info( + # self, + # account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + # endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + # body: StrictStr, + # _request_timeout: Union[ + # None, + # Annotated[StrictFloat, Field(gt=0)], + # Tuple[ + # Annotated[StrictFloat, Field(gt=0)], + # Annotated[StrictFloat, Field(gt=0)] + # ] + # ] = None, + # _request_auth: Optional[Dict[StrictStr, Any]] = None, + # _content_type: Optional[StrictStr] = None, + # _headers: Optional[Dict[StrictStr, Any]] = None, + # _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + # ) -> ApiResponse[None]: + # """Update Endpoint BXML + + # Updates the BXML for the specified endpoint. + + # :param account_id: Your Bandwidth Account ID. (required) + # :type account_id: str + # :param endpoint_id: BRTC Endpoint ID. (required) + # :type endpoint_id: str + # :param body: (required) + # :type body: str + # :param _request_timeout: timeout setting for this request. If one + # number provided, it will be total request + # timeout. It can also be a pair (tuple) of + # (connection, read) timeouts. + # :type _request_timeout: int, tuple(int, int), optional + # :param _request_auth: set to override the auth_settings for an a single + # request; this effectively ignores the + # authentication in the spec for a single request. + # :type _request_auth: dict, optional + # :param _content_type: force content-type for the request. + # :type _content_type: str, Optional + # :param _headers: set to override the headers for a single + # request; this effectively ignores the headers + # in the spec for a single request. + # :type _headers: dict, optional + # :param _host_index: set to override the host_index for a single + # request; this effectively ignores the host_index + # in the spec for a single request. + # :type _host_index: int, optional + # :return: Returns the result object. + # """ # noqa: E501 + + # _param = self._update_endpoint_bxml_serialize( + # account_id=account_id, + # endpoint_id=endpoint_id, + # body=body, + # _request_auth=_request_auth, + # _content_type=_content_type, + # _headers=_headers, + # _host_index=_host_index + # ) + + # _response_types_map: Dict[str, Optional[str]] = { + # '204': None, + # '400': "ErrorResponse", + # '401': "ErrorResponse", + # '403': "ErrorResponse", + # '404': "ErrorResponse", + # '405': "ErrorResponse", + # '415': "ErrorResponse", + # '429': "ErrorResponse", + # '500': "ErrorResponse", + # } + # response_data = self.api_client.call_api( + # *_param, + # _request_timeout=_request_timeout + # ) + # response_data.read() + # return self.api_client.response_deserialize( + # response_data=response_data, + # response_types_map=_response_types_map, + # ) + + +# @validate_call + # def update_endpoint_bxml_without_preload_content( + # self, + # account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + # endpoint_id: Annotated[StrictStr, Field(description="BRTC Endpoint ID.")], + # body: StrictStr, + # _request_timeout: Union[ + # None, + # Annotated[StrictFloat, Field(gt=0)], + # Tuple[ + # Annotated[StrictFloat, Field(gt=0)], + # Annotated[StrictFloat, Field(gt=0)] + # ] + # ] = None, + # _request_auth: Optional[Dict[StrictStr, Any]] = None, + # _content_type: Optional[StrictStr] = None, + # _headers: Optional[Dict[StrictStr, Any]] = None, + # _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + # ) -> RESTResponseType: + # """Update Endpoint BXML + # + # Updates the BXML for the specified endpoint. + # + # :param account_id: Your Bandwidth Account ID. (required) + # :type account_id: str + # :param endpoint_id: BRTC Endpoint ID. (required) + # :type endpoint_id: str + # :param body: (required) + # :type body: str + # :param _request_timeout: timeout setting for this request. If one + # number provided, it will be total request + # timeout. It can also be a pair (tuple) of + # (connection, read) timeouts. + # :type _request_timeout: int, tuple(int, int), optional + # :param _request_auth: set to override the auth_settings for an a single + # request; this effectively ignores the + # authentication in the spec for a single request. + # :type _request_auth: dict, optional + # :param _content_type: force content-type for the request. + # :type _content_type: str, Optional + # :param _headers: set to override the headers for a single + # request; this effectively ignores the headers + # in the spec for a single request. + # :type _headers: dict, optional + # :param _host_index: set to override the host_index for a single + # request; this effectively ignores the host_index + # in the spec for a single request. + # :type _host_index: int, optional + # :return: Returns the result object. + # """ # noqa: E501 + # + # _param = self._update_endpoint_bxml_serialize( + # account_id=account_id, + # endpoint_id=endpoint_id, + # body=body, + # _request_auth=_request_auth, + # _content_type=_content_type, + # _headers=_headers, + # _host_index=_host_index + # ) + # + # _response_types_map: Dict[str, Optional[str]] = { + # '204': None, + # '400': "ErrorResponse", + # '401': "ErrorResponse", + # '403': "ErrorResponse", + # '404': "ErrorResponse", + # '405': "ErrorResponse", + # '415': "ErrorResponse", + # '429': "ErrorResponse", + # '500': "ErrorResponse", + # } + # response_data = self.api_client.call_api( + # *_param, + # _request_timeout=_request_timeout + # ) + # return response_data.response + # + # + # def _update_endpoint_bxml_serialize( + # self, + # account_id, + # endpoint_id, + # body, + # _request_auth, + # _content_type, + # _headers, + # _host_index, + # ) -> RequestSerialized: + # + # _hosts = [ + # 'https://api.bandwidth.com/v2' + # ] + # _host = _hosts[_host_index] + # + # _collection_formats: Dict[str, str] = { + # } + # + # _path_params: Dict[str, str] = {} + # _query_params: List[Tuple[str, str]] = [] + # _header_params: Dict[str, Optional[str]] = _headers or {} + # _form_params: List[Tuple[str, str]] = [] + # _files: Dict[ + # str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + # ] = {} + # _body_params: Optional[bytes] = None + # + # # process the path parameters + # if account_id is not None: + # _path_params['accountId'] = account_id + # if endpoint_id is not None: + # _path_params['endpointId'] = endpoint_id + # # process the query parameters + # # process the header parameters + # # process the form parameters + # # process the body parameter + # if body is not None: + # _body_params = body + # + # + # # set the HTTP header `Accept` + # if 'Accept' not in _header_params: + # _header_params['Accept'] = self.api_client.select_header_accept( + # [ + # 'application/json' + # ] + # ) + # + # # set the HTTP header `Content-Type` + # if _content_type: + # _header_params['Content-Type'] = _content_type + # else: + # _default_content_type = ( + # self.api_client.select_header_content_type( + # [ + # 'application/xml' + # ] + # ) + # ) + # if _default_content_type is not None: + # _header_params['Content-Type'] = _default_content_type + # + # # authentication setting + # _auth_settings: List[str] = [ + # 'Basic', + # 'OAuth2' + # ] + # + # return self.api_client.param_serialize( + # method='PUT', + # resource_path='/accounts/{accountId}/endpoints/{endpointId}/bxml', + # path_params=_path_params, + # query_params=_query_params, + # header_params=_header_params, + # body=_body_params, + # post_params=_form_params, + # files=_files, + # auth_settings=_auth_settings, + # collection_formats=_collection_formats, + # _host=_host, + # _request_auth=_request_auth + # ) diff --git a/bandwidth/models/create_endpoint_response_object.py b/bandwidth/models/create_endpoint_response_object.py index 8cddb956..5f3c9239 100644 --- a/bandwidth/models/create_endpoint_response_object.py +++ b/bandwidth/models/create_endpoint_response_object.py @@ -33,8 +33,8 @@ class CreateEndpointResponseObject(BaseModel): CreateEndpointResponseObject """ # noqa: E501 endpoint_id: StrictStr = Field(description="The unique ID of the endpoint.", alias="endpointId") - type: EndpointTypeEnum - status: EndpointStatusEnum + type: Optional[EndpointTypeEnum] = None + status: Optional[EndpointStatusEnum] = None creation_timestamp: datetime = Field(description="The time the endpoint was created. In ISO-8601 format.", alias="creationTimestamp") expiration_timestamp: datetime = Field(description="The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours.", alias="expirationTimestamp") tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A tag for the endpoint.") @@ -107,21 +107,26 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _dict = { "endpointId": obj.get("endpointId"), - "type": obj.get("type"), - "status": obj.get("status"), "creationTimestamp": obj.get("creationTimestamp"), "expirationTimestamp": obj.get("expirationTimestamp"), - "tag": obj.get("tag"), - "devices": [Device.from_dict(_item) for _item in obj["devices"]] if obj.get("devices") is not None else None, "token": obj.get("token") - }) + } + # Only add optional fields if they're present + if "type" in obj and obj.get("type") is not None: + _dict["type"] = obj.get("type") + if "status" in obj and obj.get("status") is not None: + _dict["status"] = obj.get("status") + if "tag" in obj: + _dict["tag"] = obj.get("tag") + if "devices" in obj and obj.get("devices") is not None: + _dict["devices"] = [Device.from_dict(_item) for _item in obj["devices"]] + + _obj = cls.model_validate(_dict) # store additional fields in additional_properties for _key in obj.keys(): if _key not in cls.__properties: _obj.additional_properties[_key] = obj.get(_key) return _obj - - diff --git a/bandwidth/models/endpoint.py b/bandwidth/models/endpoint.py index ee70f584..8eda4199 100644 --- a/bandwidth/models/endpoint.py +++ b/bandwidth/models/endpoint.py @@ -33,8 +33,8 @@ class Endpoint(BaseModel): Endpoint """ # noqa: E501 endpoint_id: StrictStr = Field(description="The unique ID of the endpoint.", alias="endpointId") - type: EndpointTypeEnum - status: EndpointStatusEnum + type: Optional[EndpointTypeEnum] = None + status: Optional[EndpointStatusEnum] = None creation_timestamp: datetime = Field(description="The time the endpoint was created. In ISO-8601 format.", alias="creationTimestamp") expiration_timestamp: datetime = Field(description="The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours.", alias="expirationTimestamp") tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A tag for the endpoint.") @@ -106,20 +106,25 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _dict = { "endpointId": obj.get("endpointId"), - "type": obj.get("type"), - "status": obj.get("status"), "creationTimestamp": obj.get("creationTimestamp"), - "expirationTimestamp": obj.get("expirationTimestamp"), - "tag": obj.get("tag"), - "devices": [Device.from_dict(_item) for _item in obj["devices"]] if obj.get("devices") is not None else None - }) + "expirationTimestamp": obj.get("expirationTimestamp") + } + # Only add optional fields if they're present + if "type" in obj and obj.get("type") is not None: + _dict["type"] = obj.get("type") + if "status" in obj and obj.get("status") is not None: + _dict["status"] = obj.get("status") + if "tag" in obj: + _dict["tag"] = obj.get("tag") + if "devices" in obj and obj.get("devices") is not None: + _dict["devices"] = [Device.from_dict(_item) for _item in obj["devices"]] + + _obj = cls.model_validate(_dict) # store additional fields in additional_properties for _key in obj.keys(): if _key not in cls.__properties: _obj.additional_properties[_key] = obj.get(_key) return _obj - - diff --git a/bandwidth/models/endpoint_event.py b/bandwidth/models/endpoint_event.py index 2f7f907d..273dae78 100644 --- a/bandwidth/models/endpoint_event.py +++ b/bandwidth/models/endpoint_event.py @@ -34,8 +34,8 @@ class EndpointEvent(BaseModel): An event that occurred on an endpoint. """ # noqa: E501 endpoint_id: StrictStr = Field(description="The unique ID of the endpoint.", alias="endpointId") - type: EndpointTypeEnum - status: EndpointStatusEnum + type: Optional[EndpointTypeEnum] = None + status: Optional[EndpointStatusEnum] = None creation_timestamp: datetime = Field(description="The time the endpoint was created. In ISO-8601 format.", alias="creationTimestamp") expiration_timestamp: datetime = Field(description="The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours.", alias="expirationTimestamp") tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A tag for the endpoint.") @@ -105,22 +105,27 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _dict = { "endpointId": obj.get("endpointId"), - "type": obj.get("type"), - "status": obj.get("status"), "creationTimestamp": obj.get("creationTimestamp"), "expirationTimestamp": obj.get("expirationTimestamp"), - "tag": obj.get("tag"), "eventTime": obj.get("eventTime"), - "eventType": obj.get("eventType"), - "device": Device.from_dict(obj["device"]) if obj.get("device") is not None else None - }) + "eventType": obj.get("eventType") + } + # Only add optional fields if they're present + if "type" in obj and obj.get("type") is not None: + _dict["type"] = obj.get("type") + if "status" in obj and obj.get("status") is not None: + _dict["status"] = obj.get("status") + if "tag" in obj: + _dict["tag"] = obj.get("tag") + if "device" in obj and obj.get("device") is not None: + _dict["device"] = Device.from_dict(obj["device"]) + + _obj = cls.model_validate(_dict) # store additional fields in additional_properties for _key in obj.keys(): if _key not in cls.__properties: _obj.additional_properties[_key] = obj.get(_key) return _obj - - diff --git a/bandwidth/models/endpoints.py b/bandwidth/models/endpoints.py index 57097750..a2323888 100644 --- a/bandwidth/models/endpoints.py +++ b/bandwidth/models/endpoints.py @@ -32,8 +32,8 @@ class Endpoints(BaseModel): Endpoints """ # noqa: E501 endpoint_id: StrictStr = Field(description="The unique ID of the endpoint.", alias="endpointId") - type: EndpointTypeEnum - status: EndpointStatusEnum + type: Optional[EndpointTypeEnum] = None + status: Optional[EndpointStatusEnum] = None creation_timestamp: datetime = Field(description="The time the endpoint was created. In ISO-8601 format.", alias="creationTimestamp") expiration_timestamp: datetime = Field(description="The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours.", alias="expirationTimestamp") tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A tag for the endpoint.") @@ -97,19 +97,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _dict = { "endpointId": obj.get("endpointId"), - "type": obj.get("type"), - "status": obj.get("status"), "creationTimestamp": obj.get("creationTimestamp"), - "expirationTimestamp": obj.get("expirationTimestamp"), - "tag": obj.get("tag") - }) + "expirationTimestamp": obj.get("expirationTimestamp") + } + # Only add optional fields if they're present + if "type" in obj and obj.get("type") is not None: + _dict["type"] = obj.get("type") + if "status" in obj and obj.get("status") is not None: + _dict["status"] = obj.get("status") + if "tag" in obj: + _dict["tag"] = obj.get("tag") + + _obj = cls.model_validate(_dict) # store additional fields in additional_properties for _key in obj.keys(): if _key not in cls.__properties: _obj.additional_properties[_key] = obj.get(_key) return _obj - - diff --git a/bandwidth/models/error_response.py b/bandwidth/models/error_response.py index 9058ff78..ccabd56f 100644 --- a/bandwidth/models/error_response.py +++ b/bandwidth/models/error_response.py @@ -29,9 +29,9 @@ class ErrorResponse(BaseModel): """ ErrorResponse """ # noqa: E501 - links: List[Link] - data: Optional[Dict[str, Any]] - errors: List[Error] + links: Optional[List[Link]] = None + data: Optional[Dict[str, Any]] = None + errors: Optional[List[Error]] = None additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["links", "data", "errors"] @@ -111,16 +111,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "links": [Link.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, - "data": obj.get("data"), - "errors": [Error.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None - }) + _dict = {} + if "links" in obj and obj.get("links") is not None: + _dict["links"] = [Link.from_dict(_item) for _item in obj["links"]] + if "data" in obj: + _dict["data"] = obj.get("data") + if "errors" in obj and obj.get("errors") is not None: + _dict["errors"] = [Error.from_dict(_item) for _item in obj["errors"]] + + _obj = cls.model_validate(_dict) # store additional fields in additional_properties for _key in obj.keys(): if _key not in cls.__properties: _obj.additional_properties[_key] = obj.get(_key) return _obj - - From defaa706a1343294ff49130165f3ac889f61e6dd Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Thu, 15 Jan 2026 17:41:13 -0500 Subject: [PATCH 07/10] Comment out the test_update_endpoint_bxml method as the Endpoint BXML is not ready yet --- test/unit/api/test_endpoints_api.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/test/unit/api/test_endpoints_api.py b/test/unit/api/test_endpoints_api.py index a3d744bd..39f02551 100644 --- a/test/unit/api/test_endpoints_api.py +++ b/test/unit/api/test_endpoints_api.py @@ -150,20 +150,21 @@ def test_list_endpoints_with_pagination(self) -> None: assert_that(response.data.data, instance_of(list)) assert_that(response.data.errors, instance_of(list)) - def test_update_endpoint_bxml(self) -> None: - """Test case for update_endpoint_bxml - - Update Endpoint BXML - """ - update_bxml = 'This is a test bxml response for endpoint' - - response = self.endpoints_api_instance.update_endpoint_bxml_with_http_info( - BW_ACCOUNT_ID, - "ep-abc123", - update_bxml - ) - - assert_that(response.status_code, equal_to(204)) + # Endpoint BXML not ready yet - commented out + # def test_update_endpoint_bxml(self) -> None: + # """Test case for update_endpoint_bxml + # + # Update Endpoint BXML + # """ + # update_bxml = 'This is a test bxml response for endpoint' + # + # response = self.endpoints_api_instance.update_endpoint_bxml_with_http_info( + # BW_ACCOUNT_ID, + # "ep-abc123", + # update_bxml + # ) + # + # assert_that(response.status_code, equal_to(204)) def test_create_endpoint_minimal(self) -> None: """Test case for create_endpoint with minimal required fields From 1aab9c3701e9e82c708b9fae4d354b059a61460b Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Fri, 16 Jan 2026 10:38:27 -0500 Subject: [PATCH 08/10] Add TODO comment for test_update_endpoint_bxml indicating BXML is not ready yet --- test/unit/api/test_endpoints_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/api/test_endpoints_api.py b/test/unit/api/test_endpoints_api.py index 39f02551..84829def 100644 --- a/test/unit/api/test_endpoints_api.py +++ b/test/unit/api/test_endpoints_api.py @@ -150,7 +150,7 @@ def test_list_endpoints_with_pagination(self) -> None: assert_that(response.data.data, instance_of(list)) assert_that(response.data.errors, instance_of(list)) - # Endpoint BXML not ready yet - commented out + # TODO: Endpoint BXML not ready yet - commented out # def test_update_endpoint_bxml(self) -> None: # """Test case for update_endpoint_bxml # From ca38a724b6c1771119597d9f4324344030d851e9 Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Fri, 16 Jan 2026 10:50:17 -0500 Subject: [PATCH 09/10] Update authentication method in TestEndpointsApi to use username and password --- test/smoke/test_endpoints_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/smoke/test_endpoints_api.py b/test/smoke/test_endpoints_api.py index 65714080..59b038f6 100644 --- a/test/smoke/test_endpoints_api.py +++ b/test/smoke/test_endpoints_api.py @@ -25,8 +25,8 @@ class TestEndpointsApi(unittest.TestCase): @classmethod def setUpClass(cls) -> None: configuration = Configuration( - client_id=BW_CLIENT_ID, - client_secret=BW_CLIENT_SECRET + username=BW_USERNAME, + password=BW_PASSWORD ) api_client = ApiClient(configuration) cls.endpoints_api_instance = EndpointsApi(api_client) From 2214e43fbdfd8cce835a3af4359b693df2d7eafc Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Fri, 16 Jan 2026 11:45:26 -0500 Subject: [PATCH 10/10] Add missing newline after endpoint creation in TestEndpointsApi --- test/smoke/test_endpoints_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/smoke/test_endpoints_api.py b/test/smoke/test_endpoints_api.py index 59b038f6..3e55c99b 100644 --- a/test/smoke/test_endpoints_api.py +++ b/test/smoke/test_endpoints_api.py @@ -128,6 +128,7 @@ def test_get_endpoint(self): self.account_id, create_request ) + endpoint_id = create_response.data.endpoint_id self.endpoint_id_array.append(endpoint_id)