Validate phone number

Description

Validates a phone number and retrieves some more metadata for the it.

HTTP Method

GET

Path

/common/validatePhone/{phoneNumber}

Authentication

Does not require user authentication.

Parameters

Table 20.  Parameters for " Validate phone number "

NameTypeValue TypeDescription
phoneNumberPATHStringthe number to be validated. Best would be to send it in the international format (+41... , for Switzerland)
countryQUERYString(optional) The iso2 code for the country. Send it in case the phone number is not sent in the international format or it is wanted to validate the phone is from this specific country.
fullDetailsQUERYboolean(optional) true to get more metadata for the phone. It would try to geolocate the phone,timezone, carrier...

Error Codes

150000 ( Common )

An unhandled exception has occured.

Response Schema

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema elementFormDefault="qualified" version="1.0" targetNamespace="http://xsd.poken.com" xmlns:tns="http://xsd.poken.com" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="phoneValidation">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="possibleNumber" type="xs:boolean"/>
        <xs:element name="validNumber" type="xs:boolean"/>
        <xs:element name="numberType" type="xs:string"/>
        <xs:element name="countryIso2" type="xs:string" minOccurs="0"/>
        <xs:element name="region" type="xs:string" minOccurs="0"/>
        <xs:element name="carrier" type="xs:string" minOccurs="0"/>
        <xs:element name="timezone" type="xs:string" minOccurs="0"/>
        <xs:element name="format" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="international" type="xs:string" minOccurs="0"/>
              <xs:element name="e164" type="xs:string" minOccurs="0"/>
              <xs:element name="national" type="xs:string" minOccurs="0"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="PhoneNumberType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="FIXED_LINE"/>
      <xs:enumeration value="MOBILE"/>
      <xs:enumeration value="FIXED_LINE_OR_MOBILE"/>
      <xs:enumeration value="TOLL_FREE"/>
      <xs:enumeration value="PREMIUM_RATE"/>
      <xs:enumeration value="SHARED_COST"/>
      <xs:enumeration value="VOIP"/>
      <xs:enumeration value="PERSONAL_NUMBER"/>
      <xs:enumeration value="PAGER"/>
      <xs:enumeration value="UAN"/>
      <xs:enumeration value="VOICEMAIL"/>
      <xs:enumeration value="UNKNOWN"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>

Sample Response

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<phoneValidation xmlns="http://xsd.poken.com">
		<possibleNumber>true</possibleNumber>
		<validNumber>true</validNumber>
		<numberType>MOBILE</numberType>
		<countryIso2>RO</countryIso2>
		<region>Romania</region>
		<carrier>Vodafone</carrier>
		<timezone>Europe/Bucharest</timezone>
		<format>
				<international>+40 726 182 410</international>
				<e164>+40726182410</e164>
				<national>0726 182 410</national>
		</format>
</phoneValidation>