Reputation: 1085
I signed up for a new twilio account. Got twilio test-credentials & then used Twilio Rest Api from nuget package to send sms in c#. The problem i am getting is it gives invalid phone number.
I dont know where to search because the documentation is confusing.
This is what i have done so far:
var body = "This is a test message.";
var twilio = new TwilioRestClient(AccSid, AuthToken);
var msg = twilio.SendMessage("+13184794329", "+918871022168", body);
Please help me. Thanx in Advance.
Upvotes: 2
Views: 840
Reputation: 21720
Twilio developer evangelist here.
Test credentials are only used to simulate sending a message, but no actual messages are sent. See more information about them here.
If you want your message to be sent you need to use your live credentials, which you can find on your Account Page by expanding the Show API Credentials link.
As for getting invalid phone number, I just checked the number you provided, and it seems to be a valid "From" number, but I think you forgot to add the +1 to it initially.
If you use the correct credentials, you should be able to send SMS messages, but do keep in mind that mobile numbers in India (as the one you're using) have limitations during the day as you can see in this link.
Hope this helps you
Upvotes: 2