Code Monkey home page Code Monkey logo

twilio-csharp's Introduction

twilio-csharp

Test Quality Gate Status NuGet Learn with TwilioQuest

Twilio REST API and TwiML Libraries for .NET

Twilio provides a HTTP-based API for sending and receiving phone calls and text messages. Learn more on twilio.com.

More documentation for this library can be found here.

Versions

twilio-csharp uses a modified version of Semantic Versioning for all changes. See this document for details.

Migrate from earlier versions

See the migration guide here. Also, if you were using the Twilio.Mvc package, that has been replaced by the Twilio.AspNet.Mvc package which is compatible with this version of the library.

TLS 1.2 Requirements

New accounts and subaccounts are now required to use TLS 1.2 when accessing the REST API. "Upgrade Required" errors indicate that TLS 1.0/1.1 is being used. With .NET, you can enable TLS 1.2 using this setting:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

Supported .NET versions

This library supports .NET applications that utilize .NET6+.

Installation

The best and easiest way to add the Twilio libraries to your .NET project is to use the NuGet package manager.

With Visual Studio IDE

From within Visual Studio, you can use the NuGet GUI to search for and install the Twilio NuGet package. Or, as a shortcut, simply type the following command into the Package Manager Console:

Install-Package Twilio

With .NET Core Command Line Tools

If you are building with the .NET Core command line tools, then you can run the following command from within your project directory:

dotnet add package Twilio

Sample usage

The examples below show how to have your application initiate and outbound phone call and send an SMS message using the Twilio .NET helper library:

TwilioClient.Init("ACCOUNT_SID", "AUTH_TOKEN");

var call = CallResource.Create(
    new PhoneNumber("+11234567890"),
    from: new PhoneNumber("+10987654321"),
    url: new Uri("https://my.twiml.here")
);
Console.WriteLine(call.Sid);

var message = MessageResource.Create(
    new PhoneNumber("+11234567890"),
    from: new PhoneNumber("+10987654321"),
    body: "Hello World!"
);
Console.WriteLine(message.Sid);

Specify Region and/or Edge

To take advantage of Twilio's Global Infrastructure, specify the target Region and/or Edge for the client:

TwilioClient.SetRegion("au1");
TwilioClient.SetEdge("sydney");

This will result in the hostname transforming from api.twilio.com to api.sydney.au1.twilio.com.

Enable debug logging

There are two ways to enable debug logging in the default HTTP client. You can create an environment variable called TWILIO_LOG_LEVEL and set it to debug or you can set the LogLevel variable on the client as debug:

TwilioClient.SetLogLevel("debug");

Handle exceptions

For an example on how to handle exceptions in this helper library, please see the Twilio documentation.

Generate TwiML

To control phone calls, your application needs to output TwiML.

// TwiML classes can be created as standalone elements
var gather = new Gather(numDigits: 1, action: new Uri("hello-monkey-handle-key.cshtml"), method: HttpMethod.Post)
    .Say("To speak to a real monkey, press 1. Press 2 to record your own monkey howl. Press any other key to start over.");

// Attributes can be set directly on the object
gather.Timeout = 100;
gather.MaxSpeechTime = 200

// Arbitrary attributes can be set by calling set/getOption
var dial = new Dial().SetOption("myAttribute", 200)
                     .SetOption("newAttribute", false);

// Or can be created and attached to a response directly using helper methods
var response = new VoiceResponse()
    .Say("Hello Monkey")
    .Play(new Uri("http://demo.twilio.com/hellomonkey/monkey.mp3"))
    .Append(gather)
    .Append(dial);

// Serialize the TwiML objects to XML string
Console.WriteLine(response);

/*
<?xml version="1.0" encoding="utf-8"?>
<Response>
  <Say>Hello Monkey</Say>
  <Play>http://demo.twilio.com/hellomonkey/monkey.mp3</Play>
  <Gather numDigits="1" action="hello-monkey-handle-key.cshtml" method="POST" timeout="100" maxSpeechTime="200">
    <Say>To speak to a real monkey, press 1. Press 2 to record your own monkey howl. Press any other key to start over.</Say>
  </Gather>
  <Dial myAttribute="200" newAttribute="false"></Dial>
</Response>
*/

Use a custom HTTP Client

To use a custom HTTP client with this helper library, please see the advanced example of how to do so.

Docker Image

The Dockerfile present in this repository and its respective twilio/twilio-csharp Docker image are used by Twilio for testing purposes.

You could use the docker image for building and running tests:

docker build -t twiliobuild .

Bash:

docker run -it --rm -v $(pwd):/twilio twiliobuild
make test

Powershell:

docker run -it --rm -v ${PWD}:/twilio twiliobuild
make test

Get support

If you need help installing or using the library, please check the Twilio Support Help Center first, and file a support ticket if you don't find an answer to your question.

If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!

twilio-csharp's People

Contributors

alexpayment avatar asabuhere avatar carlosdp avatar childish-sambino avatar cjcodes avatar claudiachua avatar codejudas avatar dprothero avatar eshanholtz avatar falguniv avatar ilanbiala avatar jbonner89 avatar jennifermah avatar jingming avatar jmctwilio avatar joelmartinez avatar johnsheehan avatar jwitz10 avatar marcusber avatar matthewsteeples avatar mplacona avatar ragil avatar sbansla avatar shwetha-manvinkurke avatar skimbrel avatar swimburger avatar thinkingserious avatar tiwarishubham635 avatar twilio-ci avatar twilio-dx avatar

Stargazers

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

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

twilio-csharp's Issues

Error with RestSharp version

I'm a newbie. I just did a brand new install of Twilio helper as instructed in the Readme file. It installed fine but when I try the example given I get the following error. The RestSharp version that it installed automatically as a dependency was 102.6 but the Twilio helper wants to use 102.5 and can't find it. When I try to install the 102.5 version it complains that a newer version is available. When I try to uninstall the newer version it says that the Twilio helper has a dependency on it. So I'm a little stuck. Any help is much appreciated.

System.IO.FileNotFoundException : Could not load file or assembly 'RestSharp, Version=102.5.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

I'm using Twilio 3.3.2

ValidationRequestResult param should be optional

Per the docs method signature should be: ValidationRequestResult AddOutgoingCallerId (phoneNumber, friendlyName, callDelay)

From OutgoingCallerIds.cs there is a required fourth param:

public ValidationRequestResult AddOutgoingCallerId(string phoneNumber, string friendlyName, int? callDelay, string extension)

Please make extension optional to preserve compatibility.

StatusCallbackUrl incorrectly named in parameters for IncomingPhoneNumbers

When calling AddIncomingPhoneNumber and passing the StatusCallback URL, the request is built with an incorrect parameter. The parameter is called StatusCallbackUrl, while the documentation says it should be simple "StatusCallback".

Line 152 of IncomingPhoneNumbers.Async.cs should read:

if (options.StatusCallback.HasValue()) request.AddParameter("StatusCallback", options.StatusCallback);

Problem in accessing Capability API

"Could not load file or assembly 'Newtonsoft.Json.Net35, Version=4.0.2.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json.Net35, Version=4.0.2.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified."

Rest of the API is working fine.

Monotouch Project compile errors

I downloaded the project and opened in MonoDevelop - I run into missing files (Notification.Async.cs) but there is one in the Silverlight folder, added that and removed the bad reference.

On compile I get a missing reference to: OutgoingCallerIdOptions. Found that and added a link.

Then the compile worked!

AddApplication with one argument will always fail

The signature for AddApplication looks like this:

        public Application AddApplication(ApplicationOptions options)
        {
            var request = new RestRequest(Method.POST);
            request.Resource = "Accounts/{AccountSid}/Applications.json";

            Require.Argument("FriendlyName", options.FriendlyName);

This will always fail because the ApplicationOptions object has no FriendlyName.

Add a WP7 "Mango" release to the project and the NuGet package

Now that WP7 "Mango" is officially supported by Microsoft, I think there needs to be a version specific to that version of WP7. Specifically, Mango now supports HTTP Compression (through 3rd party libraries), and it would be nice if the Mango version has compression automatically turned on to save data.

I realize you might have to make this change specifically in RestSharp, so it may not be appropriate to log here. But it would be extremely useful nonetheless.

Make it easier to purchase phone numbers

Currently the flow looks something like:

  • Create a search. This involves:
  • creating a AvailablePhoneNumberListRequest option list, and
  • passing this as a parameter to ListAvailableLocalPhoneNumbers.

Then when you have a result, you have to

  • filter it to figure out which number you want to purchase, and
  • create a new PhoneNumberOptions list, except this time it's for IncomingPhoneNumbers, and
  • get the number from the returned list and pass it in manually to the new options list
  • finally, make the request to purchase the number.

There should be a convenience method on IncomingPhoneNumbers.cs which takes an AvailablePhoneNumber object as an argument and attempts to purchase it for you.

Cannot filter calls by more than one date

It's impossible to retrieve calls that started before a certain date and after another, for example:

GET /2010-04-01/Accounts/AC123/Calls?StartTime>=2012-04-01&StartTime<=2012-04-30

The CallListRequest only allows you to input one StartTime or EndTime with one comparison.

Batch message sending

Is is possible to get a method to allow batch message sending?

Ideally, the method would accept an array/list of Recipient phone numbers with a single message body and then iterate over the list generating the request for each one independently.

Twilio.TwiML.RequestValidator.IsValidRequest raises an exception

An exception occurs when sms contains < or > symbols even if [ValidateInput(false)] is applied:

Message: System.Web.HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (Body=" sms with <ta...").
at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
at Microsoft.Web.Infrastructure.DynamicValidationHelper.ValidationUtility.CollectionReplacer.<>c__DisplayClass12.b__d(String value, String key)
at Microsoft.Web.Infrastructure.DynamicValidationHelper.LazilyEvaluatedNameObjectEntry.ValidateObject()
at Microsoft.Web.Infrastructure.DynamicValidationHelper.LazilyValidatingArrayList.get_Item(Int32 index)
at System.Collections.Specialized.NameObjectCollectionBase.BaseGetAllKeys()
at System.Collections.Specialized.NameValueCollection.get_AllKeys()
at Twilio.TwiML.RequestValidator.IsValidRequest(HttpContext context, String authToken, String urlOverride) in C:\dev\twilio-csharp\src\Twilio.Twiml\RequestValidator.cs:line 52
at Twilio.TwiML.Mvc.ValidateRequestAttribute.OnActionExecuting(ActionExecutingContext filterContext) in C:\dev\twilio-csharp\src\Twilio.Mvc\ValidateRequestAttribute.cs:line 30
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)

Possible fix:
...
if (context.Request.HttpMethod == "POST")
{
System.Collections.Specialized.NameValueCollection form = System.Web.Helpers.Validation.Unvalidated(context.Request).Form;//fix

            // Iterate through that sorted list of POST parameters, and append the variable name and value (with no delimiters) to the end of the URL string
            var sortedKeys = form.AllKeys.OrderBy(k => k, StringComparer.Ordinal).ToList();
            foreach (var key in sortedKeys)
            {
                value.Append(key);
                value.Append(form[key]);
            }
        }

        // Sign the resulting value with HMAC-SHA1 using your AuthToken as the key (remember, your AuthToken's case matters!).
        using (var sha1 = new HMACSHA1(Encoding.UTF8.GetBytes(authToken)))

...

RequestValidator in GET

RequestValidatorAttribute class must url encode the query string in GET requests in order to match the signature.

Example: If twilio sends caller: +166892323, the plus sign is the problem. it should be url encoded before the hash is generated.

Please fix this.

Compile error I can't resolve

Hi,
I'm trying to use the following example and get a compile time error. I couldn't find anything in the documentation with respect to how to use this particular method signature and regardless of what I do I can't get rid of the error mentioned below. Any help is much appreciated.

Error 3 Cannot assign void to an implicitly-typed local variable

    public void TestSMS()
    {

        var twilio = new TwilioRestClient("xxxx", "xxxx");
        var msg = twilio.SendSmsMessage("+NNNNNNNN", "+NNNNNNNN", "This is so much fun?!",  callback );
    }

    public void callback(SMSMessage sms)
    {
        // do something here.
    }

Enhance UpdateIncomingPhoneNumber to support moving a phone number away from a subaccount

UpdateIncomingPhoneNumber (in IncomingPhoneNumbers.cs and IncomingPhoneNumbers.Async.cs) does not appear to support moving a phone number out of the subaccount, since the {AccountSid} URL segment is the same as the authenticating account SID. In order to move a phone number out of a subaccount, the {AccountSid} URL segment should be that of the subaccount and the the authenticating account SID and auth token should be that of the master account.

Naming is inconsistent

Some of the naming in the library is inconsistent. For example:

  • the ListResource() method usually gives the name of the resource, so Calls -> ListCalls etc. However with Accounts, the resource translates to ListSubAccounts.
  • most of the ResourceOptions() classes map directly to the class name, but the Options class for IncomingPhoneNumbers is called PhoneNumberOptions, not IncomingPhoneNumberOptions.
  • the Participants resource is referred to as ListConferenceParticipants, and MuteConferenceParticipant etc but the actual resource name is Participant, and the object that comes back is a Participant list, not a ConferenceParticipant list. Either it should be a ConferenceParticipant object or QueueMembers should be just Members, but it shouldn't be either way.
  • The List etc methods for SMS Messages refer to ListSmsMessages, SendSmsMessage etc but the actual class name is SMSMessage.

Recommended changes:

  • Rename ListSubAccounts to ListAccounts, or provide an extra method mapping to this behind the scenes.
  • Add an IncomingPhoneNumberOptions class with the same arguments
  • Change ListConferenceParticipants etc to be just Participants instead of ConferenceParticipants.
  • Be consistent with naming SmsMessages or SMSMessages.

Toll Free AvailablePhoneNumbers resource supports filtering by AreaCode but the library does not support this

Per the documentation, you can filter by AreaCode in addition to contains:

http://www.twilio.com/docs/api/rest/available-phone-numbers#toll-free-get-filters

It would be nice if we could do

public AvailablePhoneNumberResult ListAvailableLocalPhoneNumbers(string isoCountryCode, AvailablePhoneNumberListRequest options)

for TollFree numbers but this function for toll-free already has a 2-argument method overload, I am not sure if you can overload with a different type.

Issues with List calls and List Sms

I think I might have found two [fixable] bugs with the API to list calls and sms.

For TwilioRestClient.Calls.Async.cs:

Passing of a GreaterThanOrEqual StartTime ends up adding 2 parameters, one for "=" and one for ">=", and the "=" trumps the other.

To fix this I have commented out the two lines seen below:

private void AddCallListOptions(CallListRequest options, RestRequest request) {
  if (options.From.HasValue()) request.AddParameter("From", options.From);
  if (options.To.HasValue()) request.AddParameter("To", options.To);
  if (options.Status.HasValue()) request.AddParameter("Status", options.Status);
  //if (options.StartTime.HasValue) request.AddParameter("StartTime" /* + ">" */, options.StartTime.Value.ToString("yyyy-MM-dd"));
  //if (options.EndTime.HasValue) request.AddParameter("EndTime", options.EndTime.Value.ToString("yyyy-MM-dd"));

  var startTimeParameterName = GetParameterNameWithEquality(options.StartTimeComparison, "StartTime");
  var endTimeParameterName = GetParameterNameWithEquality(options.EndTimeComparison, "EndTime");

  if (options.StartTime.HasValue) request.AddParameter(startTimeParameterName, options.StartTime.Value.ToString("yyyy-MM-dd"));
  if (options.EndTime.HasValue) request.AddParameter(endTimeParameterName, options.EndTime.Value.ToString("yyyy-MM-dd"));

  if (options.Count.HasValue) request.AddParameter("PageSize", options.Count.Value);
  if (options.PageNumber.HasValue) request.AddParameter("Page", options.PageNumber.Value);

  if (options.ParentCallSid.HasValue()) request.AddParameter("ParentCallSid", options.ParentCallSid);
}

I also saw an issue with the list sms api, for this one, I put in a hack fix for me. I think such could definitely be done more elegantly.

Specifically, in TwilioRestClient.Sms.cs, I added:

/// <summary>
/// Returns a filtered list of SMS messages. The list includes paging information and is sorted by DateSent, with most recent messages first.
/// Makes a GET request to the SMSMessages List resource.
/// </summary>
/// <param name="to">(Optional) The phone number of the message recipient</param>
/// <param name="from">(Optional) The phone number of the message sender</param>
/// <param name="dateSentGreaterThanEqualTo">(Optional) The date the message was sent (GMT)</param>
/// <param name="pageNumber">(Optional) The page to start retrieving results from</param>
/// <param name="count">(Optional) The number of results to retrieve</param>
public SmsMessageResult ListSmsMessagesGreaterThanEqualTo(string to, string from, DateTime? dateSentGreaterThanEqualTo, int? pageNumber, int? count) {
  var request = new RestRequest();
  request.Resource = "Accounts/{AccountSid}/SMS/Messages.json";

  if (to.HasValue()) request.AddParameter("To", to);
  if (from.HasValue()) request.AddParameter("From", from);
  if (dateSentGreaterThanEqualTo.HasValue) request.AddParameter("DateSent>", dateSentGreaterThanEqualTo.Value.ToString("yyyy-MM-dd"));
  if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
  if (count.HasValue) request.AddParameter("PageSize", count.Value);

  return Execute<SmsMessageResult>(request);
}

SendSmsMessage() returns null, but should return SMSMessage

I'm using TwilioRestClient.SendSmsMessage(string, string, string, string) which should return SMSMessage. It used to do this just fine, but I think something went wrong with it when I recently upgraded twilio-csharp. Now it is returning null. The SMS is sent fine. I'm passing an empty string for the last parameter which is statusCallback.

I get the same behavior calling SendSmsMessage(string, string, string). It should return SMSMessage, but it returns null.

I'm using Twilio.Api version 3.3.2.0 and RestSharp version 102.5.0.0.

DateTime SpecifyKind

All the DateTime objects retrieved from the Twilio .NET client are in UTC, but the object's Kind property is set to "Unspecified" It would be great if this Kind property was properly set to UTC time.

No way to specify ApplicationSid for SMS

An ApplicationSid is an optional parameter for an outbound SMS call, but you cannot specify one via the csharp library. We may want to have an SMSOptions list like the other list methods.

resource string may be missing a { on ShortCodes

On master branch:
In file ....
\twilio-csharp\src\Twilio.Api.Silverlight\Sms.Async.cs
there looks like a missig { {Marked by <<<<<<<------}as below.

public void ListShortCodes(string shortCode, string friendlyName, Action callback)
{
var request = new RestRequest();
request.Resource = "Accounts/{AccountSid}/SMS/ShortCodes}.json"; <<<<<<<--------

        if (shortCode.HasValue()) request.AddParameter("ShortCode", shortCode);

.............................
}

json RestException

I am using twilio-csharp 3.2.3.13.
I have made an outbound call using for caller id that was not verified.
I wanted to see how the error are returned.

The Call object returned for InitiateOutboundCall had the Status field populated with 400.
Call.RestException field was null.

By default I understand that the api uses json. From looking at the code it does not appear that Call.RestException would be populated ever.

I have changed the code the code to use xml instead of JSON and Call.RestException populated correctly.

Any idea on why RestException is not populated with JSON.

thanks

Bug in path for IncomingPhoneNumber POST

Resource path should be this in Twilio.TwilioApi.IncomingPhoneNumbers.cs
method AddLocalPhoneNumber(PhoneNumberOptions options)

request.Resource = "Accounts/{AccountSid}/IncomingPhoneNumbers";

it fails to add new phone numbers as is.

AuthorizedConnectApps implementation is broken

The following code to retrieve an AuthorizedConnectApp and print the corresponding AccountSid throws an NPE:

using Twilio;
using System;
class Program {
    static void Main(string[] args) {
        // Find these at twilio.com/user/account
        string AccountSid = "AC58f1e8f2...";
        string AuthToken = "{token}";
        var twilio = new TwilioRestClient(AccountSid, AuthToken);
        var authorizedApp = twilio.GetAuthorizedConnectApp("CNf6f33..."); // an authorized app on my acct
        Console.WriteLine(authorizedApp.AccountSid);
        Console.WriteLine ("got this far");
    }
}

I am unsure why as the corresponding HTTP request works perfectly.

In addition I am unsure how the properties of an instance resource are being set, but it appears there is a mismatch between the properties listed in the Model and the properties that actually exist on the object. The model lists, for example, HomepageUrl but the API response mentions the connect_app_homepage_url. The other properties are similar (including no Sid, only a ConnectAppSid).

RequestValidator.IsValidRequest takes port into account but URL used for X-Twilio-Signature does not

I am working with my development server right now which is on a non-standard port. The default implementation of RequestValidator.IsValidRequest() does not work because it is using the full URL including the port, but it appears the Twilio's server-side computation of X-Twilio-Signature does not.

I think the best thing would be to fix the server-side, but another option is to change RequestValidator.IsValidRequest.

This is my work-around (which also verifies that server-side does not take into account the port, because it works with this):

        private string GetUrlWithoutPort()
        {
            Uri uri = System.Web.HttpContext.Current.Request.Url;
            string urlWithoutPort = string.Format("{0}://{1}{2}", uri.Scheme, uri.Host, uri.PathAndQuery);
            return urlWithoutPort;
        }

        private bool IsValidRequest()
        {
            return new RequestValidator().IsValidRequest(System.Web.HttpContext.Current, TwilioAuthToken, GetUrlWithoutPort());
        }

Support <Leave/>

The TwiML Helper is missing the verb Leave, which is somewhat essential to queues.

No AddCallListOptions method in Twilio.Api

In the ListCalls method of Calls.cs, the library makes a call to AddCallListOptions. This function is undefined in Twilio.Api. I'm unsure how everything gets built into one DLL, but the function does exist in the Silverlight folder. is that enough?

Either way it seems it would be more reassuring, and readable if this function existed in the Twilio.Api folder.

SendSmsMessage doesn't work if specifying a response callback

I get an error message "A 'From' phone number is required." when using the SendSmsMessage method with a callback, the method without the callback works ok.
eg..

        // BUG - The twilio.api library does not work properly when specifying a response callback. An error like this will be returned: "A 'From' phone number is required."
        //twilio.SendSmsMessage("+1xxxxxxxxxx", PhoneNumber, validLengthMessage, response);
        twilio.SendSmsMessage("+1xxxxxxxxxx", PhoneNumber, validLengthMessage);

also setting baseurl after the constructor does not change the url that will be called.

Consistent verb naming

It's "sendSmsMessage" but "createOutgoingCall" and "addIncomingPhoneNumber" which makes automated code generation difficult :)

In addition, it would be nice if every List resource supported the parameterized form, like the CallListRequest, as it makes automated code generation much easier.

Application.Async.cs not added to the Windows Phone project

For the WP7 project, the Model/Application.cs file has been linked into the project, but the Applications.Async.cs file has not. The result is that the Application object is in the assembly, but you cannot actually make an API call to get it.

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.