TwilioKelley Robinson, Matthew SetterTutorial
How to Approve Real Users and Block Fake Accounts at Sign Up with Lookup and Verify in PHP
Summary
The tutorial shows how to combine Twilio Lookup and Verify in a PHP sign-up flow that screens phone numbers before sending an OTP. It starts with Line Type Intelligence to accept mobile numbers, optionally checks reachability with Line Status, and uses Identity Match to compare submitted first and last names against authoritative sources without revealing underlying data. If those checks pass, the application sends a six-digit verification code and validates it through a Verify service. The provided implementation uses PHP 8.5, Slim, Twig, Monolog, and the Twilio REST client, with environment flags controlling optional checks and logs recorded in data/app.log. Testing covers mobile, toll-free, VoIP, and name-mismatch cases, while the pricing discussion recommends ordering cheaper checks before more expensive Identity Match and Verify calls.
Context
The sign-up flow is intended to block fake accounts and unwanted bots while providing a seamless verification path for real users. The post also identifies cost as a consideration because the four checks use API packages with different prices, varying by country.
Approach / What changed
Implement a four-layer pipeline in PHP using Twilio Lookup Line Type Intelligence, optional Line Status, optional Identity Match, and Twilio Verify phone verification. Environment variables control the optional checks, and the example uses Slim routes, Twig templates, Monolog logging, and a Twilio REST client.
Takeaways
Line Type Intelligence filters out landlines, nonfixed VoIP, toll-free numbers, and pagers while allowing the accepted line types to be customized.
Identity Match checks firstNameMatch and lastNameMatch, accepting exact_match or high_partial_match and rejecting no_match, partial_match, or null results.
The flow places cheaper Line Type Intelligence and Line Status checks before the more expensive Identity Match and Verify calls, with pricing varying by country.
Source and freshness
- Source
- twilio.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.