Giter VIP home page Giter VIP logo

csharp-sdk's Introduction

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
  • 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

csharp-sdk's People

Contributors

ajrice6713 avatar brianluisgomez avatar bw-mot avatar ckoegel avatar dx-bandwidth avatar hamermike avatar jmulford-bw avatar juliajanu avatar mmcdonald-bw avatar noahg1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csharp-sdk's Issues

Phone dialer sample (C# desktop or web based)

Do you guys have an example of desktop phone dialer (with ability to make a phone call), or might be a web-based phone dialer (can be embedded to the WebView2 control)?

We just want to implement following scenario for our business needs:

  • start a silent call (no dial tones, dial rings etc.)
  • monitor call status (dialing, connected etc.)
  • if voicemail or answering machine detected, end this call and set a call status or return a code
  • if human detected, continue voice call
  • will be good to have ability to control call programmatically (hung up, transfer, put on hold etc.)

Pretty simple and useful scenario, isn't it? But we still can't find a proper service for that simple scenario ๐Ÿ˜ข - it looks like nobody implemented that.

Proper way to use SSML with SpeakSentence?

Trying to do some basic SSML stuff with text-to-speech and I'm encountering issues.

Dim speakSentenceCommand As New SpeakSentence With {
	.Gender = "female",
	.Locale = "en_US",
	.Voice = "julie",
	.Sentence = "Hello <p> Test"
}
Return New Response(speakSentenceCommand).ToBXML()

This results in nothing being spoken at all, and a callback barking about invalid BXML.
If I remove the <p>, it works fine. The same happens for other SSML like <say-as>.
Is there a different way I should be passing SSML through the SDK?

[BUG] How to load image inside the smil. I am interested in saving the image to my azure server.

here is my code

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

   var apiInstance = new MediaApi(config);
   var accountId = "XXXXXXXX";  // string | Your Bandwidth Account ID.
   var mediaId = "XXXXXXXXXXXX/0/123_1.smil";  // string | Media ID to retrieve.

   try
   {
       // Get Media
       var result = apiInstance.GetMediaWithHttpInfo(accountId, mediaId);
       Debug.WriteLine(result);
   }
   catch (ApiException  e)
   {
       Debug.Print("Exception when calling MediaApi.GetMedia: " + e.Message);
       Debug.Print("Status Code: " + e.ErrorCode);
       Debug.Print(e.StackTrace);
   }
  
    

i am able to get the smil file. here is the content of the smil file.

<smil>
<head>
<layout>
 <root-layout/>
<region id="Text" top="70%" left="0%" height="30%" width="100%" fit="scroll"/>
<region id="Image" top="0%" left="0%" height="70%" width="100%" fit="meet"/>
</layout>
</head>
<body>
<par dur="10s">
<img src="IMG_20190.jpg" region="Image"/>
</par>
</body>
</smil>

How can i get the IMG_20190.jpg in the C# code as stream.

Bandwidth.Standard.Voice.Models.CallCallback does not define parameters for machineDetectionComplete event

Bandwidth.Standard.Voice.Models.CallCallback does not seem to have the machineDetectionResult or it's children.
https://github.com/Bandwidth/csharp-sdk/blob/cbb3c9f48c2aec10fdc985ddb4edc5283a6ca5c0/Bandwidth.Standard/Voice/Models/CallCallback.cs

This prevents properly deserializing the machineDetectionComplete webhooks into a CallCallback object.
As a workaround I'm parsing the webhook JSON manually.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.