API issues

API issues are the main cases you can encounter when working with domain names. Each time the domain management is displayed or an action is requested on a particular domain name, an API call is done.

Each case is different and depends on a particular situation. For example:

  • A domain registration can fail because a data provided by the customer doesn’t fulfill the expected syntax
  • A nameserver change can fail because the nameservers provided by the customer are wrong
  • A bug in the module makes the API failing and a deeper debug is needed to understand what is requested by WHMCS to the module and what the module requested through the API


Lets look at the following example:
A domain name is already registered and the client wants to update the whois information. For the registrant, he entered several non supported characters in the “Address 2” field.

Once submitted, an error message is displayed to the user:

Unfortunately, WHMCS doesn’t display relevant error messages. Rather a general one is shown asking to contact your support team. OK but what’s next ? How to figure out the problem on your side ?

Open the module logs and search after the action in the list based on the domain name or date/time. We found the following lines:

The first entry says that the module entered in the module function netim_savecontactdetails with the parameters stored in the column “Request”. There are a lot but, in our case, the important information is:

 [Registrant] => Array
                  [Address 1] => 165 avenue de bretagne
                  [Address 2] => wrong string syntax &e"'(-e_ca)=}$^u*$
                  [City] => LILLE
                  [State] => 
                  [Postcode] => 59000
                  [Country] => FR
                  [Phone Country Code] => 33
                  [Phone] => +33.123456789
                  [Email] => bobby@netim.com
                  [phone-normalised] => 1

We can see that “Address 2” was provided with “wrong string syntax &e”‘(-e_ca)=}$^u*$”.

The second entry says that the module tried to update the contact through the API with SOAP function contactownerupdate

But the result was:

E13 : Address : Some characters are not accepted (accents, symbols, ...)

Perfect, we found that the issue occurred because the client requested an update of the domain name holder information with an address containing non supported characters.