Search code examples
phone-number

not a valid phone number


Need help in identifying what is the issue and how to overcome this. Below is the error I am currently facing. I am trying to register an available domain in Route53 through AWS Javascript API in nodejs 6. It is saying the phone number is not valid. But I have used the same phone number from aws route53 console, and same phone number gets accepted. I tried by changing the format of the phone like removing "." , moving it etc. But it gives another error:

"ADMIN.PHONE: '+02266XX4811' does not resemble +999.12345678"

{ [TLDRulesViolation: [ADMIN.PHONE: '+022.66XX4800' is not a valid phone number, OWNER.PHONE: '+022.66XX4800' is not a valid phone number, TECH.PHONE: '+022.66XX4800' is not a valid phone number, BILL.PHONE: '+022.66XX4800' is not a valid phone number]] message: '[ADMIN.PHONE: \'+022.66XX4800\' is not a valid phone number, OWNER.PHONE: \'+022.66XX4800\' is not a valid phone number, TECH.PHONE: \'+022.66XX4800\' is not a valid phone number, BILL.PHONE: \'+022.66XX4800\' is not a valid phone number]', code: 'TLDRulesViolation', time: Thu Oct 19 2017 12:32:28 GMT+0000 (UTC), requestId: '91f5ca3e-b4c9-11e7-b0c2-a34579169cee', statusCode: 400, retryable: false,

Below is the code I am using:

route53domains.registerDomain(params, function (err, data) {
    if (err) {
        console.log(err, err.stack); // an error occurred
        console.log("error");
    }else{
        console.log(data);           // successful response

})

params :

    { "regjson" : {
        "AutoRenew": false,
        "DomainName": "testingdomxxx.com",
        "DurationInYears": 1,
        "AdminContact": { 
          "AddressLine1": "900",
          "AddressLine2": "Skyline",
          "City": "Mumbai",
          "ContactType": "PERSON",
          "CountryCode": "IN",
          "Email": "testingdomain@gmail.com",
          "Fax": "02228573244",
          "FirstName": "testname",
          "LastName": "testname",
          "OrganizationName": "Skyline",
          "PhoneNumber": "+022.66XX4800",
          "State": "MA",
          "ZipCode": "400079"
       },
       "RegistrantContact": { 
          "AddressLine1": "900",
          "AddressLine2": "Skyline",
          "City": "Mumbai",
          "ContactType": "PERSON",
          "CountryCode": "IN",
          "Email": "testingdomain@gmail.com",
          "Fax": "02228573244",
          "FirstName": "testname",
          "LastName": "testname",
          "OrganizationName": "Skyline",
          "PhoneNumber": "+022.66XX4800",
          "State": "MA",
          "ZipCode": "400079"
       },
       "TechContact": { 
          "AddressLine1": "900",
          "AddressLine2": "Skyline",
          "City": "Mumbai",
          "ContactType": "PERSON",
          "CountryCode": "IN",
          "Email": "testingdomain@gmail.com",
          "Fax": "02228573244",
          "FirstName": "testname",
          "LastName": "testname",
          "OrganizationName": "Skyline",
          "PhoneNumber": "+022.66XX4800",
          "State": "MA",
          "ZipCode": "400079"
       }
    }
}

(Two digits have been masked in phone number for confidentiality, but while sending, it is digits and not XX) I have to do this in Lambda but facing same error in both lambda and nodejs. Anybody has any idea, what I am doing wrong here.


Solution

  • I finally found out that it is of the format +91.9966XX4800 The dot comes after the country code and is required. I had to register one domain through the route53 console and see the phone number shown there. Used the same format and worked. Thanks all for all your help, appreciate!