Skip to content

Repository files navigation

bandwidth-sdk

Deploy

OSNode
Windows 202218, 20, 22, 24
Windows 202518, 20, 22, 24
Ubuntu 22.0418, 20, 22, 24
Ubuntu 24.0418, 20, 22, 24

Available on NPM

npm install bandwidth-sdk

To Run Unit Tests Locally

  1. Install Prism
npm install -g @stoplight/prism-cli
  1. Start Prism Mock Server with the OpenAPI Spec
prism mock bandwidth.yml
  1. Run Tests
npm run test-unit

This generator creates TypeScript/JavaScript client that utilizes axios. The generated Node module can be used in the following environments:

Environment

  • Node.js
  • Webpack
  • Browserify

Language level

  • ES5 - you must have a Promises/A+ library installed
  • ES6

Module system

  • CommonJS
  • ES6 module system

It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via package.json. (Reference)

Building

To build and compile the typescript sources to javascript use:

npm install
npm run build

Publishing

First build the package then run npm publish

Consuming

navigate to the folder of your consuming project and run one of the following commands.

published:

npm install bandwidth-sdk --save

unPublished (not recommended):

npm install PATH_TO_GENERATED_PACKAGE --save

Getting Started

The following is a simple example of how to use this module:

import{CallsApi,Configuration}from'bandwidth-sdk';constconfig=newConfiguration({clientId: BW_CLIENT_ID,clientSecret: BW_CLIENT_SECRET});constcallsApi=newCallsApi(config);constbody={applicationId: BW_VOICE_APPLICATION_ID,to: TO_NUMBER,from: BW_NUMBER};awaitcallsApi.createCall(BW_ACCOUNT_ID,body);

More samples can be found in the Bandwidth Samples GitHub Organization.

Documentation for API Endpoints

All URIs are relative to http://localhost

ClassMethodHTTP requestDescription
CallsApicreateCallPOST /accounts/{accountId}/callsCreate Call
CallsApigetCallStateGET /accounts/{accountId}/calls/{callId}Get Call State Information
CallsApilistCallsGET /accounts/{accountId}/callsGet Calls
CallsApiupdateCallPOST /accounts/{accountId}/calls/{callId}Update Call
CallsApiupdateCallBxmlPUT /accounts/{accountId}/calls/{callId}/bxmlUpdate Call BXML
ConferencesApidownloadConferenceRecordingGET /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/mediaDownload Conference Recording
ConferencesApigetConferenceGET /accounts/{accountId}/conferences/{conferenceId}Get Conference Information
ConferencesApigetConferenceMemberGET /accounts/{accountId}/conferences/{conferenceId}/members/{memberId}Get Conference Member
ConferencesApigetConferenceRecordingGET /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}Get Conference Recording Information
ConferencesApilistConferenceRecordingsGET /accounts/{accountId}/conferences/{conferenceId}/recordingsGet Conference Recordings
ConferencesApilistConferencesGET /accounts/{accountId}/conferencesGet Conferences
ConferencesApiupdateConferencePOST /accounts/{accountId}/conferences/{conferenceId}Update Conference
ConferencesApiupdateConferenceBxmlPUT /accounts/{accountId}/conferences/{conferenceId}/bxmlUpdate Conference BXML
ConferencesApiupdateConferenceMemberPUT /accounts/{accountId}/conferences/{conferenceId}/members/{memberId}Update Conference Member
EndpointsApicreateEndpointPOST /accounts/{accountId}/endpointsCreate Endpoint
EndpointsApideleteEndpointDELETE /accounts/{accountId}/endpoints/{endpointId}Delete Endpoint
EndpointsApigetEndpointGET /accounts/{accountId}/endpoints/{endpointId}Get Endpoint
EndpointsApilistEndpointsGET /accounts/{accountId}/endpointsList Endpoints
EndpointsApiupdateEndpointBxmlPUT /accounts/{accountId}/endpoints/{endpointId}/bxmlUpdate Endpoint BXML
MFAApigenerateMessagingCodePOST /accounts/{accountId}/code/messagingMessaging Authentication Code
MFAApigenerateVoiceCodePOST /accounts/{accountId}/code/voiceVoice Authentication Code
MFAApiverifyCodePOST /accounts/{accountId}/code/verifyVerify Authentication Code
MediaApideleteMediaDELETE /users/{accountId}/media/{mediaId}Delete Media
MediaApigetMediaGET /users/{accountId}/media/{mediaId}Get Media
MediaApilistMediaGET /users/{accountId}/mediaList Media
MediaApiuploadMediaPUT /users/{accountId}/media/{mediaId}Upload Media
MessagesApicreateMessagePOST /users/{accountId}/messagesCreate Message
MessagesApilistMessagesGET /users/{accountId}/messagesList Messages
MultiChannelApicreateMultiChannelMessagePOST /users/{accountId}/messages/multiChannelCreate Multi-Channel Message
PhoneNumberLookupApicreateAsyncBulkLookupPOST /accounts/{accountId}/phoneNumberLookup/bulkCreate Asynchronous Bulk Number Lookup
PhoneNumberLookupApicreateSyncLookupPOST /accounts/{accountId}/phoneNumberLookupCreate Synchronous Number Lookup
PhoneNumberLookupApigetAsyncBulkLookupGET /accounts/{accountId}/phoneNumberLookup/bulk/{requestId}Get Asynchronous Bulk Number Lookup
RecordingsApideleteRecordingDELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}Delete Recording
RecordingsApideleteRecordingMediaDELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/mediaDelete Recording Media
RecordingsApideleteRecordingTranscriptionDELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcriptionDelete Transcription
RecordingsApidownloadCallRecordingGET /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/mediaDownload Recording
RecordingsApigetCallRecordingGET /accounts/{accountId}/calls/{callId}/recordings/{recordingId}Get Call Recording
RecordingsApigetRecordingTranscriptionGET /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcriptionGet Transcription
RecordingsApilistAccountCallRecordingsGET /accounts/{accountId}/recordingsGet Call Recordings
RecordingsApilistCallRecordingsGET /accounts/{accountId}/calls/{callId}/recordingsList Call Recordings
RecordingsApitranscribeCallRecordingPOST /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcriptionCreate Transcription Request
RecordingsApiupdateCallRecordingStatePUT /accounts/{accountId}/calls/{callId}/recordingUpdate Recording
StatisticsApigetStatisticsGET /accounts/{accountId}/statisticsGet Account Statistics
TollFreeVerificationApicreateWebhookSubscriptionPOST /accounts/{accountId}/tollFreeVerification/webhooks/subscriptionsCreate Webhook Subscription
TollFreeVerificationApideleteVerificationRequestDELETE /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerificationDelete a Toll-Free Verification Submission
TollFreeVerificationApideleteWebhookSubscriptionDELETE /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}Delete Webhook Subscription
TollFreeVerificationApigetTollFreeVerificationStatusGET /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerificationGet Toll-Free Verification Status
TollFreeVerificationApilistTollFreeUseCasesGET /tollFreeVerification/useCasesList Toll-Free Use Cases
TollFreeVerificationApilistWebhookSubscriptionsGET /accounts/{accountId}/tollFreeVerification/webhooks/subscriptionsList Webhook Subscriptions
TollFreeVerificationApirequestTollFreeVerificationPOST /accounts/{accountId}/tollFreeVerificationRequest Toll-Free Verification
TollFreeVerificationApiupdateTollFreeVerificationRequestPUT /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerificationUpdate Toll-Free Verification Request
TollFreeVerificationApiupdateWebhookSubscriptionPUT /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}Update Webhook Subscription
TranscriptionsApideleteRealTimeTranscriptionDELETE /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}Delete Real-time Transcription
TranscriptionsApigetRealTimeTranscriptionGET /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}Get Real-time Transcription
TranscriptionsApilistRealTimeTranscriptionsGET /accounts/{accountId}/calls/{callId}/transcriptionsList Real-time Transcriptions

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

Basic

  • Type: HTTP basic authentication

OAuth2

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes: N/A

About

Bandwidth TypeScript Node SDK

Topics

Resources

Stars

4 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages