Reputation: 829
I have registered with twilio
and my phone number is also activated,I have used this twilio
service in django restframework
and trying to send SMS to phone and email, but that time getting error. Any solution
twilio.base.exceptions.TwilioRestException:
HTTP Error Your request was:
POST /Accounts/ACd554de003ceb5ec51587cf5b06219b5e/Messages.json
Twilio returned the following information:
Unable to create record:
The number is unverified. Trial accounts cannot send messages to unverified numbers; verify at twilio.com/user/account/phone-numbers/verified
, or purchase a Twilio number to send messages to unverified numbers.
More information may be available here:
https://www.twilio.com/docs/errors/21608
Upvotes: 0
Views: 578
Reputation: 73075
Twilio developer evangelist here.
While you are using a trial account you are only able to send SMS messages to numbers that you have verified with your Twilio account. You can verify a number by following these steps:
- Login to your account at https://www.twilio.com/console.
- Click Phone Numbers.
- Click Verified Caller IDs.
- Click the red + sign icon.
- Enter the desired phone number to verify, and then click Call Me.
- NOTE: Click Text you instead to receive a text message for verification.
Once you have verified your number you should be able to send an SMS from a Twilio number that you bought in the console to your number using the API.
You also said you were "trying to send SMS to phone and email". You cannot send an SMS to an email address using the Messages resource. If you want to send emails, I would look into the SendGrid API.
Upvotes: 0