Twilio 测试凭证:当我尝试购买号码时 WaitingForActivation? [英] Twilio Test Credentials: WaitingForActivation when I try to purchase a number?
问题描述
我有以下代码:
public void PurchaseNumber(string username, string phoneNumber) {
var twilio = new TwilioRestClient(accountSid, authToken);
var options = new PhoneNumberOptions {
VoiceUrl = "",
PhoneNumber = "+15005550006"
};
var number = twilio.AddIncomingPhoneNumber(options);
Console.WriteLine(number.Id); // Sid is not available
return;
}
两个问题 - number.Sid
不可用,如示例所示,并且 number.Status
始终显示WaitingForActivation".我做错了什么?
Two issues - number.Sid
is not available, as the samples display, and number.Status
always shows "WaitingForActivation". What am I doing wrong?
更新:不可用"号码也会发生这种情况,而不仅仅是有效且可用"号码.试用账户是否可以使用幻数?我正在使用 https://www.twilio.com/user/account/developer-tools/test-credentials
页面中的 SID 和令牌.
Update: This also happens with the 'unavailable' number, not just with the 'valid and available' one. Is the usage of magic numbers available to trial accounts? I am using the SID and Token from the https://www.twilio.com/user/account/developer-tools/test-credentials
page.
如果我更改了我的 SID 的一个字符,也会发生这种情况 - 因此,尽管我直接从我的 /developer-tools
页面上抓取了它,但我的 SID 似乎是无效的.
This also happens if I change one of the characters of my SID - so it seems that my SID is invalid, despite grabbing it directly off of my /developer-tools
page.
最终更新 - 这是因为我使用的是 Twilio nuget 包的 PreRelease 版本.我卸载了它并安装了非预发布版本,Sid
可用,一切都开始工作了.
Final Update - it was because I was using the PreRelease version of the Twilio nuget package. I uninstalled it and installed the non-prerelease version and Sid
became available and everything started working.
推荐答案
最终更新 - 这是因为我使用的是 Twilio nuget 包的 PreRelease 版本.我卸载了它并安装了非预发布版本,Sid 可用,一切都开始工作了.
Final Update - it was because I was using the PreRelease version of the Twilio nuget package. I uninstalled it and installed the non-prerelease version and Sid became available and everything started working.
这篇关于Twilio 测试凭证:当我尝试购买号码时 WaitingForActivation?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!