PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, November 19, 2022

[FIXED] How to check "to number" is valid for Twillio SMS API?

 November 19, 2022     php, twilio, twilio-php     No comments   

Issue

I am using Twillio API to send SMS to my website users. But there's one issue, I want to check first, if that number is valid or not? Is there any API in Twillio which is used to check validity of 'to' numbers?


Solution

Twilio developer evangelist here.

We actually do have an API that you can use to check the validity of a phone number. Check out the Lookup API and its documentation. At the basic level it checks to see if a number looks like a valid phone number and gives you the correct national formatting for it. You can also make a request to find out carrier details about the number to see if it is likely to receive SMS messages.

The link that @dhi_m provided is a good resource to find out what Twilio does with a number when sending it a message. Ultimately, the best way to see if you can send a message to a number is to try to send a message. Then you should build in ways to respond if the message is unsuccessful.



Answered By - philnash
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing