Twilio - 身份验证错误 - 没有提供凭据SDK C#

时间:2017-02-10 23:15:30

标签: c# api sdk sms twilio

经过一些测试后,我的样本停止工作

我正在使用:

PM> Install-Package Twilio

Attempting to resolve dependency 'RestSharp (≥ 105.2.2)'.
'Twilio 4.7.2' already installed.
Adding 'RestSharp 105.2.2' to HelperSMS.
Successfully added 'RestSharp 105.2.2' to HelperSMS.
Adding 'Twilio 4.7.2' to HelperSMS.
Successfully added 'Twilio 4.7.2' to HelperSMS.

,错误是:

  

((Twilio.TwilioBase)(留言))。RestException.Code = 20003

     

((Twilio.TwilioBase)(消息))。RestException.Message ="认证   错误 - 未提供凭据"

     

((Twilio.TwilioBase)(消息))。RestException.Status = 401

这是我的代码:



// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
 static void Main(string[] args)
 {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "..............";
    string AuthToken = "..............";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var message = twilio.SendMessage(
        "+15017250604", "+15558675309",
        "This is the ship that made the Kessel Run in fourteen parsecs?",
        new string[] { "https://c1.staticflickr.com/3/2899/14341091933_1e92e62d12_b.jpg" }
    );
    Console.WriteLine(message.Sid);
 }
}




  

被修改

     

我今天尝试通过我的个人网络(其他所有人)拨打此电话   测试是在我公司的网络内进行的)。它就像是某种东西   在我们的网络中很奇怪防火墙,Bluecoat,代理??一些想法?

0 个答案:

没有答案