0
votes

I am following a Twilio guide to be able to send an SMS message from my Twilio phone number to my personal phone number, and for some reason, I am not receiving a message from my Twilio phone number when I run this code:

from twilio.rest import Client

account_sid = ACCOUNT_SID
auth_token = AUTH_TOKEN
client = Client(account_sid, auth_token)

message = client.messages \
    .create(
        body='Success!',
        from_=TWILIO_NUMBER,
        to=MY_NUMBER
    )
print(message.sid)

Where ACCOUNT_SID, AUTH_TOKEN, TWILIO_NUMBER, and MY_NUMBER are strings with the proper values. I was following this guide: https://www.twilio.com/docs/sms/send-messages . Thanks! EDIT - Attached is a picture of my account permissions from the dashboard page. Does this mean that I have to pay to send an SMS message from my Twilio phone number to my personal phone number?: enter image description here

3
With a free account you can send SMS messages to numbers that you have verified with your Twilio account. Your code looks correct, do you get an error when you try to run it? Or do you see an error in the Twilio debugger at all?philnash
No, there is no error, and the message.sid is printed out. I'm just not receiving the SMS message.watersheep23
What is the status of the message in the Message Logs?philnash
Thank you @philnash . I looked in the Message Logs and when I try to send the message, I am getting an "(Error: 30007) Message filtered Your message content was flagged as going against carrier guidelines." It looks like my message was identified as spam because I tried to send the same message a ton of times.watersheep23
According to this guide: support.twilio.com/hc/en-us/articles/… , if you collect 3 or more examples of Message SIDs that have the “undelivered” status with error 30007, and then contact the Twilio Support team, they can review your messaging and determine if an error was made. So that's what I did; hopefully they get back with me soon so I can start sending messages again!watersheep23

3 Answers

2
votes

One Check that ACCOUNT_SID, AUTH_TOKEN are correct or not because it gets updated if we not used for few days otherwise all is okk !! Also Check for that you have Credit or not to send message.

0
votes

Kindly send a message [START] from your phone to your Twilio number. If you might send a [STOP] message from your phone to twilio number.

0
votes

This is what showed up in the Message Logs whenever I tried to send the message: "(Error: 30007) Message filtered Your message content was flagged as going against carrier guidelines." According to this guide:
https://support.twilio.com/hc/en-us/articles/223181848-How-Does-Message-Filtering-Work- , if you collect 3 or more examples of Message SIDs that have the “undelivered” status with error 30007, and then contact the Twilio Support team, they can review your messaging and determine if an error was made. Thanks for the help guys!

EDIT -- Twilio support got back to me, and apparently my messages were getting filtered (and thus getting the error 30007) because my carrier for my personal phone number is Sprint, and according to Twilio support, messages to T-Mobile (including Sprint) phone numbers may get filtered because they have not launched their A2P 10DLC solution. Other carriers like Verizon and AT&T have already launched their A2P 10DLC solutions, so this issue does not occur if the carrier of your personal phone number is Verizon or AT&T. But again, this issue might occur if your carrier is T-Mobile or Sprint.