0.04
The project is in a healthy, maintained state
The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.6, >= 3.6.0

Runtime

>= 1.0.1, < 3.0
~> 2.4
 Project Readme

bandwidth-sdk

Gem Version Tests Ruby Style Guide

OS Ruby
Windows 2019 2.7, 3.0, 3.1, 3.2
Windows 2022 2.7, 3.0, 3.1, 3.2
Ubuntu 20.04 2.7, 3.0, 3.1, 3.2
Ubuntu 22.04 2.7, 3.0, 3.1, 3.2

Bandwidth - the Ruby gem for the Bandwidth SDK

Generated with the command:

openapi-generator generate -g ruby -i bandwidth.yml -c openapi-config.yml -o ./

Bandwidth's Communication APIs

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 11.0.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://dev.bandwidth.com

Installation

Install from RubyGems

gem install bandwidth-sdk

Build a gem

To build the Ruby code into a gem:

gem build bandwidth-sdk.gemspec

Then either install the gem locally:

gem install ./bandwidth-sdk-11.0.0.gem

(for development, run gem install --dev ./bandwidth-sdk-11.0.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'bandwidth-sdk', '~> 11.0.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'bandwidth-sdk', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'bandwidth-sdk'

# Setup authorization
Bandwidth.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR_USERNAME'
  config.password = 'YOUR_PASSWORD'
  # Configure faraday connection
  config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
end

api_instance = Bandwidth::CallsApi.new
account_id = '9900000' # String | Your Bandwidth Account ID.
create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+19195554321', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.example/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call

begin
  #Create Call
  result = api_instance.create_call(account_id, create_call)
  p result
rescue Bandwidth::ApiError => e
  puts "Exception when calling CallsApi->create_call: #{e}"
end

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
Bandwidth::CallsApi create_call POST /accounts/{accountId}/calls Create Call
Bandwidth::CallsApi get_call_state GET /accounts/{accountId}/calls/{callId} Get Call State Information
Bandwidth::CallsApi list_calls GET /accounts/{accountId}/calls Get Calls
Bandwidth::CallsApi update_call POST /accounts/{accountId}/calls/{callId} Update Call
Bandwidth::CallsApi update_call_bxml PUT /accounts/{accountId}/calls/{callId}/bxml Update Call BXML
Bandwidth::ConferencesApi download_conference_recording GET /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media Download Conference Recording
Bandwidth::ConferencesApi get_conference GET /accounts/{accountId}/conferences/{conferenceId} Get Conference Information
Bandwidth::ConferencesApi get_conference_member GET /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} Get Conference Member
Bandwidth::ConferencesApi get_conference_recording GET /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId} Get Conference Recording Information
Bandwidth::ConferencesApi list_conference_recordings GET /accounts/{accountId}/conferences/{conferenceId}/recordings Get Conference Recordings
Bandwidth::ConferencesApi list_conferences GET /accounts/{accountId}/conferences Get Conferences
Bandwidth::ConferencesApi update_conference POST /accounts/{accountId}/conferences/{conferenceId} Update Conference
Bandwidth::ConferencesApi update_conference_bxml PUT /accounts/{accountId}/conferences/{conferenceId}/bxml Update Conference BXML
Bandwidth::ConferencesApi update_conference_member PUT /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} Update Conference Member
Bandwidth::MFAApi generate_messaging_code POST /accounts/{accountId}/code/messaging Messaging Authentication Code
Bandwidth::MFAApi generate_voice_code POST /accounts/{accountId}/code/voice Voice Authentication Code
Bandwidth::MFAApi verify_code POST /accounts/{accountId}/code/verify Verify Authentication Code
Bandwidth::MediaApi delete_media DELETE /users/{accountId}/media/{mediaId} Delete Media
Bandwidth::MediaApi get_media GET /users/{accountId}/media/{mediaId} Get Media
Bandwidth::MediaApi list_media GET /users/{accountId}/media List Media
Bandwidth::MediaApi upload_media PUT /users/{accountId}/media/{mediaId} Upload Media
Bandwidth::MessagesApi create_message POST /users/{accountId}/messages Create Message
Bandwidth::MessagesApi list_messages GET /users/{accountId}/messages List Messages
Bandwidth::PhoneNumberLookupApi create_lookup POST /accounts/{accountId}/tnlookup Create Lookup
Bandwidth::PhoneNumberLookupApi get_lookup_status GET /accounts/{accountId}/tnlookup/{requestId} Get Lookup Request Status
Bandwidth::RecordingsApi delete_call_transcription DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Delete Transcription
Bandwidth::RecordingsApi delete_recording DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId} Delete Recording
Bandwidth::RecordingsApi delete_recording_media DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media Delete Recording Media
Bandwidth::RecordingsApi download_call_recording GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media Download Recording
Bandwidth::RecordingsApi get_call_recording GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId} Get Call Recording
Bandwidth::RecordingsApi get_call_transcription GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Get Transcription
Bandwidth::RecordingsApi list_account_call_recordings GET /accounts/{accountId}/recordings Get Call Recordings
Bandwidth::RecordingsApi list_call_recordings GET /accounts/{accountId}/calls/{callId}/recordings List Call Recordings
Bandwidth::RecordingsApi transcribe_call_recording POST /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Create Transcription Request
Bandwidth::RecordingsApi update_call_recording_state PUT /accounts/{accountId}/calls/{callId}/recording Update Recording
Bandwidth::StatisticsApi get_statistics GET /accounts/{accountId}/statistics Get Account Statistics

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

Basic

  • Type: HTTP basic authentication