Skip to content

Bandwidth/ruby-sdk

Repository files navigation

bandwidth-sdk

Gem Version Tests Ruby Style Guide

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

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: 1.0.0-dev
  • 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-1.0.0-dev.gem

(for development, run gem install --dev ./bandwidth-sdk-1.0.0-dev.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', '~> 1.0.0-dev'

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: '+15555551212', 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_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 delete_recording_transcription DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Delete Transcription
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_recording_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
Bandwidth::TranscriptionsApi delete_real_time_transcription DELETE /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} Delete a specific transcription
Bandwidth::TranscriptionsApi get_real_time_transcription GET /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} Retrieve a specific transcription
Bandwidth::TranscriptionsApi list_real_time_transcriptions GET /accounts/{accountId}/calls/{callId}/transcriptions Enumerate transcriptions made with StartTranscription

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

Basic

  • Type: HTTP basic authentication