Below is some code you can use to validate a phone number in the format of +18122822444 or +1812-282-2444 or +1(812)282-2444 and I'm sure there are more variations that are acceptable. Anyways, here is a way you can validate someone's phone number using numverify API! Make an account and get a key to create the request URL. Requests are HTTP only for free but if you pay you can use HTTPS. Again, not posting my API key in the forums so grab your free one and give it a whirl. I should note that the response JSON file actually also returns carrier and approximate city location of the registered phone. I just decided to not put that into my API function. Feel free to do it. It only requires a small tweak.
PRINT VerifyPhoneNumber
("+1(812)282-2444")
URLFile = "validatephone"
URL = "http://apilayer.net/api/validate?access_key=YOURAPIKEYHERE&number=" + FormatAsHTTP(phone) + "&countrycode=&format=1"
a% = API_Request(URL, URLFile)
VerifyPhoneNumber = ""
VerifyPhoneNumber
= MID$(Request
, 11, 4) VerifyPhoneNumber
= MID$(Request
, 11, 5)
start% = 1
position%
= INSTR(start%
, Request
, " ") MID$(Request
, position%
, 1) = "+" start% = position% + 1
FormatAsHTTP = Request
API_Request
= URLDownloadToFileA
(0, URL
+ CHR$(0), File
+ CHR$(0), 0, 0)