Exemplo n.º 1
0
        public ActionResult addAddress(Twilio.Address _address)
        {
            var twilio = new TwilioRestClient(AccountSid, AuthToken);

              try{
              var addResult = twilio.AddAddress(_address.FriendlyName, _address.CustomerName, _address.Street, _address.City, _address.Region, _address.PostalCode, _address.IsoCountry);
              return View("Addresses");
              }

              catch (Exception ex){ return View();}
        }
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        string AuthToken = "your_auth_token";
        var twilio = new TwilioRestClient(AccountSid, AuthToken);

        var options = new AddressOptions();
        options.CustomerName = "Customer 456";
        options.Street = "2 Hasselhoff Lane";

        var address = twilio.AddAddress("Billing - Customer 123", "Customer 123", "2 Hasselhoff Lane", "Berlin", "Berlin", "10785", "DE");

        Console.WriteLine(address.Sid);
    }