Validate Phone Number: Endpoint to see if phone number is valid

  • 2
  • Idea
  • Updated 2 years ago
  • Under Consideration
It would be great to be able to validate phone numbers, that way invalid numbers could be removed from a database. Twilio does this: https://www.twilio.com/lookup
Photo of Nate Atkinson

Nate Atkinson

  • 100 Points 100 badge 2x thumb

Posted 2 years ago

  • 2
Photo of Benjamin Dean

Benjamin Dean, Alum

  • 8,622 Points 5k badge 2x thumb
Hey Nate,

So we have an undocumented API resource named "Phone-Number Parser" which might be of service and hopefully it will suit the use case you have.

The Phone-Number Parser API resource does not require any special permissions to use, and only requires the POST body to be JSON with a single property named `originalStrings` which is an array of strings with each representing a phone number.

There are some other parameters which can be used as well (which aren't displayed in the sample request / response below). Try this out and let me know if this solves your use case, or if you'd like to explore the other options available with the Phone-Number Parser API resource.

REQUEST TO THE PHONE-NUMBER PARSER API RESOURCE...

POST /restapi/v1.0/number-parser/parse HTTP/1.1Host: platform.devtest.ringcentral.com
Authorization: Bearer {{REPLACE_WITH_YOUR_ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json
Cache-Control: no-cache
{
"originalStrings": [
"3176009731",
"8622908",
"415.890.5908",
"1(800 555-2291",
"+1 (800) 555-1122"
]
}

RESPONSE FROM THE ABOVE REQUEST...

{    "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/number-parser/parse?nationalAsPriority=false&q...;,
    "homeCountry": {
        "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/country/1";,
        "id": "1",
        "name": "United States",
        "isoCode": "US",
        "callingCode": "1"
    },
    "phoneNumbers": [
        {
            "originalString": "3176009731",
            "country": {
                "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/country/1";,
                "id": "1",
                "name": "United States",
                "isoCode": "US",
                "callingCode": "1"
            },
            "areaCode": "317",
            "subscriberNumber": "6009731",
            "formattedNational": "(317) 600-9731",
            "formattedInternational": "+1 (317) 6009731",
            "dialable": "3176009731",
            "e164": "+13176009731",
            "special": false,
            "normalized": "13176009731",
            "tollFree": false
        },
        {
            "originalString": "8622908",
            "country": {
                "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/country/46";,
                "id": "46",
                "name": "China",
                "isoCode": "CN",
                "callingCode": "86"
            },
            "areaCode": "",
            "subscriberNumber": "22908",
            "formattedNational": "+86 22908",
            "formattedInternational": "+86 22908",
            "dialable": "0118622908",
            "e164": "+8622908",
            "special": false,
            "normalized": "8622908",
            "tollFree": false
        },
        {
            "originalString": "415.890.5908",
            "country": {
                "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/country/1";,
                "id": "1",
                "name": "United States",
                "isoCode": "US",
                "callingCode": "1"
            },
            "areaCode": "415",
            "subscriberNumber": "8905908",
            "formattedNational": "(415) 890-5908",
            "formattedInternational": "+1 (415) 8905908",
            "dialable": "4158905908",
            "e164": "+14158905908",
            "special": false,
            "normalized": "14158905908",
            "tollFree": false
        },
        {
            "originalString": "1(800 555-2291",
            "country": {
                "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/country/1";,
                "id": "1",
                "name": "United States",
                "isoCode": "US",
                "callingCode": "1"
            },
            "areaCode": "800",
            "subscriberNumber": "5552291",
            "formattedNational": "(800) 555-2291",
            "formattedInternational": "+1 (800) 5552291",
            "dialable": "8005552291",
            "e164": "+18005552291",
            "special": false,
            "normalized": "18005552291",
            "tollFree": true
        },
        {
            "originalString": "+1 (800) 555-1122",
            "country": {
                "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/country/1";,
                "id": "1",
                "name": "United States",
                "isoCode": "US",
                "callingCode": "1"
            },
            "areaCode": "800",
            "subscriberNumber": "5551122",
            "formattedNational": "(800) 555-1122",
            "formattedInternational": "+1 (800) 5551122",
            "dialable": "8005551122",
            "e164": "+18005551122",
            "special": false,
            "normalized": "18005551122",
            "tollFree": true
        }
    ]
}
Photo of Nate Atkinson

Nate Atkinson

  • 100 Points 100 badge 2x thumb
Ben,

Thanks for the reply. Sadly this does not help me at all. This number-parser endpoint only reformats the number being supplied, and doesn't actually validate it. I'm looking for validation so I can remove bad numbers from my call list.

Any chance you could add a validation endpoint?

Thanks
Nate
Photo of Benjamin Dean

Benjamin Dean, Alum

  • 8,622 Points 5k badge 2x thumb
I can provide the information you've requested to our team for consideration, but we do not have that feature in our API currently, and it is not on any roadmaps (of which I am aware) currently.

Would you like me to add you to our Developer Beta Feature test list to receive email notifications to test new features of our Platform as they are released sir?
Photo of Nate Atkinson

Nate Atkinson

  • 100 Points 100 badge 2x thumb
Thanks Ben, that would be great if you would provide my request to the team for their consideration. And yes, please add me to your beta feature email list.

Thanks
Nate
Photo of Benjamin Dean

Benjamin Dean, Alum

  • 8,622 Points 5k badge 2x thumb
You've been added to the list, and I have shared this idea with our Platform Architect for plausibility consideration. Thanks for the suggestion.