Twilio REST API - 无法为子帐户购买twilio号码
问题描述:
我在使用REST API的ASP.net web Forms(.net v4.0)中开发了一个Web应用程序。我们面临的问题是,当我们在开发人员计算机上运行应用程序时,一切都很好,但是当我们在Windows Server 2008R2上部署相同的应用程序时,创建子账户并为新创建的子账户购买新的twilio号码帐户没有完成。只有子账户被创建,但没有新的号码。如果你能帮我解决这个问题,我会非常感激。代码如下:Twilio REST API - 无法为子帐户购买twilio号码
ArrayList AccountInformation = new ArrayList();
var client = new Twilio.TwilioRestClient(this.ParentAccountSid, this.ParentAuthToken);
var subaccount = client.CreateSubAccount(email);
var subaccountClient = new Twilio.TwilioRestClient(subaccount.Sid, subaccount.AuthToken);
var number = subaccountClient.AddIncomingPhoneNumber(new Twilio.PhoneNumberOptions() { AreaCode = "412" });
AccountInformation.Add(number.PhoneNumber.ToString());
AccountInformation.Add(subaccount.AuthToken.ToString());
AccountInformation.Add(subaccount.Sid.ToString());
AccountInformation.Add(subaccount.Uri.ToString());
此外,任何具体的更改/安装在网络服务器上所需的机器,请告诉。
感谢
答
新版本的固定我们的问题
你确定这是同一AccountSid /的authToken本地和远程?是否部署了最新版本的代码?代码看起来是正确的,所以我的猜测是它是外在的。 – 2012-02-06 08:54:42
是的,两台机器上都是相同的AccountSid/AuthToken。并且最新的代码被部署在服务器上。外在的东西像什么? – Asif 2012-02-06 09:00:29
我的意思是外部配置等等。你在调用'subaccountClient.AddIncomingPhoneNumber(...)'''之后有什么'number.RestException'? – 2012-02-06 09:02:29