Validate a Phone Number

Check the validity and existence of phone numbers

Required inputs

Phone number

Phone input Content
Phone number prefix international country calling codes.
Phone number The format of the input does not matter – you can provide phone numbers in either international or national formats. Foxentry will automatically correct and format the input to the specified format. Additionally, there is an option to determine whether a formatted phone number (with spaces) should be considered valid. If this option is set to false, a phone number with spaces will be flagged as invalid, with a format error, and a correction will be suggested. If set to true, a phone number using correct spacing will be deemed valid, while the national format (without spaces) will be considered invalid.
Phone number with prefix Can be used only when prefix and number fields are empty.

Prefixes

Prefixes settings Content
Allowed prefix You can set the list of international country calling codes, which will be considered valid.
Default prefix Default international prefix if not included in the validation query: This setting helps the validator produce more accurate results. By specifying a list of preferred international country calling codes, the validator will prioritize these codes if a number exists in multiple countries. It will check the list in the specified order, applying the prefixes based on your preference to find the most likely correct format.

What can you set?

Data scope Content
Empty The setting will be set to the default state, which in this case means 'Extended'.
Basic This type of validation is primarily used to check if the phone number has the correct format and syntax. There is no TELCO data check so you would not be able to know if the phone number is connected to the network. Only basic errors and typos are corrected.
Extended This is the more advanced option and consists of the TELCO data realtime check. Based on the information we receive we can with certainty tell if the phone number is connected to the network or not. Our validator also informs you about the type of phone number, you're validating and its carrier.
Format number Content
Yes Determines whether a formatted phone number (with spaces) should be considered valid. If set to yes, a phone number with correct spacing will be recognized as valid, while the national format (without spaces) will be deemed invalid.
No A phone number with spaces will be marked as invalid due to a format error, and a corrected version will be suggested in the result.
Empty The setting will be set to the default state, which in this case means 'No'.

What can you find in the response?

Basic

json
{ "status": 200, "request": { "endpoint": "phone/validate", "code": "d387148f-ee47-467a-aa31-71b30c93d75b" }, "response": { "result": { "isValid": null, "proposal": "invalidWithCorrection", "data": { "country": null, "prefix": "420", "number": "731825723", "numberWithPrefix": null, "carrier": [], "format": { "national": null, "nationalFormatted": null, "international": null, "internationalFormatted": null } }, "errors": [ { "group": "SYNTAX", "type": "INVALID", "subtype": null, "severity": "critical", "relatedTo": ["prefix"], "description": "Value has invalid syntax." } ], "resultCorrected": { "isValid": true, "data": { "country": { "code": "CZ", "prefix": "+420" }, "prefix": "+420", "number": "731825723", "numberWithPrefix": "+420731825723", "carrier": { "type": "mobile" }, "format": { "national": "731825723", "nationalFormatted": "731 825 723", "international": "+420731825723", "internationalFormatted": "+420 731 825..." } }, "errors": [], "fixes": [ { "group": "VALUE", "type": "CHANGED", "subtype": null, "data": { "typeFrom": "prefix", "type": "prefix", "valueFrom": "420", "value": "+420" } } ], "suggestions": [] }, "errors": [] } } }

Extended

json
{ "status": 200, "request": { "endpoint": "phone/validate", "code": "2053a3a4-1b2a-427d-910b-572c6fa62ccb" }, "response": { "result": { "isValid": null, "proposal": "invalidWithCorrection", "data": { "country": { "code": null, "prefix": "420" }, "prefix": "420", "number": "731825723", "numberWithPrefix": null, "carrier": { "name": null, "type": null }, "format": { "national": null, "nationalFormatted": null, "international": null, "internationalFormatted": null } }, "errors": [ { "group": "SYNTAX", "type": "INVALID", "subtype": null, "severity": "critical", "relatedTo": ["prefix"], "description": "Value has invalid syntax." } ], "resultCorrected": { "isValid": true, "data": { "country": { "code": "CZ", "prefix": "+420" }, "prefix": "+420", "number": "731825723", "numberWithPrefix": "+420731825723", "carrier": { "name": "T-Mobile Czech Republic a.s.", "type": "mobile" }, "format": { "national": "731825723", "nationalFormatted": "731 825 723", "international": "+420731825723", "internationalFormatted": "+420 731 825..." } }, "errors": [], "fixes": [ { "group": "VALUE", "type": "CHANGED", "subtype": null, "data": { "typeFrom": "prefix", "type": "prefix", "valueFrom": "420", "value": "+420" } } ], "suggestions": [] }, "errors": [] } } }