Skip to content

Bandwidth/csharp-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bandwidth.Standard - the C# library for the Bandwidth

Bandwidth's Communication APIs

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • SDK version: 1.0.0-dev
  • Generator version: 7.7.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit https://dev.bandwidth.com

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Generate the DLL using your preferred tool (e.g. dotnet build)

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Bandwidth.Standard.Api;
using Bandwidth.Standard.Client;
using Bandwidth.Standard.Model;

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using Bandwidth.Standard.Api;
using Bandwidth.Standard.Client;
using Bandwidth.Standard.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            // Configure HTTP basic authorization: Basic
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new CallsApi(config);
            var accountId = 9900000;  // string | Your Bandwidth Account ID.
            var createCall = new CreateCall(); // CreateCall | JSON object containing information to create an outbound call

            try
            {
                // Create Call
                CreateCallResponse result = apiInstance.CreateCall(accountId, createCall);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling CallsApi.CreateCall: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
CallsApi CreateCall POST /accounts/{accountId}/calls Create Call
CallsApi GetCallState GET /accounts/{accountId}/calls/{callId} Get Call State Information
CallsApi ListCalls GET /accounts/{accountId}/calls Get Calls
CallsApi UpdateCall POST /accounts/{accountId}/calls/{callId} Update Call
CallsApi UpdateCallBxml PUT /accounts/{accountId}/calls/{callId}/bxml Update Call BXML
ConferencesApi DownloadConferenceRecording GET /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media Download Conference Recording
ConferencesApi GetConference GET /accounts/{accountId}/conferences/{conferenceId} Get Conference Information
ConferencesApi GetConferenceMember GET /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} Get Conference Member
ConferencesApi GetConferenceRecording GET /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId} Get Conference Recording Information
ConferencesApi ListConferenceRecordings GET /accounts/{accountId}/conferences/{conferenceId}/recordings Get Conference Recordings
ConferencesApi ListConferences GET /accounts/{accountId}/conferences Get Conferences
ConferencesApi UpdateConference POST /accounts/{accountId}/conferences/{conferenceId} Update Conference
ConferencesApi UpdateConferenceBxml PUT /accounts/{accountId}/conferences/{conferenceId}/bxml Update Conference BXML
ConferencesApi UpdateConferenceMember PUT /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} Update Conference Member
MFAApi GenerateMessagingCode POST /accounts/{accountId}/code/messaging Messaging Authentication Code
MFAApi GenerateVoiceCode POST /accounts/{accountId}/code/voice Voice Authentication Code
MFAApi VerifyCode POST /accounts/{accountId}/code/verify Verify Authentication Code
MediaApi DeleteMedia DELETE /users/{accountId}/media/{mediaId} Delete Media
MediaApi GetMedia GET /users/{accountId}/media/{mediaId} Get Media
MediaApi ListMedia GET /users/{accountId}/media List Media
MediaApi UploadMedia PUT /users/{accountId}/media/{mediaId} Upload Media
MessagesApi CreateMessage POST /users/{accountId}/messages Create Message
MessagesApi ListMessages GET /users/{accountId}/messages List Messages
PhoneNumberLookupApi CreateLookup POST /accounts/{accountId}/tnlookup Create Lookup
PhoneNumberLookupApi GetLookupStatus GET /accounts/{accountId}/tnlookup/{requestId} Get Lookup Request Status
RecordingsApi DeleteRecording DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId} Delete Recording
RecordingsApi DeleteRecordingMedia DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media Delete Recording Media
RecordingsApi DeleteRecordingTranscription DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Delete Transcription
RecordingsApi DownloadCallRecording GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media Download Recording
RecordingsApi GetCallRecording GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId} Get Call Recording
RecordingsApi GetRecordingTranscription GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Get Transcription
RecordingsApi ListAccountCallRecordings GET /accounts/{accountId}/recordings Get Call Recordings
RecordingsApi ListCallRecordings GET /accounts/{accountId}/calls/{callId}/recordings List Call Recordings
RecordingsApi TranscribeCallRecording POST /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Create Transcription Request
RecordingsApi UpdateCallRecordingState PUT /accounts/{accountId}/calls/{callId}/recording Update Recording
StatisticsApi GetStatistics GET /accounts/{accountId}/statistics Get Account Statistics
TranscriptionsApi DeleteRealTimeTranscription DELETE /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} Delete a specific transcription
TranscriptionsApi GetRealTimeTranscription GET /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} Retrieve a specific transcription
TranscriptionsApi ListRealTimeTranscriptions 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