Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Twilio block Google verification SMS texts?

Tags:

twilio

I've created a POC app using a Twilio trial account to connect to the Twilio API to download SMS messages. The end goal is to be able to write test automation against web application behind Google MFA.

The code works and downloads SMS messages, but it does not return any texts I've forwarded from my own phone that contain Google verification codes. I can forward other messages or send new messages to the Twilio account and they get returned. But nothing from Google. I also found if I removed the G from the code, it went through OK as well, for example sending 465720 instead of G-465720.

If you're curious, this is the code:

            WebRequest req = WebRequest.Create("https://api.twilio.com/2010-04-01/Accounts/AC################################f/Messages.json");
            req.Headers.Add("Authorization", "Basic [REDACTED]==");
            WebResponse resp = req.GetResponse();

            Stream data = resp.GetResponseStream();
            StreamReader sr = new StreamReader(data);

            string msgData = sr.ReadToEnd();
            TwilioResponse tResponse = JsonConvert.DeserializeObject<TwilioResponse>(msgData);

            content = tResponse.messages[0].body;
like image 305
Kevin McDowell Avatar asked Oct 21 '25 16:10

Kevin McDowell


1 Answers

Yes, Twilio blocks SMS short codes from both Google and Facebook because they have an agreement only to send to actual mobile numbers. See this article for more information: https://support.twilio.com/hc/en-us/articles/223134367-Sending-messages-from-Facebook-and-other-services-to-Twilio

like image 69
Kevin McDowell Avatar answered Oct 26 '25 19:10

Kevin McDowell