Internal API

You are currently watching the v2 legacy branch documentation.

EXTENDED FEATURE

Internal API


SoluteDNS allows developers to add own scripted points where zones need to be edited. A developer can call three functions to add, edit or delete a record from a zone.

Internal API calls can be made from anywhere within the WHMCS scope. For example: custom pages, addon modules, payment gateways etc.

Initiate API

To initiate the Internal API use the following code:

$dns_api = new SDNS_api();

API Functions

Returned Answer

The API class will always return an array. The content of this array may either be the requested data or a result of the action performed.

When a action result is returned the array contains a status being ‘success’, ‘warning’ or ‘error’. Also a ‘code’ and ‘desc’ may be returned.


Review returned results

To review the returned results of the API call you can use this code:

echo '<pre>';
var_dump($result);
echo'</pre>';

Error Codes
Error Code Error Description
4001 Validation error.
4002 Permission denied.
4003 Slave zone cannot be edited.
4004 Record limit has been reached.
4005 Multiple records where found, can only edit one.
4006 Record could not be found.
4007 No DNSsec keys found.
5001 Service unavailable.
5002 Zone limit has been reached.
5003 Client zone limit has been reached.
5004 System zone limit has been reached.
5005 Zone already existing in local index.
5006 Invalid domain name.
5008 Zone could not be found on nameserver.
5009 Zone removed with exception.
5010 No records found in zone.
7001 Client could not be found.
7002 Domain could not be found.
7003 Unknown zone type.
7004 Unknown nameserver.