Sending a message using Twilio-C #

Hy ... I'm learning twilio right now, and I saw a message here http://www.markhagan.me/Samples/Send-SMS-Using-Twilio-ASPNet

I made my own code because "sendSMSMessage" is deprecated on this site, but here is my code:

using System.Text;
using System.Threading.Tasks;
using Twilio;
namespace SMSUsingTwilio
{
    class Program
    {
        static void Main(string[] args)
        {
            String ACCOUNT_SID = "ACMYSID"; 
            String AUTH_TOKEN = "40MYAUTHTOKEN";

            TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

            Message Response = client.SendMessage("(732)305-8856", "+6285220446195", "Hellow Hyosoka Poipo :D");


            Console.WriteLine(Response.Status);
            Console.WriteLine(Response.AccountSid);

            Console.WriteLine("SMS Berhasil di kirim");
            Console.ReadLine();    
        }
    }
}

The problem is that I don't have any sms message to my phone number, and even I don't get any response in my C # project: enter image description here

So what's wrong here ... ?? Please help .. Thank you very much ... :)

+4
source share
2 answers

After looking at mr.David's answer, I realized that my phone number has not yet been verified. So follow this link to check my number:

https://www.twilio.com/user/account/phone-numbers/verified

agian : enter image description here

Yeeeiii... ... ...:)

+2

:

var message = client.SendMessage("(732)305-8856", "+6285220446195", "Hellow Hyosoka Poipo :D");

:

static void Main(string[] args) 
{ 
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
    string AuthToken = "[AuthToken]"; 
    var twilio = new TwilioRestClient(AccountSid, AuthToken); 

    var message = twilio.SendMessage("(732)305-8856", "+6285220446195", "Hellow Hyosoka Poipo :D"); 
    ); 
    Console.WriteLine(message.Sid); 
 } 

: https://www.twilio.com/docs/api/rest/sending-messages

, , .

+1

All Articles