While working with Twilio's Regulatory Compliance API, I discovered that it is not possible to determine the "type" of a phone number (local, toll-free, national) after a user purchases the phone number. This property does not seem to be exposed on the IncomingPhoneNumber
API.
This would be useful as I'd like to indicate to the user on their custom dashboard in my app (not Twilio console) that the phone number they own requires a Regulatory Compliance Bundle. However, the Regulatory Compliance API requires the following properties to list phone requirements:
- IsoCountry
- NumberType <--- I don't know how to get this value after purchasing the number?
- EndUserType
What is the suggested method for displaying to a user that a phone is missing regulatory information?
I noticed that the console API:
https://www.twilio.com/console/phone-numbers/api/v1/inventory/PNXXXX
DOES return the phone number type, which is then used for the following query to return compliance information:
https://www.twilio.com/console/phone-numbers/api/v1/regulatory/regulations?isoCountry=US&numberType=local
Would love any insight on this!
Here is a 7 year old question asking something similar. Twilio get "type" of number. Local, Mobile, or Toll Free
I'm trying to prevent adding phone numbers to my database so I don't have to deal with updating data in 2 locations if a user deletes/modifies a number using the Twilio API.