NAV
php

Introduction

Welcome to Domains.co.za API Documentation.

The Domains.co.za API is a RESTful API which uses JWT tokens for authentication.
You will require your username and password in order to authenticate and use our API.

Web Service

Some Notes

Common Response Parameters

All API calls will include the following parameters as standard. These are used internally to simplify error tracking.

Parameter Type Description
strUUID string Unique identifier for the api transaction
intReturnCode integer Api call return code, corresponds to the return codes listed below
strMessage string Api call status message
strReason string Contains more information in case of an error
strApiHost string This is the api server that handled the transaction

Return Codes

intReturnCode Status Value
0 Not Available or Failed The API call was not successful.
1 Successful The API call was successful and was actioned immediately.
2 Pending Action Successful The API call has been successfully queued.
4 Item Not Pending Action There is no pending action on the domain or contact.
6 Invalid Login Credentials The API key or Username/Password is incorrect.
7 Authentication Error You are not authorized to to access the domain or contact.
8 Association Prohibits Operation You do not have access to the domain or contact.
9 Unknown Error The registry has returned an error we have never seen before.
10 Missing Parameter A require field for the API call is missing.
11 Item Does Not Exist The domain or contact in the API call does not exist.
12 Status Prohibits Operation The registry has put a status on the domain or contact which prevents us from performing the action requested.
13 Item already exists The domain or contact already exists under your account.
14 Command Syntax Error The registry has requested our API call due to malformed or missing data.
15 Unknown Command The API call you are trying to use does not exist.
16 Database Call Failed There is either a problem with our DB or we are doing maintenance.
17 Internal Error Something is broken on our API and we are investigating it.
18 Connection Refused The registry is rejecting our EPP connection.
19 Billing Failure You do not have enough credits on our Reseller Account or with the Registry.
20 Request Timed Out The registry is not responding.
22 Connection Failed to Provider We failed to establish a connection to the Registry.

HTTP Return Codes

Error Code Status Description
200 Successful Your API call was successful
400 Bad Request Your request is invalid.
401 Unauthorized Your API key is wrong.
403 Forbidden The API call is restricted for administrators only.
404 Not Found The API call could not be found.
405 Method Not Allowed You tried to access a API call with an invalid method.
406 Not Acceptable You requested a format that isn't json.
410 Gone The API call has been removed from our servers.
429 Too Many Requests You're making to many API calls and hitting our rate limiter.
500 Internal Server Error We had a problem with our API. Please try again later.
503 Service Unavailable We're temporarily offline for maintenance. Please try again later.

Poll Codes

Code Type Description
3001 contact Contact Update Successful
3002 contact Empty Update Command
4000 ns Authoritative Nameserver failure for domain
4001 ns Consecutive Nameserver Check Failed
4002 ns Nameserver Check Successful
4003 update Domain Pending Update
4004 update Domain Update Successful
4004 update Domain Updated
4004 update Transfer Grace Period Expired
4005 renew Domain Renew Successful
4006 delete Domain Deletion Successful
4007 delete Domain Deletion Successful
4008 delete Domain Pending Deletion
4009 update Pending Update Canceled
4009 update Pending Update Cancelled
4010 transfer Domain Transfer Request
4010 transfer Pending Transfer Request
4011 transfer Domain Transfer Successful
4011 transfer Transfer Auto Approved
4012 graceperiod Auto-renew grace period expired
4012 graceperiod Create Grace Period Expired
4012 graceperiod Renew Grace Period Expired
4012 update Pending Update Cancelled
4013 transfer Domain Transfer Canceled
4013 transfer Domain Transfer Cancelled
4013 transfer Domain Transfer Failed Due To No Vote
4013 transfer Pending Transfer Canceled
4014 delete Pending Suspension Canceled
4015 delete Domain Delete Failed Due To Dependencies
4016 delete Domain Suspended. Pending Deletion
4017 ns Domain Hosts Not Found
4017 ns Nameserver Check Failed after one week, resubmit nameservers to check
4018 transfer Domain Transferred Away
4019 transfer Domain not eligible for transfer
4020 delete Pending Deletion Canceled
4021 update Registrant could not be found
4022 transfer Domain Transfer Rejected
4023 transfer Domain Transfer will be rejected on expiry of the pending update
4024 delete Domain in closed redemption
4025 delete Pending Closed Redemption cancelled
4027 delete Pending Grace Period Suspension cancelled
4028 update Pending NS Check cancelled by another process
4029 delete Domain not found
4030 delete Insufficent funds to process domain renewal.
4031 delete Unable to process request after 5 retries
4032 delete Domain deletion failed due to wrong owner
4033 delete Domain Suspended. Pending Deletion
4033 update Domain expiry does not match expiry provided
4034 transfer legacy transfer unsuccessful due to 'No' vote
4035 transfer Transfer Failed to transfer away
4036 update Domain Expired
4050 transfer Domain Auto Renewed Successful
4315 ns Nameservers updated at registry
5001 registrar Low Account Balance

Authentication

Authentication

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$params = [
    'username' => 'yourusername',
    'password' => 'yourpassword'
];

$result = domainsCurl('login', $params, 'POST');

print_r($result);
?>

Successful Response:

{
  "intReturnCode": 1,
  "strUUID": "ecdff640-67f9-11e9-bab0-e5534838c53e",
  "strMessage": "Successful",
  "token": "THE BEARER TOKEN TO BE USED AS YOUR AUTHORIZATION HEADER",
  "strApiHost": "api-dnode01"
}

Method

POST https://api.domains.co.za/api/login

Post Parameters

Parameter Required Description
username yes The Username to authenticate
password yes The Password to authenticate
code no 2 Factor authentication code if enabled

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
token string Your JWT token
strApiHost string This is the api server that handled the transaction

Create 2FA secret

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = array();

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('user/generateAuthSecret', $params, 'GET', $headers);

print_r($result);
?>

Successful Response:

{
  "intReturnCode": 1,
  "strUUID": "ecdec640-67f9-11e9-bab0-e5553956c53e",
  "strMessage": "Successful",
  "imgUrl": "https://url.to/your/qr/image",
  "secret": "The secret key generated for your 2FA",
  "strApiHost": "api-dnode01"
}

Method

GET https://api.domains.co.za/api/user/generateAuthSecret

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
imgUrl string A url to the QR code image
secret string The secret key generated for your 2FA
strApiHost string This is the api server that handled the transaction

Enable 2FA

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = array(
    'code' => 'Code From Auth APP'
);

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('user/enableAuth', $params, 'POST', $headers);

print_r($result);
?>

Successful Response:

{
  "intReturnCode": 1,
  "strUUID": "ecdec640-67f9-11e9-bab0-e5553956c53e",
  "strMessage": "Successful",
  "strApiHost": "api-dnode01"
}

Method

POST https://api.domains.co.za/api/user/enableAuth

Post Parameters

Parameter Required Description
code yes Code from your 2 factor authentication APP

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Disable 2FA

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = array();

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('user/disableAuth', $params, 'GET', $headers);

print_r($result);
?>

Successful Response:

{
  "intReturnCode": 1,
  "strUUID": "ecdec640-67f9-11e9-bab0-e5553956c53e",
  "strMessage": "Successful",
  "strApiHost": "api-dnode01"
}

Method

GET https://api.domains.co.za/api/user/disableAuth

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Get 2FA status

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = array();

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('user/authStatus', $params, 'GET', $headers);

print_r($result);
?>

Successful Response:

{
  "intReturnCode": 1,
  "strUUID": "ecdec640-67f9-11e9-bab0-e5553956c53e",
  "strMessage": "Successful",
  "boolAuthEnabled": true,
  "strApiHost": "api-dnode01"
}

Method

get https://api.domains.co.za/api/user/authStatus

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
boolAuthEnabled boolean True if 2FA is enabled
strApiHost string This is the api server that handled the transaction

Domain

Check

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'isthisregistered',
    'tld' => 'co.za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/check', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "84dc0660-6fc8-11e9-9ad6-c79b8f82757d",
  "strMessage": "Domain Available",
  "usesEppKey": "false",
  "isAvailable": "true",
  "strReason": "",
  "tld": "co.za",
  "sld": "isthisregistered",
  "isPremium": "false",
  "objReseller": {
    "username": "diamatrix",
    "balance": "99999.99",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode02"
}

Checks whether a domain is available or already registered.

HTTP Request

GET /domain/check

Query Parameters

Parameter Type Required Example Description
tld string yes co.za TLD to check
sld string yes mydomainname SLD to check

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
usesEppKey boolean True if the tld makes use of Auth/Epp codes
isAvailable boolean True if the domain is available
strReason string Reason domain would not be available
tld string TLD that was checked
sld string SLD that was checked
isPremium boolean True if the domain is deemed as a premium domain
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

List

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'tld' => 'co.za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/list', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "c8c34d50-6801-11e9-9e65-7f230ae60fdd",
  "strMessage": "Successful",
  "arrDomains": [
    {
      "strDomainName": "mydomainname.co.za",
      "contactName": "John Doe",
      "strContactID": "EPPUniqueID",
      "status": "ok",
      "eppStatus": "ok",
      "strDns": 0,
      "createdDate": 1557481679,
      "expiryDate": 1652227199,
      "suspendDate": 1652659199,
      "redemptionDate": 1653091199,
      "deleteDate": 1655683199,
      "autorenew": 1,
      "externalRef": null,
      "nameservers": [
        "ns1.mynameserver.co.za",
        "ns2.mynameserver.co.za"
      ]
    }
  ],
  "intTotal": 100,
  "intFilterTotal": 1,
  "intReturnedTotal": 1,
  "objReseller": {
    "username": "yourusername",
    "balance": "100.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode03"
}

This function will give you a filtered list of domains

HTTP Request

GET /domain/list

Query Parameters

Parameter Required Description
tld no TLD to filter the list on

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrDomains array Contains domain details as shown in the below table
intTotal integer Total entries found
intFilterTotal integer Total entries found after filter is applied
intReturnedTotal integer Total entries returned
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Domain Details Array

Parameter Type Description
strDomainName string The full domain name
contactName string The registrant contact persons name
strContactID string Unique epp contact ID for the registrant contact object
status string Contains the simple status of the domain name
eppStatus string Contains the EPP status of the domain name
strDns integer A value of 1 indicates that premium DNS is enabled on the domain
createdDate integer The creation date of the domain in unix timestamp format
expiryDate integer The expiry date of the domain in unix timestamp format
suspendDate integer The suspension date of the domain (if not renewed) in unix timestamp format
redemptionDate integer The redemption date of the domain (if not renewed) in unix timestamp format
deleteDate integer The deletion date of the domain (if not renewed) in unix timestamp format
autorenew integer A value of 1 indicates that autorenew is enabled
externalRef string A customized reference for the domain name
nameservers array An array of nameservers strings

Info

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'co.za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
    "intReturnCode":1,
    "strUUID":"78ce8af0-755e-11e9-b44c-ff071d671d7a",
    "strMessage":"Successful",
    "strDomainName":"mydomainname.co.za",
    "strStatus":"ok",
    "strEppStatus":"ok",
    "arrRegistrant":
    {
        "strContactId":"58be5d32ddef2",
        "strContactName":"John Doe",
        "strContactEmail":"john.doe@mydomainname.co.za",
        "strContactNumber":"+27.0123456789",
        "strContactCompany":"My Company",
        "strContactAddress":["219 Osborn Rd","Houghton Estate Office Park",""],
        "strContactCity":"Johannesburg",
        "strContactProvince":"Gauteng",
        "strContactPostalCode":"2198",
        "strContactCountry":"ZA",
        "strContactFax":"",
        "strContactType":"registrant",
        "strStatus":"ok,linked",
        "strVerificationStatus":"Verified"
    },
    "arrAdmin":
    {
        "strContactId":"58be5d34423b7",
        "strContactName":"My Company",
        "strContactEmail":"admin@mycompany.co.za",
        "strContactNumber":"+27.0123456789",
        "strContactCompany":"My Company",
        "strContactAddress":["2nd Floor, Palm Grove, Houghton Estate Office Park","219 Osborn Road, Houghton Estate",""],
        "strContactCity":"Johannesburg",
        "strContactProvince":"Gauteng",
        "strContactPostalCode":"2192",
        "strContactCountry":"ZA",
        "strContactFax":"",
        "strContactType":"admin",
        "strStatus":"ok,linked"
    },
    "arrTech":
    {
        "strContactId":"58be5d3455a7b",
        "strContactName":"My Company",
        "strContactEmail":"tech@mycompany.co.za",
        "strContactNumber":"+27.0123456789",
        "strContactCompany":"My Company",
        "strContactAddress":["2nd Floor, Palm Grove, Houghton Estate Office Park","219 Osborn Road, Houghton Estate",""],
        "strContactCity":"Johannesburg",
        "strContactProvince":"Gauteng",
        "strContactPostalCode":"2192",
        "strContactCountry":"ZA",
        "strContactFax":"",
        "strContactType":"tech",
        "strStatus":"ok,linked"
    },
    "arrBilling":
    {
        "strContactId":"58be5d344b898",
        "strContactName":"My Company",
        "strContactEmail":"billing@mycompany.co.za",
        "strContactNumber":"+27.0123456789",
        "strContactCompany":"My Company",
        "strContactAddress":["2nd Floor, Palm Grove, Houghton Estate Office Park","219 Osborn Road, Houghton Estate",""],
        "strContactCity":"Johannesburg",
        "strContactProvince":"Gauteng",
        "strContactPostalCode":"2192",
        "strContactCountry":"ZA",
        "strContactFax":"",
        "strContactType":"billing",
        "strStatus":"ok,linked"
    },
    "strDns":0,
    "strNameserverType":"host",
    "arrNameservers":[
        "ns1.mynameserver.co.za",
        "ns2.mynameserver.co.za",
        "ns3.mynameserver.co.za",
        "ns4.mynameserver.co.za"
    ],
    "autorenew":"true",
    "intCrDate":1488870708,
    "intExDate":1583565108,
    "intSuspendDate":1583997108,
    "intRedemptionDate":1584429108,
    "intDeleteDate":1587021108,
    "intLastRenewedDate":1551763874,
    "intUpDate":1583565108,
    "bPrivacy":false,
    "bDNSSec":false,
    "externalRef":"",
    "objReseller":{
        "username":"yourusername",
        "balance":"9999.99",
        "accountType":"pre",
        "lowBalance":false
    },
    "strApiHost":"api-dnode04"
}

The following will give you all the information of a domain under your account

HTTP Request

GET /domain

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strDomainName string The full domain name
strStatus string Contains the simple status of the domain name
strEppStatus string Contains the EPP status of the domain name
arrRegistrant ContactObject Registrant contact object
arrAdmin ContactObject Registrant contact object
arrTech ContactObject Registrant contact object
arrBilling ContactObject Registrant contact object
strDns integer A value of 1 indicates that premium DNS is enabled on the domain
strNameserverType string Indicates the type of nameservers being used
arrNameservers array An array of nameservers strings
autorenew boolean Indicates whether or not autorenew is enabled
intCrDate integer The creation date of the domain in unix timestamp format
intExDate integer The expiry date of the domain in unix timestamp format
intSuspendDate integer The expected suspension date for the domain in unix timestamp format
intRedemptionDate integer The expected redemption date for the domain in unix timestamp format
intDeleteDate integer The expected deletion date for the domain in unix timestamp format
intLastRenewedDate integer The date that the domain was last renewed in unix timestamp format
intUpDate integer The date that the domain was last updated in unix timestamp format
bPrivacy boolean Whether or not whois privacy is enabled on the domain
bDNSSec boolean Whether or not DNSSec is enabled on the domain
externalRef string A customized reference for the domain name
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Create

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'mydomainname',
    'tld' => 'co.za',
    'registrantName' => 'John Doe',
    'registrantEmail' => 'john.doe@mydomainname.co.za',
    'registrantCountry' => 'ZA',
    'registrantProvince' => 'Gauteng',
    'registrantContactNumber' => '+27.0123456789',
    'registrantPostalCode' => '2198',
    'registrantAddress1' => '219 Osborn Rd',
    'registrantAddress2' => 'Houghton Estate Office Park',
    'registrantCity' => 'Johannesburg',
    'period' => '1',
    'ns1' => 'ns1.mynameserver.co.za',
    'ns2' => 'ns2.mynameserver.co.za',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "7ec167a0-0034-11ec-80f6-13a1aba3d2d2",
  "strMessage": "Successful",
  "strEppMessage": "Domain Create completed successfully",
  "strEppReason": "",
  "strRegistrant": "ZLAKv3J3JAvLukkP",
  "strDomainName": "mydomainname.co.za",
  "intExDate": 1660834602,
  "intCrDate": 1629298602,
  "strApiHost": "api-dnode05"
}

This registers a new domain name and places it under your account

HTTP Request

POST /domain

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
period yes The number of years to register the domain
nsTemplate no Nameserver template to use instead of specifying servers manually. See more on templates here
dns no Select managed to use Domains Premium DNS and custom to use details provided in ns1,ns2, ...
ns1 no First nameserver to be used by your domain
ns2 no Second nameserver to be used by your domain
ns3 no Third nameserver to be used by your domain
ns4 no Fourth nameserver to be used by your domain
ns5 no Fifth nameserver to be used by your domain
registrantTemplate no The registrant contact template to use instead of specifying details manually. See more on templates here
registrantName no The registrant contact persons name
registrantEmail no The registrant contact persons email address
registrantCountry no The registrant contact persons country in ISO 3166-1 alpha-2 code
registrantProvince no The registrant contact persons state or province
registrantContactNumber no The registrant contact persons contact number
registrantPostalCode no The registrant contact persons area or postal code
registrantAddress1 no The registrant contact persons address line 1
registrantAddress2 no The registrant contact persons address line 2
registrantAddress3 no The registrant contact persons address line 3
registrantCity no The registrant contact persons city
adminTemplate no The admin contact template to use instead of specifying details manually. See more on templates here
adminName no The admin contact persons name
adminEmail no The admin contact persons email address
adminCountry no The admin contact persons country in ISO 3166-1 alpha-2 code
adminProvince no The admin contact persons state or province
adminContactNumber no The admin contact persons contact number
adminPostalCode no The admin contact persons area or postal code
adminAddress1 no The admin contact persons address line 1
adminAddress2 no The admin contact persons address line 2
adminAddress3 no The admin contact persons address line 3
adminCity no The admin contact persons city
billingTemplate no The billing contact template to use instead of specifying details manually. See more on templates here
billingName no The billing contact persons name
billingEmail no The billing contact persons email address
billingCountry no The billing contact persons country in ISO 3166-1 alpha-2 code
billingProvince no The billing contact persons state or province
billingContactNumber no The billing contact persons contact number
billingPostalCode no The billing contact persons area or postal code
billingAddress1 no The billing contact persons address line 1
billingAddress2 no The billing contact persons address line 2
billingAddress3 no The billing contact persons address line 3
billingCity no The billing contact persons city
techTemplate no The tech contact template to use instead of specifying details manually. See more on templates here
techName no The tech contact persons name
techEmail no The tech contact persons email address
techCountry no The tech contact persons country in ISO 3166-1 alpha-2 code
techProvince no The tech contact persons state or province
techContactNumber no The tech contact persons contact number
techPostalCode no The tech contact persons area or postal code
techAddress1 no The tech contact persons address line 1
techAddress2 no The tech contact persons address line 2
techAddress3 no The tech contact persons address line 3
techCity no The tech contact persons city

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strEppMessage string Returned status message from the EPP provider
strEppReason string Epp failure reason message from the EPP provider
strRegistrant string Registrant Unique ID for the domain
strDomainName string The full domain name
intCrDate integer The creation date of the domain in unix timestamp format
intExDate integer The expiry date of the domain in unix timestamp format
strApiHost string This is the api server that handled the transaction

Delete

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'co.za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain', $params, 'DELETE', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode":2,
  "strUUID":"226e3a60-7566-11e9-8d95-bbb78b81b617",
  "strMessage":"Pending Action Successful",
  "objReseller":{
      "username":"yourusername",
      "balance":"100913.20",
      "accountType":"pre",
      "lowBalance":false
  },
  "strApiHost":"api-dnode05"
}

Marks a domain on your account for deletion

HTTP Request

DELETE /domain

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Update Contacts

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'mydomainname',
    'tld' => 'co.za',
    'adminName' => 'John Doe',
    'adminEmail' => 'john.doe@mydomainname.co.za',
    'adminCountry' => 'ZA',
    'adminProvince' => 'Gauteng',
    'adminContactNumber' => '+27.0123456789',
    'adminPostalCode' => '2198',
    'adminAddress1' => '219 Osborn Rd',
    'adminCity' => 'Johannesburg',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain', $params, 'PUT', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 2,
  "strUUID": "162ebfc0-00cc-11ec-bc93-e77197186ff2",
  "strMessage": "Successful Action Pending",
  "strApiHost": "api-dnode06"
}

This updates domain contact information

HTTP Request

PUT /domain

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
registrantTemplate no The registrant contact template to use instead of specifying details manually. See more on templates here
registrantName no The registrant contact persons name
registrantEmail no The registrant contact persons email address
registrantCountry no The registrant contact persons country in ISO 3166-1 alpha-2 code
registrantProvince no The registrant contact persons state or province
registrantContactNumber no The registrant contact persons contact number
registrantPostalCode no The registrant contact persons area or postal code
registrantAddress1 no The registrant contact persons address line 1
registrantAddress2 no The registrant contact persons address line 2
registrantAddress3 no The registrant contact persons address line 3
registrantCity no The registrant contact persons city
adminTemplate no The admin contact template to use instead of specifying details manually. See more on templates here
adminName no The admin contact persons name
adminEmail no The admin contact persons email address
adminCountry no The admin contact persons country in ISO 3166-1 alpha-2 code
adminProvince no The admin contact persons state or province
adminContactNumber no The admin contact persons contact number
adminPostalCode no The admin contact persons area or postal code
adminAddress1 no The admin contact persons address line 1
adminAddress2 no The admin contact persons address line 2
adminAddress3 no The admin contact persons address line 3
adminCity no The admin contact persons city
billingTemplate no The billing contact template to use instead of specifying details manually. See more on templates here
billingName no The billing contact persons name
billingEmail no The billing contact persons email address
billingCountry no The billing contact persons country in ISO 3166-1 alpha-2 code
billingProvince no The billing contact persons state or province
billingContactNumber no The billing contact persons contact number
billingPostalCode no The billing contact persons area or postal code
billingAddress1 no The billing contact persons address line 1
billingAddress2 no The billing contact persons address line 2
billingAddress3 no The billing contact persons address line 3
billingCity no The billing contact persons city
techTemplate no The tech contact template to use instead of specifying details manually. See more on templates here
techName no The tech contact persons name
techEmail no The tech contact persons email address
techCountry no The tech contact persons country in ISO 3166-1 alpha-2 code
techProvince no The tech contact persons state or province
techContactNumber no The tech contact persons contact number
techPostalCode no The tech contact persons area or postal code
techAddress1 no The tech contact persons address line 1
techAddress2 no The tech contact persons address line 2
techAddress3 no The tech contact persons address line 3
techCity no The tech contact persons city

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Update Nameservers

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'mydomainname',
    'tld' => 'co.za',
    'ns1' => 'ns1.mynewns.co.za',
    'ns2' => 'ns2.mynewns.co.za',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/ns', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 2,
  "strUUID": "1875f890-00f1-11ec-8152-c331a41cac2b",
  "strMessage": "Successful Action Pending",
  "strEppMessage": "Domain update action 'PendingUpdate' pending",
  "strEppReason": "",
  "strApiHost": "api-dnode07"
}

dnsSecData Json

[
    {
      "key":"YourPublicKey",
      "alg":"8",
      "protocol":"3"
    },
    {
      "key": "YourPublicKey2",
      "alg": "8",
      "protocol": "3"
    }
]

dnsSecData encoded

$params = [
    'sld' => 'mydomainname',
    'tld' => 'co.za',
    'dnsSec' => '1',
    'dnsSecData' => base64_encode(json_encode($dnsSecData))
];

This updates domain nameservers

HTTP Request

POST /domain/ns

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
nsTemplate no Nameserver template to use instead of specifying servers manually. See more on templates here
dns no Defaults to custom. Set to managed to make use of Domains Premium DNS
ns1 no First nameserver to be used if dns = 'custom'
ns2 no Second nameserver to be used if dns = 'custom'
ns3 no Third nameserver to be used if dns = 'custom'
ns4 no Fourth nameserver to be used if dns = 'custom'
ns5 no Fifth nameserver to be used if dns = 'custom'
dnsSec no Whether or not DNSSec should be used
dnsSecData no Base64 encoded Json string of DNSSec data

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strEppMessage string Returned status message from the EPP provider
strEppReason string Epp failure reason message from the EPP provider
strApiHost string This is the api server that handled the transaction

Autorenew

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'com',
    'autorenew' => 'true'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/autorenew', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "204ae3c0-00f6-11ec-9abe-dda5b6246ebd",
  "strMessage": "Successful",
  "strDomainName": "mydomainname.com",
  "strApiHost": "api-dnode08"
}

Enables or disables autorenew on a domain name

HTTP Request

POST /domain/autorenew

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
autorenew no Either true or false

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strDomainName string Domain name that has been modified
strApiHost string This is the api server that handled the transaction

Renew

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'org.za',
    'period' => '1'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/renew', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "052ccc00-00f9-11ec-bb57-296fafdbe9a6",
  "strMessage": "Successful",
  "strEppMessage": "Domain renewed successfully",
  "strEppReason": "",
  "intExDate": 1692370602,
  "strDomainName": "mydomainname.org.za",
  "strApiHost": "api-dnode09"
}

Renews a domain name

HTTP Request

POST /domain/renew

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
period no Defaults to 1
note no Customized note to go with renewal. This will display in billing history

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strEppMessage string Returned status message from the EPP provider
strEppReason string Epp failure reason message from the EPP provider
intExDate integer The new expiry date of the domain in unix timestamp format
strDomainName string Domain name that has been modified
strApiHost string This is the api server that handled the transaction

Lock

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'com',
    'action' => 'lock'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/lock', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "245e3040-019a-11ec-8581-c9ed8eeb1be7",
  "strMessage": "Successful",
  "strApiHost": "api-dnode01"
}

Grace Period Error Response:

{
    "intReturnCode": 3,
    "strUUID": "1c1a5630-019b-11ec-8b94-45a487a2757c",
    "strMessage": "Domain is within grace period and cannot be unlocked.",
    "strApiHost": "api-dnode01"
}

Locks a domain name at the registry

HTTP Request

POST /domain/lock

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
action yes Can be either lock or unlock

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Get lock Status

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'com'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/lock', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "9657f520-019b-11ec-9427-f580c01c6a63",
  "strMessage": "Successful",
  "strDomainName": "mydomainname.com",
  "strLockStatus": "locked",
  "strApiHost": "api-dnode01"
}

Gets the lock status of a domain name

HTTP Request

GET /domain/lock

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strDomainName string Domain name that has been modified
strLockStatus string Whether the domain is locked or unlocked
strApiHost string This is the api server that handled the transaction

Suspend

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'com'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/suspend', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "a9115900-019c-11ec-8dbd-b3df13bc4d8c",
  "strMessage": "Successful",
  "strEppMessage": "Command completed successfully",
  "strEppReason": "",
  "strApiHost": "api-dnode01"
}

Suspends a domain name at the registry

HTTP Request

POST /domain/suspend

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strEppMessage string Returned status message from the EPP provider
strEppReason string Epp failure reason message from the EPP provider
strApiHost string This is the api server that handled the transaction

Unsuspend

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'com'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/unsuspend', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "d6fc8c60-019e-11ec-a1f9-abd86f303d13",
  "strMessage": "Successful",
  "strEppMessage": "Command completed successfully",
  "strEppReason": "",
  "strApiHost": "api-dnode01"
}

Unsuspends a domain name at the registry

HTTP Request

POST /domain/unsuspend

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strEppMessage string Returned status message from the EPP provider
strEppReason string Epp failure reason message from the EPP provider
strApiHost string This is the api server that handled the transaction

Send Auth Code / EPP Key

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'com'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/sendAuthCode', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "d6fc8c60-019e-11ec-a1f9-abd86f303d13",
  "strMessage": "Successful",
  "strEppMessage": "Command completed successfully",
  "strEppReason": "",
  "strApiHost": "api-dnode01"
}

Locked Error Response

{
    "intReturnCode": 12,
    "strUUID": "c5c8cd10-01a0-11ec-b1e3-655d19e929dd",
    "strMessage": "Domain is locked. Please unlock first.",
    "strApiHost": "api-dnode01"
}

Send the domains EPP Key / Auth code to the domain registrant contact

HTTP Request

POST /domain/sendAuthCode

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Get Auth Code / EPP Key

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'com'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/eppKey', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "08f0a5a0-0b2c-11ec-8552-810a2b1bc80b",
  "strMessage": "Successful",
  "strEPPKey": "DWCLw;YU6kzqZykz",
  "strDomainName": "mydomainname.com",
  "objReseller": {
    "username": "myusername",
    "balance": "123456.78",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

Locked Error Response

{
  "intReturnCode": 12,
  "strUUID": "3b580a10-0b2d-11ec-82c1-771b95f8937b",
  "strMessage": "Epp Key can only be retrieved when the domain has been unlocked",
  "strApiHost": "api-dnode05"
}

Gets the domains EPP Key / Auth code

HTTP Request

GET /domain/eppKey

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strEPPKey string The EPP Key / Auth Code for the domain
strDomainName string The domain name in question
strApiHost string This is the api server that handled the transaction

Request Transfer

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'mydomainname',
    'tld' => 'co.za',
    'registrantName' => 'John Doe',
    'registrantEmail' => 'john.doe@mydomainname.co.za',
    'registrantCountry' => 'ZA',
    'registrantProvince' => 'Gauteng',
    'registrantContactNumber' => '+27.0123456789',
    'registrantPostalCode' => '2198',
    'registrantAddress1' => '219 Osborn Rd',
    'registrantCity' => 'Johannesburg',
    'ns1' => 'ns1.mynameserver.co.za',
    'ns2' => 'ns2.mynameserver.co.za',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/transfer', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "29c629b0-0b13-11ec-a77d-df472faa9b58",
  "strMessage": "Successful",
  "objReseller": {
    "username": "myusername",
    "balance": "140.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api-dnode05"
}

This requests a transfer of a domain name to your account

HTTP Request

POST /domain/transfer

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
eppKey no Icann tlds require an eppKey to be sent. ZACR (.za) tlds do not require an eppKey
dnsTemplate no Nameserver template to use instead of specifying servers manually. See more on templates here
dns no Select managed to use Domains Premium DNS, keep to retain the domains current nameservers and custom to use details provided in ns1,ns2, ...
ns1 no First nameserver to be used by your domain
ns2 no Second nameserver to be used by your domain
ns3 no Third nameserver to be used by your domain
ns4 no Fourth nameserver to be used by your domain
ns5 no Fifth nameserver to be used by your domain
registrantTemplate no The registrant contact template to use instead of specifying details manually. See more on templates here
registrantName no The registrant contact persons name
registrantEmail no The registrant contact persons email address
registrantCountry no The registrant contact persons country in ISO 3166-1 alpha-2 code
registrantProvince no The registrant contact persons state or province
registrantContactNumber no The registrant contact persons contact number
registrantPostalCode no The registrant contact persons area or postal code
registrantAddress1 no The registrant contact persons address line 1
registrantAddress2 no The registrant contact persons address line 2
registrantAddress3 no The registrant contact persons address line 3
registrantCity no The registrant contact persons city
adminTemplate no The admin contact template to use instead of specifying details manually. See more on templates here
adminName no The admin contact persons name
adminEmail no The admin contact persons email address
adminCountry no The admin contact persons country in ISO 3166-1 alpha-2 code
adminProvince no The admin contact persons state or province
adminContactNumber no The admin contact persons contact number
adminPostalCode no The admin contact persons area or postal code
adminAddress1 no The admin contact persons address line 1
adminAddress2 no The admin contact persons address line 2
adminAddress3 no The admin contact persons address line 3
adminCity no The admin contact persons city
billingTemplate no The billing contact template to use instead of specifying details manually. See more on templates here
billingName no The billing contact persons name
billingEmail no The billing contact persons email address
billingCountry no The billing contact persons country in ISO 3166-1 alpha-2 code
billingProvince no The billing contact persons state or province
billingContactNumber no The billing contact persons contact number
billingPostalCode no The billing contact persons area or postal code
billingAddress1 no The billing contact persons address line 1
billingAddress2 no The billing contact persons address line 2
billingAddress3 no The billing contact persons address line 3
billingCity no The billing contact persons city
techTemplate no The tech contact template to use instead of specifying details manually. See more on templates here
techName no The tech contact persons name
techEmail no The tech contact persons email address
techCountry no The tech contact persons country in ISO 3166-1 alpha-2 code
techProvince no The tech contact persons state or province
techContactNumber no The tech contact persons contact number
techPostalCode no The tech contact persons area or postal code
techAddress1 no The tech contact persons address line 1
techAddress2 no The tech contact persons address line 2
techAddress3 no The tech contact persons address line 3
techCity no The tech contact persons city
externalRef no Custom reference for the transfer request

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Get Transfer Status

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'mydomainname',
    'tld' => 'org.za',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/transfer', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "b8e96180-0b22-11ec-b4d5-df8f3d45291a",
  "strMessage": "Successful",
  "arrDomains": [
    {
      "strDomainName": "mydomainname.org.za",
      "requestDate": 1630493748,
      "status": "pending"
    }
  ],
  "objReseller": {
    "username": "myusername",
    "balance": "140.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api-dnode05"
}

This gets the status of a transfer request

HTTP Request

GET /domain/transfer

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrDomains array An array of domain transfers for a domain
strApiHost string This is the api server that handled the transaction

Domain Transfer Array

Parameter Type Description
strDomainName string The domain name in question
requestDate string The transfer request date of the domain in unix timestamp format
status string The status of the domain transfer

Cancel Transfer

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'mydomainname',
    'tld' => 'org.za',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/transfer', $params, 'DELETE', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "7dd0a080-0b23-11ec-bee0-31161d82d7b7",
  "strMessage": "Transfer Cancelled",
  "objReseller": {
    "username": "myusername",
    "balance": "140.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api-dnode05"
}

Cancels a transfer request for a domain

HTTP Request

DELETE /domain/transfer

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Resend Transfer Foa

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'mydomainname',
    'tld' => 'org.za',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/transfer/resendFoa', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "76a8b570-0b2c-11ec-8ad5-d5820983957e",
  "strMessage": "Successful",
  "objReseller": {
    "username": "myusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

Resends a transfer FOA

HTTP Request

POST /domain/transfer/resendFoa

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Validate Transfer EppKey

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld'  => 'mydomainname',
    'tld'  => 'com',
    'auth' => '2a.x2h6cw4fJC8Nc'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/validateEppKey', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "c492c030-0b2d-11ec-9f91-e5736f95ebe1",
  "strMessage": "Successful",
  "isValid": true,
  "objReseller": {
    "username": "myusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

Validates a domain Epp Key / Auth code against a domain

HTTP Request

GET /domain/validateEppKey

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
auth yes Auth Code to validate for the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
isValid boolean true if the Epp Key is valid, false otherwise
strApiHost string This is the api server that handled the transaction

Get Transfer Details

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'transferKey' => 'cda6f64d3f9116c9399402024da40667'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/transfer/details', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "3c6c02b0-0b2f-11ec-b217-ab94ea9ee572",
  "strMessage": "Successful",
  "sld": "testdomain",
  "tld": "com",
  "resellerCompany": "Diamatrix Reseller Company ",
  "resellerEmail": "john.doe@mydomainname.co.za",
  "gainingCompany": "John Doe",
  "requestDate": "01 Sep 2021 15:54:54",
  "requestCompleteDate": "06 Sep 2021 15:54:54",
  "direction": "in",
  "type": "internal",
  "objReseller": {
    "username": "myusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

This gets the details of a domain transfer from a unique key sent to both registrant and registrar via email

HTTP Request

GET /domain/transfer/details

Query Parameters

Parameter Required Description
transferKey yes Unique transfer accept key

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
sld string The SLD of the domain name in question
tld string The TLD of the domain name in question
resellerCompany string The reseller company name
resellerEmail string The reseller contact email
gainingCompany string The gaining company name
requestDate string The request date of the transfer
requestCompleteDate string The latest date that the transfer of the domain will be concluded
direction string The direction of the transfer of the domain. Either in or out
type string Whether the domain transfer is internal to the registrar (reseller to reseller under the same registrar) or external (registrar to registrar)
strApiHost string This is the api server that handled the transaction

Get Transfer In List

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/transfer/transferInList', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "ead34e80-0b30-11ec-92f3-25146bcbfa76",
  "strMessage": "Successful",
  "arrDomains": [
    {
      "strDomainName": "testtransfer.com",
      "sld": "testtransfer",
      "tld": "com",
      "status": "Transfer Pending",
      "requestDate": 1630504494
    },
    {
      "strDomainName": "testtransfer2.org.za",
      "sld": "testtransfer2",
      "tld": "org.za",
      "status": "Transfer Pending",
      "requestDate": 1630504131
    },
    {
      "strDomainName": "testtransfer3.co.za",
      "sld": "testtransfer3",
      "tld": "co.za",
      "status": "Cancelled",
      "requestDate": 1630493748
    }
  ],
  "intReturnedTotal": 3,
  "intFilterTotal": 3,
  "intTotal": 3,
  "objReseller": {
    "username": "myusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api_dnode03"
}

Gets a list of your incoming domain transfer requests

HTTP Request

GET /domain/transfer/transferInList

Query Parameters

Parameter Required Description
sortBy no Which field to sort the returned result by. Options are strDomainName, requestDate, strStatus and createdAt
order no Order to sort by. Options are ascending or descending
startPoint no For pagination, the start point for the returned results
limit no For pagination, the amount of entries to return
search no A specific keyword to search for

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrDomains array Array of domains transferring in. See table below
intReturnedTotal integer Total entries returned in result for pagination
intFilterTotal integer Total entries found with applied filters
intTotal integer Total entries found
strApiHost string This is the api server that handled the transaction

Transfer In List Array

Parameter Type Description
strDomainName string The domain name transferring in
sld string The SLD of the domain name transferring in
tld string The TLD of the domain name transferring in
status string The status of the domain transfer
requestDate string The date of the domain transfer request in Unix timestamp format

Get Transfer Out List

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/transfer/transferOutList', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "ead34e80-0b30-11ec-92f3-25146bcbfa76",
  "strMessage": "Successful",
  "arrDomains": [
    {
      "strDomainName": "testtransfer.com",
      "sld": "testtransfer",
      "tld": "com",
      "status": "Transfer Pending",
      "requestDate": 1630504494
    },
    {
      "strDomainName": "testtransfer2.org.za",
      "sld": "testtransfer2",
      "tld": "org.za",
      "status": "Transfer Pending",
      "requestDate": 1630504131
    },
    {
      "strDomainName": "testtransfer3.co.za",
      "sld": "testtransfer3",
      "tld": "co.za",
      "status": "Cancelled",
      "requestDate": 1630493748
    }
  ],
  "intReturnedTotal": 3,
  "intFilterTotal": 3,
  "intTotal": 3,
  "objReseller": {
    "username": "myusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api_dnode03"
}

Gets a list of your outgoing domain transfers

HTTP Request

GET /domain/transfer/transferOutList

Query Parameters

Parameter Required Description
sortBy no Which field to sort the returned result by. Options are strDomainName, requestDate, strStatus and createdAt
order no Order to sort by. Options are ascending or descending
startPoint no For pagination, the start point for the returned results
limit no For pagination, the amount of entries to return
search no A specific keyword to search for

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrDomains array Array of domains transferring out. See table below
intReturnedTotal integer Total entries returned in result for pagination
intFilterTotal integer Total entries found with applied filters
intTotal integer Total entries found
strApiHost string This is the api server that handled the transaction

Transfer Out List Array

Parameter Type Description
strDomainName string The domain name transferring out
sld string The SLD of the domain name transferring out
tld string The TLD of the domain name transferring out
status string The status of the domain transfer
requestDate string The date of the domain transfer request in Unix timestamp format

Respond To Domain Transfer

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'mydomainname',
    'tld' => 'org.za',
    'response' => 'approve',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/transfer/response', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "41bd7010-0b33-11ec-a16e-47dea70deb14",
  "strMessage": "Successful",
  "strApiHost": "api-dnode05"
}

Responds to a transfer request for a domain

HTTP Request

POST /domain/transfer/response

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
response yes Whether to approve or reject the transfer request
key yes The unique transfer key sent to the registrant and registrar

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Get Glue Records

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'org.za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/gluerecords', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "36a6d360-01ab-11ec-af9e-393e02502883",
  "strMessage": "Successful",
  "strNs1": "ns1.mydomainname.org.za",
  "strNs1_ipv4": "123.123.123.123",
  "strNs1_ipv6": "",
  "strNs2": "ns2.mydomainname.org.za",
  "strNs2_ipv4": "234.234.234.234",
  "strNs2_ipv6": "",
  "strNs3": null,
  "strNs3_ipv4": null,
  "strNs3_ipv6": null,
  "strNs4": null,
  "strNs4_ipv4": null,
  "strNs4_ipv6": null,
  "strNs5": null,
  "strNs5_ipv4": null,
  "strNs5_ipv6": null,
  "strApiHost": "api-dnode01"
}

Gets glue records for a domain

HTTP Request

GET /domain/gluerecords

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strNs1 string The first nameserver used by the domain
strNs1_ipv4 string The first nameserver IP v4 address
strNs1_ipv6 string The first nameserver IP v6 address
strNs2 string The second nameserver used by the domain
strNs2_ipv4 string The second nameserver IP v4 address
strNs2_ipv6 string The second nameserver IP v6 address
strNs3 string The third nameserver used by the domain
strNs3_ipv4 string The third nameserver IP v4 address
strNs3_ipv6 string The third nameserver IP v6 address
strNs4 string The fourth nameserver used by the domain
strNs4_ipv4 string The fourth nameserver IP v4 address
strNs4_ipv6 string The fourth nameserver IP v6 address
strNs5 string The fifth nameserver used by the domain
strNs5_ipv4 string The fifth nameserver IP v4 address
strNs5_ipv6 string The fifth nameserver IP v6 address
strApiHost string This is the api server that handled the transaction

Set Glue Records

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'org.za',
    'ns1' => 'ns1.mydomainname.org.za',
    'ns1-ip4' => '123.123.123.123',
    'ns2' => 'ns2.mydomainname.org.za',
    'ns2-ip4' => '234.234.234.234',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/gluerecords', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 2,
  "strUUID": "0fb13250-01ab-11ec-bf94-95a589ee8e47",
  "strMessage": "Pending Action Successful",
  "strEppMessage": "Domain update action 'PendingUpdate' pending",
  "strEppReason": "",
  "strApiHost": "api-dnode01"
}

Sets glue records on a domain

HTTP Request

POST /domain/gluerecords

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
ns1 yes The FQDN of the first NS record
ns1-ip4 no The IPv4 address of the first NS record
ns1-ip6 no The IPv6 address of the first NS record
ns2 yes The FQDN of the second NS record
ns2-ip4 no The IPv4 address of the second NS record
ns2-ip6 no The IPv6 address of the second NS record
ns3 no The FQDN of the third NS record
ns3-ip4 no The IPv4 address of the third NS record
ns3-ip6 no The IPv6 address of the third NS record
ns4 no The FQDN of the fourth NS record
ns4-ip4 no The IPv4 address of the fourth NS record
ns4-ip6 no The IPv6 address of the fourth NS record
ns5 no The FQDN of the fifth NS record
ns5-ip4 no The IPv4 address of the fifth NS record
ns5-ip6 no The IPv6 address of the fifth NS record

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strEppMessage string Returned status message from the EPP provider
strEppReason string Epp failure reason message from the EPP provider
strApiHost string This is the api server that handled the transaction

Get Host Records

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'com',
    'host' => 'ns1.mydomainname.com'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/hostrecords', $params, 'GET', $headers);

print_r($result);
?>

Success Response without a host parameter specified:

{
  "intReturnCode": 1,
  "strUUID": "eaa40a10-01bf-11ec-b25b-37183fa074ed",
  "strMessage": "Successful",
  "arrHosts": [
    "ns1.mydomainname.com",
    "ns2.mydomainname.com"
  ],
  "strApiHost": "api-dnode03"
}

Success Response with a host parameter:

{
  "intReturnCode": 1,
  "strUUID": "16f49970-01c0-11ec-b6db-373e4c8759ab",
  "strMessage": "Successful",
  "strHostName": "ns1.mydomainname.com",
  "arrIPs": [
    {
      "type": "v4",
      "ip": "123.123.123.123"
    }
  ],
  "strApiHost": "api-dnode02"
}

Gets host records for a domain

HTTP Request

GET /domain/hostrecords

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
host no The host record that you want more information on

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strHostName string The host record in question
arrIPs array An array of IPs linked to the host record
strApiHost string This is the api server that handled the transaction

Set Host Records

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'com',
    'host' => 'ns1.mydomainname.com',
    'host1-ip4' => '123.123.123.123',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/hostrecords', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "f37a6160-01be-11ec-a81b-f35d08ca2e47",
  "strMessage": "Successful",
  "strEppMessage": "Command completed successfully",
  "strEppReason": "",
  "strApiHost": "api-dnode01"
}

Adds a host record to a domain

HTTP Request

POST /domain/hostrecords

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
host yes The FQDN of the NS record
host1-ip4 yes The first IPv4 address of the host record
host1-ip6 no The first IPv6 address of the host record
host2-ip4 no The second IPv4 address of the host record
host2-ip6 no The second IPv6 address of the host record

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strEppMessage string Returned status message from the EPP provider
strEppReason string Epp failure reason message from the EPP provider
strApiHost string This is the api server that handled the transaction

Delete Host Records

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//Optional Params to filter by tld
$params = [
    'sld' => 'mydomainname',
    'tld' => 'com',
    'host' => 'ns1.mydomainname.com'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/hostrecords', $params, 'DELETE', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "bbf48180-01c1-11ec-8b98-5b502ad53c76",
  "strMessage": "Successful",
  "strEppMessage": "Command completed successfully",
  "strEppReason": "",
  "strApiHost": "api-dnode01"
}

Removes a host record from a domain

HTTP Request

DELETE /domain/hostrecords

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
host yes The host record that you want to remove from the domain

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strEppMessage string Returned status message from the EPP provider
strEppReason string Epp failure reason message from the EPP provider
strApiHost string This is the api server that handled the transaction

Get DS Records

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'mydomain',
    'tld' => 'com'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/dsrecords', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "7ed60520-03ea-11ec-b420-bdae9a3a5416",
  "strMessage": "Successful",
  "bDNSSec": true,
  "arrDsRecords": [
    {
      "keyTag": "48422",
      "alg": "13",
      "digestType": "1",
      "digest": "FAC29A470E836B45FA9A451865C1B0284AA6924D"
    },
    {
      "keyTag": "48422",
      "alg": "13",
      "digestType": "2",
      "digest": "68664E0D66F3F24135F48A88F958EC68B74C46CF52D36EF1EAA018B154B1006B"
    },
    {
      "keyTag": "48422",
      "alg": "13",
      "digestType": "4",
      "digest": "FF8E8AB80A60F056AB70D038969FCA1E4770EDB87A104BC8BAA219D134C5194B594E80C362159EB3828A1B9388828215"
    }
  ],
  "strApiHost": "api04_dnode02"
}

Gets a list of a domains DS records

HTTP Request

GET /domain/dsrecords

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
bDNSSec boolean Whether or not DNSSEC is enabled on the domain
arrDsRecords array Array of DS records. See table below
strApiHost string This is the api server that handled the transaction

DS Records Array

Parameter Type Description
keyTag string Numeric value which identifies the referenced DS-record
alg string The algorithm of the referenced DNSKEY-record
digestType string Cryptographic hash algorithm used to create the Digest value
digest string A cryptographic hash value of the referenced DS-record

Set DS Records

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$dsRecords = serialize(array(
    [
        'tag' => '48422',
        'alg' => '13',
        'digestType1' => '1',
        'digest1' => 'FAC29A470E836B45FA9A451865C1B0284AA6924D'
    ],
    [
        'tag' => '48422',
        'alg' => '13',
        'digestType' => '2',
        'digest' => '68664E0D66F3F24135F48A88F958EC68B74C46CF52D36EF1EAA018B154B1006B'
    ]
 ));

$params = [
    'sld' => 'mydomain',
    'tld' => 'com',
    'dsRecords' => $dsRecords,
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/dsrecords', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "fd9a2660-040b-11ec-8838-5b2fd7dd2b7d",
  "strMessage": "Successful",
  "strApiHost": "api04_dnode02"
}

Sets a domains DS records

HTTP Request

POST /domain/dsrecords

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
dsRecords yes A serialized array of ds record arrays. Each ds record array should be formatted as below

DS Record array

Parameter Required Description
alg yes The algorithm of the referenced DNSKEY-record
digestType yes Cryptographic hash algorithm used to create the Digest value
digest yes A cryptographic hash value of the referenced DS-record
tag yes Numeric value which identifies the referenced DS-record

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Delete DS Records

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'tld-ns',
    'tld' => 'com',
    'all' => 'true'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/dsrecords', $params, 'DELETE', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "fd9a2660-040b-11ec-8838-5b2fd7dd2b7d",
  "strMessage": "Successful",
  "strApiHost": "api04_dnode02"
}

Deletes DS records from a domain

HTTP Request

DELETE /domain/dsrecords

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
all no If true all records will be removed. Default is true. If set to false, the dsRecords array will be required
dsRecords no A serialized array of ds record arrays. Each ds record array should be formatted as below

DS Record array

Parameter Required Description
alg yes The algorithm of the referenced DNSKEY-record
digestType yes Cryptographic hash algorithm used to create the Digest value
digest yes A cryptographic hash value of the referenced DS-record
tag yes Numeric value which identifies the referenced DS-record

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Tlds

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

//No params available
$params = [];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/tlds', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "b030e540-01c2-11ec-9864-912f306d05de",
  "strMessage": "Successful",
  "arrTLDs": {
    "Common": [
      "co.za",
      "com",
      "org",
      "joburg",
      "net",
      "eu.com",
      "gb.net",
      "uk.com",
      "uk.net",
      "de.com",
      "sa.com",
      "web.za",
      "durban",
      "capetown",
      "org.za",
      "net.za",
      "africa"
    ],
    "New GTLD": [
      "xyz",
      "wiki",
      "rest",
      "ink",
      "college",
      "bar",
      "host",
      "website",
      "site",
      "design",
      "fans",
      "feedback",
      "love",
      "online",
      "rent",
      "space",
      "tech",
      "store"
    ],
    "Generic": [
      "biz",
      "info",
      "pw",
      "party",
      "bid",
      "trade",
      "webcam",
      "cricket",
      "science",
      "review",
      "faith",
      "accountant",
      "loan",
      "win",
      "racing",
      "download",
      "stream",
      "date"
    ],
    "Country": [
      "co",
      "za.com",
      "us.com",
      "za.bz",
      "africa.com"
    ],
    "Mobile": [
      "mobi"
    ]
  },
  "strApiHost": "api_dnode03"
}

Gets a list of available TLDs to use

HTTP Request

GET /domain/tlds

Post Parameters

No parameters available

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrTLDs array An array of TLDs grouped by type
strApiHost string This is the api server that handled the transaction

DNS

Get DNS Records

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'mydomainname',
    'tld' => 'co.za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/dns', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "7ed60520-03ea-11ec-b420-bdae9a3a5416",
  "strMessage": "Successful",
  "arrRecords": [
    {
      "id": 2288898,
      "prio": 0,
      "ttl": 3600,
      "type": "A",
      "content": "123.123.123.123",
      "name": "mydomainname.co.za"
    },
    {
      "id": 2288896,
      "prio": 0,
      "ttl": 3600,
      "type": "CNAME",
      "content": "mydomainname.co.za",
      "name": "www.mydomainname.co.za"
    }
  ],
  "strApiHost": "api04_dnode02"
}

Gets DNS records

To make use of Premium DNS, your domains' nameservers need to be set to managed. Find out more here

HTTP Request

GET /domain/dns

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrRecords array Array of DNS records. See table below
strApiHost string This is the api server that handled the transaction

DNS Records Array

Parameter Type Description
id integer A unique Id linked to the DNS record
prio integer Priority of the DNS record
ttl integer The TTL of the DNS record
type string Type of DNS record (A, AAA, AAAA,MX, SOA, TXT, CNAME, CAA, NS, PTR, SPF, SRV)
content string The value / destination of the DNS record
name string The alias / name of the record

Set DNS Records

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld'       => 'mydomainname',
    'tld'       => 'co.za',
    'type1'     => 'A',
    'content1'  => '123.123.123.123',
    'type2'     => 'CNAME',
    'name2'     => 'www',
    'content2'  => 'mydomainname.co.za',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/dns', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "7ed60520-03ea-11ec-b420-bdae9a3a5416",
  "strMessage": "Successful",
  "strApiHost": "api04_dnode02"
}

Sets DNS records

To make use of Premium DNS, your domains' nameservers need to be set to managed. Find out more here

HTTP Request

POST /domain/dns

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
append no Whether or not to append to the zone or rewrite the zone with supplied information
type1 yes Type of DNS record (A, AAA, AAAA,MX, SOA, TXT, CNAME, CAA, NS, PTR, SPF, SRV)
ttl1 no Defaults the TTL to 3600
name1 no Name of the record. If the domain is not appended to the name, it will be done automatically
content1 yes The value or destination of the DNS record
prio1 no Defaults to 0 (highest priority)
type999 no Type of DNS record (A, AAA, AAAA,MX, SOA, TXT, CNAME, CAA, NS, PTR, SPF, SRV)
ttl999 no Defaults the TTL to 3600
name999 no Name of the record. If the domain is not appended to the name, it will be done automatically
content999 no The value or destination of the DNS record
prio999 no Defaults to 0 (highest priority)

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Remove DNS

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld' => 'mydomainname',
    'tld' => 'co.za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/dns', $params, 'DELETE', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "7ed60520-03ea-11ec-b420-bdae9a3a5417",
  "strMessage": "Successful",
  "strApiHost": "api04_dnode02"
}

Removes DNS zone

HTTP Request

DELETE /domain/dns

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Add DNS Record

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld'       => 'mydomainname',
    'tld'       => 'co.za',
    'type'      => 'A',
    'content'   => '123.123.123.123',
    'type'      => 'CNAME',
    'name'      => 'www',
    'content'   => 'mydomainname.co.za',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/dns/entry', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "7ed60520-03ea-11ec-b420-bdae9a3573a6",
  "strMessage": "Successful",
  "strApiHost": "api07_dnode01"
}

Adds DNS record entry

To make use of Premium DNS, your domains' nameservers need to be set to managed. Find out more here

HTTP Request

POST /domain/dns/entry

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
type yes Type of DNS record (A, AAA, AAAA,MX, SOA, TXT, CNAME, CAA, NS, PTR, SPF, SRV)
ttl no Defaults the TTL to 3600
name no Name of the record. If the domain is not appended to the name, it will be done automatically
content yes The value or destination of the DNS record
prio no Defaults to 0 (highest priority)

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Change DNS Record

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld'       => 'mydomainname',
    'tld'       => 'co.za',
    'dnsId'     => '2288896',
    'type'      => 'A',
    'content'   => '123.123.123.123',
    'type'      => 'CNAME',
    'name'      => 'www',
    'content'   => 'mydomainname.co.za',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/dns/entry', $params, 'PUT', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "7ed60520-03ea-11ec-b420-bdae9a3573a6",
  "strMessage": "Successful",
  "strApiHost": "api07_dnode01"
}

Changes DNS record entry

To make use of Premium DNS, your domains' nameservers need to be set to managed. Find out more here

HTTP Request

PUT /domain/dns/entry

Post Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
dnsId yes The unique Id linked to the DNS record
type yes Type of DNS record (A, AAA, AAAA,MX, SOA, TXT, CNAME, CAA, NS, PTR, SPF, SRV)
ttl no Defaults the TTL to 3600
name no Name of the record. If the domain is not appended to the name, it will be done automatically
content yes The value or destination of the DNS record
prio no Defaults to 0 (highest priority)

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Remove DNS record

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'sld'   => 'mydomainname',
    'tld'   => 'co.za',
    'dnsId' => '2288896'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/dns/entry', $params, 'DELETE', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "7ed60520-03ea-11ec-b420-bdae9a3a5417",
  "strMessage": "Successful",
  "strApiHost": "api04_dnode02"
}

Removes a DNS record entry

HTTP Request

DELETE /domain/dns/entry

Query Parameters

Parameter Required Description
sld yes SLD of the domain in question
tld yes TLD of the domain in question
dnsId yes The unique Id linked to the DNS record

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Poll

Get Poll Messages

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'domain' => 'mydomainname.co.za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/poll', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "9177d210-04e4-11ec-b23d-4b427f62a9fd",
  "strMessage": "Successful",
  "arrMessages": [
    {
      "pollId": "12671-1573207169",
      "pollCode": 4026,
      "pollMessage": "Domain Creation Successful",
      "pollDomain": "mydomainname.co.za",
      "createDate": 1573207169,
      "ackDate": null,
      "pollMessageType": "create"
    },
    {
      "pollId": "16945-1604743115",
      "pollCode": 4106,
      "pollMessage": "Domain Expiring in 24 Hours",
      "pollDomain": "mydomainname.co.za",
      "createDate": 1604743115,
      "ackDate": null,
      "pollMessageType": "renew"
    },
    {
      "pollId": "16948-1604829523",
      "pollCode": 4107,
      "pollMessage": "Domain Has Expired",
      "pollDomain": "mydomainname.co.za",
      "createDate": 1604829523,
      "ackDate": null,
      "pollMessageType": "renew"
    }
  ],
  "intReturnedTotal": 3,
  "intFilterTotal": 3,
  "intTotal": 3,
  "objReseller": {
    "username": "yourusername",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Gets a list of Poll messages

HTTP Request

GET /domain/poll

Query Parameters

Parameter Required Description
filter no Filter by type of poll. Options are: ns, delete, update, create, poll, transfer, contact, renew, expiry
acked no Filter by messages that are acked or not acked or both. true for acked only, false for not acked only and both for both acked and not acked messages
sortBy no What field to sort the returned result by. Options are pollDomain, pollMessage, pollCode, ackDate and created_at
order no Order to sort by. Options are ascending or descending
startPoint no For pagination, the start point for the returned results
limit no For pagination, the amount of messages to return
domain no A specific domain to filter by

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrMessages array Array of Poll messages. See table below
intReturnedTotal integer Total entries returned in result for pagination
intFilterTotal integer Total entries found with applied filters
intTotal integer Total entries found
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Poll Messages Array

Parameter Type Description
pollId string Unique poll ID
pollCode integer Poll code from the registry, corresponds to poll codes table
pollMessage string The poll message body
pollDomain string Domain associated with the poll message
createDate integer The creation date of the poll in unix timestamp format
ackDate string The acknowledged date of the domain in unix timestamp format
pollMessageType string Type of poll message. ns, delete, update, create, poll, transfer, contact, renew, expiry

Ack Poll Messages

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'pollId' => '12671-1573207169'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/poll', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "fc800cf0-04e6-11ec-a307-f19bd5fb9d33",
  "strMessage": "Successful",
  "objReseller": {
    "username": "yourusername",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Acknowledges poll messages

HTTP Request

POST /domain/poll

Query Parameters

Parameter Required Description
pollId yes The ID of the poll message you want to acknowledge. This may be an array of IDs or a single string containing one ID

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

User

Get Balance

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('domain/funds', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "fda9b160-0a31-11ec-9bca-8f7ab78464ef",
  "strMessage": "Successful",
  "strBillingType": "reseller",
  "dblPrepaidBalance": 435,
  "dblPostPaid": 0,
  "dblCozaBalance": 0,
  "strType": "reseller",
  "strBalance": "435",
  "objReseller": {
    "username": "yourusername",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Gets your current balance

HTTP Request

GET /domain/funds

Query Parameters

No parameters available

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strBillingType string Whether you are a reseller or registrar
dblPrepaidBalance double The prepaid balance of the account
dblPostPaid double The postpaid balance of the account
dblCozaBalance double The balance of your ZACR registrar account
strType string Whether you are a reseller or registrar
strBalance string The total balance of the account
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Get User Info

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "09c9ec10-057a-11ec-8902-ff6c27d37fc4",
  "strMessage": "Successful",
  "intId": 28,
  "strUsername": "yourusername",
  "strCompany": "",
  "strName": "John Doe",
  "strEmail": "john.doe@mydomainname.co.za",
  "strContactNumber": "+27.123456789",
  "strFax": "",
  "strAddress1": "219 Osborn Rd",
  "strAddress2": "Houghton Estate Office Park",
  "strAddress3": "",
  "strCity": "Jhb",
  "strProvince": "Gauteng",
  "strPostalCode": "2192",
  "strCountry": "za",
  "strCurrency": "ZAR",
  "fltBalance": 435,
  "intDomainsEnabled": "1",
  "intAdslEnabled": "0",
  "intVpsEnabled": "0",
  "intHostingEnabled": "0",
  "intNBM": "0",
  "boolAgreement": "0",
  "strApiKey": "5bs5376535ae3c08a74e7e3b5bf71df539123",
  "objReseller": {
    "username": "yourusername",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Gets your user information

HTTP Request

GET /reseller

Query Parameters

No parameters available

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
intId integer Our unique internal ID for your API profile
strUsername string The API username in question
strCompany string The API users company name
strName string The API users contact persons name
strEmail string The API users contact persons email
strContactNumber string The API users contact persons contact number
strFax string The API users contact persons fax number
strAddress1 string The API users contact persons address line 1
strAddress2 string The API users contact persons address line 2
strAddress3 string The API users contact persons address line 3
strCity string The API users contact persons city
strProvince string The API users contact persons province
strPostalCode string The API users contact persons postal code
strCountry string The API users contact persons country
strCurrency string The API users currency
fltBalance string The API users balance
intDomainsEnabled string Whether or not domains management is enabled
intAdslEnabled string [DEPRECATED] Whether or not adsl management is enabled
intVpsEnabled string [DEPRECATED] Whether or not vps management is enabled
intHostingEnabled string [DEPRECATED] Whether or not hosting management is enabled
intNBM string [DEPRECATED] Whether or not user integrates nbm
boolAgreement string Whether or not the reseller/registrar agreement has been signed
strApiKey string [DEPRECATED] Your unique API key. API now make use of JWT Tokens with username/password authentication as documented here
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Update User Info

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'name' => 'John Doe',
    'email' => 'john.doe@mydomainname.co.za',
    'contactNumber' => '%2B27.123456789',
    'address1' => '219 Osborne rd',
    'city' => 'Johannesburg',
    'province' => 'Gauteng',
    'postalCode' => '2198',
    'country' => 'za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller', $params, 'PUT', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "cf7f9400-058a-11ec-989c-4d93b3a748b7",
  "strMessage": "Successful",
  "objReseller": {
    "username": "yourusername",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Updates your user information

HTTP Request

PUT /reseller

Query Parameters

Parameter Required Description
name yes The API users contact persons name
email yes The API users contact persons email
company no The API users company name
contactNumber yes The API users contact persons contact number
fax no The API users contact persons fax number
address1 yes The API users contact persons address line 1
address2 no The API users contact persons address line 2
address3 no The API users contact persons address line 3
city yes The API users contact persons city
province yes The API users contact persons province
postalCode yes The API users contact persons postal code
country yes The API users contact persons country
password no If password is sent, your API password will be updated

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Get User Pricing

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'format' => 'tld'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/prices', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "615b8460-0599-11ec-8a97-2b55180f108b",
  "strMessage": "Successful",
  "arrPrices": {
    "co.za": {
      "currency": "ZAR",
      "registration": "82.50",
      "renewal": "82.50",
      "transfer": "12.00",
      "redemption": "525.00",
      "premium": "382.50",
      "optedOut": false
    },
    "com": {
      "currency": "ZAR",
      "registration": "305.00",
      "renewal": "305.00",
      "transfer": "305.00",
      "redemption": "3050.00",
      "premium": "305.00",
      "optedOut": false
    },
    "org": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    },
    "xyz": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    },
    "joburg": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    },
    "biz": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    },
    "co": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    },
    "net": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    }
  },
  "objReseller": {
    "username": "yourusername",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Gets pricing on tlds

HTTP Request

GET /reseller/pricing

Query Parameters

Parameter Required Description
format yes Sending tld will group the pricing by TLD. This is the new standard of formatting for the function. All previous formats are deprecated.

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrPrices array An array of TLDs with their respective pricing. Please see below
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Prices Array

Parameter Type Description
currency string The currency of the pricing
registration string The price of registration for a name
renewal string The price of renewal for a name
transfer string The price of transfer for a name. Some TLDs renew on transfer which is why they include a fee
redemption string The fee to get the domain name out of closed redemption / pending deletion
premium string The price of registration for a premium name
optedOut boolean Whether or not the TLD was opted out of being available to register

Get User Notification Settings

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/notifications', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "93bfc9d0-098d-11ec-af6a-1d52cc226cf2",
  "strMessage": "Successful",
  "arrNotifications": [
    {
      "code": "contactUpdates",
      "name": "Contact Updates",
      "status": "Off"
    },
    {
      "code": "nsSuccess",
      "name": "Nameserver Updates Successful",
      "status": "On"
    },
    {
      "code": "nsFailed",
      "name": "Nameserver Update Failed",
      "status": "On"
    },
    {
      "code": "domainUpdates",
      "name": "Domain Updates",
      "status": "On"
    },
    {
      "code": "domainRenewals",
      "name": "Domain Renewals",
      "status": "On"
    },
    {
      "code": "domainTransfers",
      "name": "Domain Transfers",
      "status": "On"
    },
    {
      "code": "domainDeletes",
      "name": "Domain Deletes",
      "status": "On"
    },
    {
      "code": "domainCreates",
      "name": "Domain Creates",
      "status": "On"
    }
  ],
  "arrSettings": [
    {
      "code": "contactUpdates",
      "name": "Contact Updates",
      "status": "Off"
    },
    {
      "code": "nsSuccess",
      "name": "Nameserver Updates Successful",
      "status": "On"
    },
    {
      "code": "nsFailed",
      "name": "Nameserver Update Failed",
      "status": "On"
    },
    {
      "code": "domainUpdates",
      "name": "Domain Updates",
      "status": "On"
    },
    {
      "code": "domainRenewals",
      "name": "Domain Renewals",
      "status": "On"
    },
    {
      "code": "domainTransfers",
      "name": "Domain Transfers",
      "status": "On"
    },
    {
      "code": "domainDeletes",
      "name": "Domain Deletes",
      "status": "On"
    },
    {
      "code": "domainCreates",
      "name": "Domain Creates",
      "status": "On"
    }
  ],
  "strDeprecationNotice": "Please note arrNotifications is now deprecated, and will be removed in the future. Please update your calls to use arrSettings",
  "strApiHost": "api_dnode03"
}

Gets user notification settings

HTTP Request

GET /reseller/notifications

Query Parameters

No parameters available

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrNotifications array A legacy array of notification settings. This is to be deprecated soon. Rather use the below arrSettings parameter
arrSettings array An array of notification settings
strDeprecationNotice string Deprecation notice: Please note arrNotifications is now deprecated, and will be removed in the future. Please update your calls to use arrSettings
strApiHost string This is the api server that handled the transaction

Settings Array

Parameter Type Description
code string The setting codename
name string The setting friendly name
status string The setting value. Either on or off

Set User Notification Settings

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'contactUpdates' => 'on',
    'nsSuccess' => 'on',
    'nsFailed' => 'off',
    'domainUpdates' => 'on',
    'domainRenewals' => 'off',
    'domainTransfers' => 'on',
    'domainDeletes' => 'off',
    'domainCreates' => 'on'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/notifications', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "18177ad0-098f-11ec-8fa2-0fcc7929c528",
  "strMessage": "Successful",
  "arrErrorList": [],
  "strApiHost": "api_dnode03"
}

Sets user notification settings

HTTP Request

POST /reseller/notifications

POST Parameters

Parameter Required Description
contactUpdates no Whether or not to receive a notification for contact updates
nsSuccess no Whether or not to receive a notification for successful nameserver updates
nsFailed no Whether or not to receive a notification for unsuccessful nameserver updates
domainUpdates no Whether or not to receive a notification for domain update
domainRenewals no Whether or not to receive a notification for domain renewals
domainTransfers no Whether or not to receive a notification for domain transfers
domainDeletes no Whether or not to receive a notification for domain deletions
domainCreates no Whether or not to receive a notification for domain creations

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrErrorList array An array of error messages in case any setting failed to change
strApiHost string This is the api server that handled the transaction

Reseller

These functions are available to Registrar accounts only

Get Reseller Info

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'resellerUsername',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "db5847a0-0990-11ec-aec6-9b578dccc8ef",
  "strMessage": "Successful",
  "intId": 25,
  "strUsername": "samplereseller",
  "strCompany": "",
  "strName": "John Doe",
  "strEmail": "john.doe@mydomainname.co.za",
  "strContactNumber": "+27.116409700",
  "strFax": "",
  "strAddress1": "219 Osborne rd",
  "strAddress2": "",
  "strAddress3": "",
  "strCity": "Johannesburg",
  "strProvince": "Gauteng",
  "strPostalCode": "2198",
  "strCountry": "ZA",
  "strCurrency": "ZAR",
  "fltBalance": 5044,
  "intDomainsEnabled": "1",
  "intAdslEnabled": "1",
  "intVpsEnabled": "0",
  "intHostingEnabled": "1",
  "intNBM": "0",
  "boolAgreement": "1",
  "strApiKey": "23474c60672b271d3da9b510ab19a787",
  "strApiHost": "api_dnode03"
}

Gets information on a reseller account

HTTP Request

GET /reseller

Query Parameters

Parameter Required Description
username no The username of the reseller in question. If no username is supplied, your registrar information is retrieved

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
intId integer Our unique internal ID for your API profile
strUsername string The API username in question
strCompany string The API users company name
strName string The API users contact persons name
strEmail string The API users contact persons email
strContactNumber string The API users contact persons contact number
strFax string The API users contact persons fax number
strAddress1 string The API users contact persons address line 1
strAddress2 string The API users contact persons address line 2
strAddress3 string The API users contact persons address line 3
strCity string The API users contact persons city
strProvince string The API users contact persons province
strPostalCode string The API users contact persons postal code
strCountry string The API users contact persons country
strCurrency string The API users currency
fltBalance string The API users balance
intDomainsEnabled string Whether or not domains management is enabled
intAdslEnabled string [DEPRECATED] Whether or not adsl management is enabled
intVpsEnabled string [DEPRECATED] Whether or not vps management is enabled
intHostingEnabled string [DEPRECATED] Whether or not hosting management is enabled
intNBM string [DEPRECATED] Whether or not user integrates nbm
boolAgreement string Whether or not the reseller/registrar agreement has been signed
strApiKey string [DEPRECATED] Your unique API key. API now make use of JWT Tokens with username/password authentication as documented here
strApiHost string This is the api server that handled the transaction

Update Reseller Info

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'resellerUsername',
    'name' => 'John Doe',
    'email' => 'john.doe@mydomainname.co.za',
    'contactNumber' => '%2B27.123456789',
    'address1' => '219 Osborne rd',
    'city' => 'Johannesburg',
    'province' => 'Gauteng',
    'postalCode' => '2198',
    'country' => 'za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller', $params, 'PUT', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "72aa7960-0992-11ec-8d30-ed55fda1c8f1",
  "strMessage": "Successful",
  "strApiHost": "api_dnode03"
}

Updates reseller information

HTTP Request

PUT /reseller

Query Parameters

Parameter Required Description
username no The username of the reseller. If no username is supplied, your registrar information are modified
name yes The API users contact persons name
email yes The API users contact persons email
company no The API users company name
contactNumber yes The API users contact persons contact number
fax no The API users contact persons fax number
address1 yes The API users contact persons address line 1
address2 no The API users contact persons address line 2
address3 no The API users contact persons address line 3
city yes The API users contact persons city
province yes The API users contact persons province
postalCode yes The API users contact persons postal code
country yes The API users contact persons country
password no If password is sent, your API password will be updated

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Create Reseller

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'resellerUsername',
    'password' => 'j!3%Ahf89uZ',
    'name' => 'John Doe',
    'email' => 'john.doe@mydomainname.co.za',
    'contactNumber' => '%2B27.123456789',
    'address1' => '219 Osborne rd',
    'city' => 'Johannesburg',
    'province' => 'Gauteng',
    'postalCode' => '2198',
    'country' => 'za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "ce6ef8c0-0992-11ec-ba9f-e7888dfa4a5e",
  "strMessage": "Successful",
  "strApiKey": "4f7c1e0a623226df386a46f634152419",
  "strApiHost": "api_dnode03"
}

Creates a new reseller

HTTP Request

POST /reseller

Query Parameters

Parameter Required Description
username yes The username of the reseller to be created
password yes The password to use for the reseller
name yes The API users contact persons name
email yes The API users contact persons email
company no The API users company name
contactNumber yes The API users contact persons contact number
fax no The API users contact persons fax number
address1 yes The API users contact persons address line 1
address2 no The API users contact persons address line 2
address3 no The API users contact persons address line 3
city yes The API users contact persons city
province yes The API users contact persons province
postalCode yes The API users contact persons postal code
country yes The API users contact persons country

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiKey string [DEPRECATED] API key for the reseller
strApiHost string This is the api server that handled the transaction

List Resellers

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'search' => 'Doe'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/list', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "ff4b5ee0-0994-11ec-af2f-6b3d0cc64f17",
  "strMessage": "Successful",
  "arrResellerList": [
    {
      "strUsername": "samplereseller",
      "strName": "John Doe",
      "strCompany": "",
      "intTotalDomains": 165,
      "agreementSigned": 0,
      "fltBalance": "5044.00"
    },
    {
      "strUsername": "anotherreseller",
      "strName": "Jane Doe",
      "strCompany": "SomeCompany",
      "intTotalDomains": 157,
      "agreementSigned": 0,
      "fltBalance": "93257.60"
    }
  ],
  "intTotal": 31,
  "intFilterTotal": 2,
  "intReturnedTotal": 2,
  "strApiHost": "api_dnode03"
}

Gets a list of your Reseller accounts

HTTP Request

GET /reseller/list

Query Parameters

Parameter Required Description
sortBy no What field to sort the returned result by. Options are agreementSigned, strCompany, strName, strUsername and intTotalDomains
order no Order to sort by. Options are ascending or descending
startPoint no For pagination, the start point for the returned results
limit no For pagination, the amount of reseller accounts to return
search no A specific keyword to search for

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrResellerList array Array of Reseller accounts. See table below
intReturnedTotal integer Total entries returned in result for pagination
intFilterTotal integer Total entries found with applied filters
intTotal integer Total entries found
strApiHost string This is the api server that handled the transaction

Reseller List Array

Parameter Type Description
strUsername string The reseller account username
strName integer The reseller contact persons name
strCompany string The reseller company name
intTotalDomains integer The amount of active domains under the reseller account
agreementSigned integer Whether or not the reseller has signed a reseller agreement
fltBalance string The prepaid balance of the reseller account

Suspend Reseller

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'resellerUsername',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/suspendUser', $params, 'PUT', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "2daaaf40-0996-11ec-90f7-3fd752bb2090",
  "strMessage": "Successful",
  "strApiHost": "api_dnode03"
}

Suspends a reseller account

HTTP Request

PUT /reseller/suspendUser

Query Parameters

Parameter Required Description
username no The username of the reseller in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Unsuspend Reseller

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'resellerUsername',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/unsuspendUser', $params, 'PUT', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "2daaaf40-0996-11ec-90f7-3fd752bb2101",
  "strMessage": "Successful",
  "strApiHost": "api_dnode03"
}

Unsuspends a reseller account

HTTP Request

PUT /reseller/unsuspendUser

Query Parameters

Parameter Required Description
username no The username of the reseller in question

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Add Credits

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'resellerUsername',
    'value' => 252.50,
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('billing/manualTopup', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "3ff74e00-0997-11ec-84e2-d78125af481f",
  "strMessage": "Successful",
  "fltCredits": "302.50",
  "strApiHost": "api_dnode03"
}

Adds credits to a reseller account

HTTP Request

POST /billing/manualTopup

POST Parameters

Parameter Required Description
username no The username of the reseller in question
value no The float value of credits to add to the reseller account

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
fltCredits string The resellers new prepaid balance
strApiHost string This is the api server that handled the transaction

Remove Credits

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'resellerUsername',
    'value' => 59.99,
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('billing/removeCredits', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "3ff74e00-0997-11ec-84e2-d78125af481f",
  "strMessage": "Successful",
  "fltCredits": "242.51",
  "strApiHost": "api_dnode03"
}

Removes credits from a reseller account

HTTP Request

POST /billing/removeCredits

POST Parameters

Parameter Required Description
username no The username of the reseller in question
value no The float value of credits to remove from the reseller account

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
fltCredits string The resellers new prepaid balance
strApiHost string This is the api server that handled the transaction

Get Reseller Prices

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'format' => 'tld',
    'username' => 'resellerUsername',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/prices', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "615b8460-0599-11ec-8a97-2b55180f108b",
  "strMessage": "Successful",
  "arrPrices": {
    "co.za": {
      "currency": "ZAR",
      "registration": "82.50",
      "renewal": "82.50",
      "transfer": "12.00",
      "redemption": "525.00",
      "premium": "382.50",
      "optedOut": false
    },
    "com": {
      "currency": "ZAR",
      "registration": "305.00",
      "renewal": "305.00",
      "transfer": "305.00",
      "redemption": "3050.00",
      "premium": "305.00",
      "optedOut": false
    },
    "org": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    },
    "xyz": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    },
    "joburg": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    },
    "biz": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    },
    "co": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    },
    "net": {
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1400.00",
      "optedOut": false
    }
  },
  "objReseller": {
    "username": "nicdevuser",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Gets pricing on tlds

HTTP Request

GET /reseller/pricing

Query Parameters

Parameter Required Description
format yes Sending tld will group the pricing by TLD. This is the new standard of formatting for the function. All previous formats are deprecated.
username no The username of the reseller in question. If no username is supplied, your registrar cost pricing will be retrieved

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrPrices array An array of TLDs with their respective pricing. Please see below
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Prices Array

Parameter Type Description
currency string The currency of the pricing
registration string The price of registration for a name
renewal string The price of renewal for a name
transfer string The price of transfer for a name. Some TLDs renew on transfer which is why they include a fee
redemption string The fee to get the domain name out of closed redemption / pending deletion
premium string The price of registration for a premium name
optedOut boolean Whether or not the TLD was opted out of being available to register

Set Reseller Prices

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'resellerUsername',
    'tld' => 'co.za',
    'registration' => '75.50',
    'renewal' => '75.50',
    'transfer' => '0.00',
    'redemption' => '275.50',
    'premium' => '1050.00',
    'type' => 'base',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/prices', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "bed89250-0998-11ec-a965-83dd2fd80054",
  "strMessage": "Successful",
  "arrPrices": {
    "co.za": {
      "type": "base",
      "currency": "zar",
      "registration": "75.50",
      "renewal": "75.50",
      "transfer": "0.00",
      "redemption": "275.50",
      "premium": "1050.00",
      "optedOut": 0
    },
    "com": {
      "type": "base",
      "currency": "USD",
      "registration": "20.00",
      "renewal": "20.00",
      "transfer": "20.00",
      "redemption": "200.00",
      "premium": "20.00",
      "optedOut": "0"
    },
    "org": {
      "type": "base",
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1,400.00",
      "optedOut": "0"
    },
    "xyz": {
      "type": "base",
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1,400.00",
      "optedOut": "0"
    },
    "joburg": {
      "type": "base",
      "currency": "ZAR",
      "registration": "200.00",
      "renewal": "200.00",
      "transfer": "300.00",
      "redemption": "750.00",
      "premium": "1,400.00",
      "optedOut": "0"
    }
  },
  "strApiHost": "api_dnode03"
}

Sets pricing on tlds for a reseller

HTTP Request

POST /reseller/pricing

POST Parameters

Parameter Required Description
username no The username of the reseller in question
type no Type of markup to set. Can be either base, markup or percentage. Defaults to base
tld yes The TLD to set the pricing for
registration yes The registration price of the TLD in question
renewal yes The renewal price of the TLD in question
transfer yes The transfer price of the TLD in question
redemption yes The redemption price of the TLD in question
premium yes The premium price of the TLD in question
currency no The currency of the pricing. Defaults to ZAR

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrPrices array An array of TLDs with their respective pricing. Please see below
strApiHost string This is the api server that handled the transaction

Prices Array

Parameter Type Description
type string The markup type set. Can be either base, markup or percentage
currency string The currency of the pricing
registration string The price of registration for a name
renewal string The price of renewal for a name
transfer string The price of transfer for a name. Some TLDs renew on transfer which is why they include a fee
redemption string The fee to get the domain name out of closed redemption / pending deletion
premium string The price of registration for a premium name
optedOut boolean Whether or not the TLD was opted out of being available to register

Get Default Pricing

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'format' => 'tld',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/defaultPricing', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "bed89250-0998-11ec-a965-83dd2fd80054",
  "strMessage": "Successful", 
  "arrPrices": {
      "co.za": {
        "type": "base",
        "currency": "ZAR",
        "registration": "10.00",
        "renewal": "11.00",
        "transfer": "14.00",
        "redemption": "13.00",
        "premium": "15.00",
        "optedOut": false,
        "markup": {
          "currency": "zar",
          "registration": "65.50",
          "renewal": "64.50",
          "transfer": "-14.00",
          "redemption": "262.50",
          "premium": "985.00"
        },
        "total": {
          "currency": "zar",
          "registration": "75.50",
          "renewal": "75.50",
          "transfer": "0.00",
          "redemption": "275.50",
          "premium": "1,000.00"
        },
        "setting": {
          "currency": "zar",
          "registration": "75.50",
          "renewal": "75.50",
          "transfer": "0.00",
          "redemption": "275.50",
          "premium": "1,000.00",
          "type": "base"
        }
      }
  },
  "strApiHost": "api_dnode03"
}

Gets your default pricing on tlds

HTTP Request

GET /reseller/defaultPricing

POST Parameters

Parameter Required Description
format yes Format the result to be grouped by tld

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrPrices array An array of tlds and the breakdown of the pricing
strApiHost string This is the api server that handled the transaction

Set Default Pricing

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'tld' => 'co.za',
    'registration' => '75.50',
    'renewal' => '75.50',
    'transfer' => '0.00',
    'redemption' => '275.50',
    'premium' => '1050.00',
    'type' => 'base',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/defaultPricing', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "bed89250-0998-11ec-a965-83dd2fd80054",
  "strMessage": "Successful",
  "strApiHost": "api_dnode03"
}

Sets your default pricing on tlds

HTTP Request

POST /reseller/defaultPricing

POST Parameters

Parameter Required Description
type yes Type of markup to set. Can be either base, markup or percentage. Defaults to base
tld yes The TLD to set the pricing for
registration yes The registration price of the TLD in question
renewal yes The renewal price of the TLD in question
transfer yes The transfer price of the TLD in question
redemption yes The redemption price of the TLD in question
premium yes The premium price of the TLD in question
currency no The currency of the pricing. Defaults to ZAR

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Get Notification Settings

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'resellerUsername'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/notifications', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "93bfc9d0-098d-11ec-af6a-1d52cc226cf2",
  "strMessage": "Successful",
  "arrNotifications": [
    {
      "code": "contactUpdates",
      "name": "Contact Updates",
      "status": "Off"
    },
    {
      "code": "nsSuccess",
      "name": "Nameserver Updates Successful",
      "status": "On"
    },
    {
      "code": "nsFailed",
      "name": "Nameserver Update Failed",
      "status": "On"
    },
    {
      "code": "domainUpdates",
      "name": "Domain Updates",
      "status": "On"
    },
    {
      "code": "domainRenewals",
      "name": "Domain Renewals",
      "status": "On"
    },
    {
      "code": "domainTransfers",
      "name": "Domain Transfers",
      "status": "On"
    },
    {
      "code": "domainDeletes",
      "name": "Domain Deletes",
      "status": "On"
    },
    {
      "code": "domainCreates",
      "name": "Domain Creates",
      "status": "On"
    }
  ],
  "arrSettings": [
    {
      "code": "contactUpdates",
      "name": "Contact Updates",
      "status": "Off"
    },
    {
      "code": "nsSuccess",
      "name": "Nameserver Updates Successful",
      "status": "On"
    },
    {
      "code": "nsFailed",
      "name": "Nameserver Update Failed",
      "status": "On"
    },
    {
      "code": "domainUpdates",
      "name": "Domain Updates",
      "status": "On"
    },
    {
      "code": "domainRenewals",
      "name": "Domain Renewals",
      "status": "On"
    },
    {
      "code": "domainTransfers",
      "name": "Domain Transfers",
      "status": "On"
    },
    {
      "code": "domainDeletes",
      "name": "Domain Deletes",
      "status": "On"
    },
    {
      "code": "domainCreates",
      "name": "Domain Creates",
      "status": "On"
    }
  ],
  "strDeprecationNotice": "Please note arrNotifications is now deprecated, and will be removed in the future. Please update your calls to use arrSettings",
  "strApiHost": "api_dnode03"
}

Gets reseller notification settings

HTTP Request

GET /reseller/notifications

Query Parameters

Parameter Required Description
username no The reseller account to fetch the settings for. If blank, registrar user settings are fetched

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrNotifications array A legacy array of notification settings. This is to be deprecated soon. Rather use the below arrSettings parameter
arrSettings array An array of notification settings
strDeprecationNotice string Deprecation notice: Please note arrNotifications is now deprecated, and will be removed in the future. Please update your calls to use arrSettings
strApiHost string This is the api server that handled the transaction

Settings Array

Parameter Type Description
code string The setting codename
name string The setting friendly name
status string The setting value. Either on or off

Set Notification Settings

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'resellerUsername',
    'contactUpdates' => 'on',
    'nsSuccess' => 'on',
    'nsFailed' => 'off',
    'domainUpdates' => 'on',
    'domainRenewals' => 'off',
    'domainTransfers' => 'on',
    'domainDeletes' => 'off',
    'domainCreates' => 'on'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('reseller/notifications', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "18177ad0-098f-11ec-8fa2-0fcc7929c528",
  "strMessage": "Successful",
  "arrErrorList": [],
  "strApiHost": "api_dnode03"
}

Sets reseller notification settings

HTTP Request

POST /reseller/notifications

POST Parameters

Parameter Required Description
username no The reseller account to change the settings for. If blank, registrar user settings are updated
contactUpdates no Whether or not to receive a notification for contact updates
nsSuccess no Whether or not to receive a notification for successful nameserver updates
nsFailed no Whether or not to receive a notification for unsuccessful nameserver updates
domainUpdates no Whether or not to receive a notification for domain update
domainRenewals no Whether or not to receive a notification for domain renewals
domainTransfers no Whether or not to receive a notification for domain transfers
domainDeletes no Whether or not to receive a notification for domain deletions
domainCreates no Whether or not to receive a notification for domain creations

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrErrorList array An array of error messages in case any setting failed to change
strApiHost string This is the api server that handled the transaction

SubUser

Create SubUser

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'testSubUsr',
    'password' => 'mytestpass123',
    'name' => 'John Doe',
    'email' => 'john.doe@mydomainname.co.za',
    'contactNumber' => '%2B27.116409700',
    'address1' => '219 Osborne rd',
    'address2' => 'Houghton Estate',
    'city' => 'Johannesburg',
    'province' => 'Gauteng',
    'postalCode' => '2198',
    'country' => 'za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('subuser', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "58ee3f50-0a3e-11ec-ac2c-dbe733976a4b",
  "strMessage": "Successful",
  "arrUser": {
    "strUsername": "testSubUsr",
    "strPassword": "mytestpass123",
    "strApiKey": "bc116d33922ecf796dab310c9e84c4fb",
    "strRole": null,
    "strContactID": "diacon612df728604541.58102284",
    "strContactName": "John Doe", 
    "strContactEmail": "john.doe@mydomainname.co.za",
    "strContactNumber": "+27.123456789",
    "strContactCompany": "",
    "strContactAddress": [
      "219 Osborn Road",
      "Houghton Estate",
      ""
    ],
    "strContactCity": "Johannesburg",
    "strContactProvince": "Gauteng",
    "strContactPostalCode": "2192",
    "strContactCountry": "ZA",
    "strContactFax": "",
    "strContactType": "subuser",
    "strStatus": "active"
  },
  "strApiHost": "api_dnode03"
}

Creates a subuser to your account

HTTP Request

POST /subuser

Query Parameters

Parameter Required Description
username yes The username of the new subuser account
password yes Password to use for the subuser account
name yes The subusers name
email yes The subusers email
company no The subusers company name
contactNumber yes The subusers contact number
fax no The subusers fax number
address1 yes The subusers address line 1
address2 no The subusers address line 2
address3 no The subusers address line 3
city yes The subusers city
province yes The subusers province
postalCode yes The subusers postal code
country yes The subusers country

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrUser string Subuser array as shown below
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Subuser Array

Parameter Type Description
strUsername string The subuser API username
strPassword string The subuser API password
strApiKey string [DEPRECATED] Your unique API key. API now make use of JWT Tokens with username/password authentication as documented here
strRole string This will return null and is used for internal purposes
strContactID string The unique contact ID
strContactName string The subusers name
strContactEmail string The subusers email
strContactNumber string The subusers contact number
strContactCompany string The subusers company name
strContactAddress array The subusers address lines
strContactCity string The subusers city
strContactProvince string The subusers province
strContactPostalCode string The subusers postal code
strContactCountry string The subusers country
strContactFax string The subusers fax number
strContactType string This will return subuser
strStatus string Whether or not the user is active

Update SubUser

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'testSubUsr',
    'password' => 'mytestpass456',
    'name' => 'John Doe',
    'email' => 'john.doe@mydomainname.co.za',
    'contactNumber' => '%2B27.116409700',
    'address1' => '219 Osborne rd',
    'address2' => 'Houghton Estate',
    'city' => 'Johannesburg',
    'province' => 'Gauteng',
    'postalCode' => '2198',
    'country' => 'za'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('subuser', $params, 'PUT', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "46bacb40-0a40-11ec-9263-ad426fed4743",
  "strMessage": "Successful",
  "arrUser": {
    "strUsername": "testSubUsr",
    "strRole": null,
    "strContactID": "jdcon612df89a52daf2.53217183",
    "strContactName": "John Doe",
    "strContactEmail": "john.doe@mydomainname.co.za",
    "strContactNumber": "+27.123456789",
    "strContactCompany": "",
    "strContactAddress": [
      "219 Osborne rd",
      "",
      ""
    ],
    "strContactCity": "Johannesburg",
    "strContactProvince": "Gauteng",
    "strContactPostalCode": "2192",
    "strContactCountry": "ZA",
    "strContactFax": "",
    "strContactType": "subuser",
    "strStatus": "active"
  },
  "objReseller": {
    "username": "yourusername",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Updates a subusers details

HTTP Request

PUT /subuser

Query Parameters

Parameter Required Description
username yes The username of the new subuser account
password no Password to use for the subuser account
name no The subusers name
email no The subusers email
company no The subusers company name
contactNumber no The subusers contact number
fax no The subusers fax number
address1 no The subusers address line 1
address2 no The subusers address line 2
address3 no The subusers address line 3
city no The subusers city
province no The subusers province
postalCode no The subusers postal code
country no The subusers country

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrUser string Subuser array as shown below
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Subuser Array

Parameter Type Description
strUsername string The subuser API username
strRole string This will return null and is used for internal purposes
strContactID string The unique contact ID
strContactName string The subusers name
strContactEmail string The subusers email
strContactNumber string The subusers contact number
strContactCompany string The subusers company name
strContactAddress array The subusers address lines
strContactCity string The subusers city
strContactProvince string The subusers province
strContactPostalCode string The subusers postal code
strContactCountry string The subusers country
strContactFax string The subusers fax number
strContactType string This will return subuser
strStatus string Whether or not the user is active

List SubUsers

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('subuser', $params, 'GET', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "46bacb40-0a40-11ec-9263-ad426fed4743",
  "strMessage": "Successful",
  "arrUser": {
    "strUsername": "testSubUsr",
    "strRole": null,
    "strContactID": "niccon612df89a52daf2.53217183",
    "strContactName": "John Doe",
    "strContactEmail": "john.doe@mydomainname.co.za",
    "strContactNumber": "+27.123456789",
    "strContactCompany": "",
    "strContactAddress": [
      "219 Osborne rd",
      "",
      ""
    ],
    "strContactCity": "Johannesburg",
    "strContactProvince": "Gauteng",
    "strContactPostalCode": "2192",
    "strContactCountry": "ZA",
    "strContactFax": "",
    "strContactType": "subuser",
    "strStatus": "active"
  },
  "intTotal": 1,
  "intFilterTotal": 1,
  "intReturnedTotal": 1,
  "objReseller": {
    "username": "yourusername",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Lists subusers with their details

HTTP Request

GET /subuser

Query Parameters

Parameter Required Description
username no The username of the subuser to search for
search no The username or contact name to search for
includeDeleted no Whether or not to include deleted subusers in the returned result
sortBy no What field to sort the returned result by. Options are agreementSigned, strCompany, strName, strUsername and intTotalDomains
order no Order to sort by. Options are ascending or descending
startPoint no For pagination, the start point for the returned results
limit no For pagination, the amount of reseller accounts to return

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrUser string Subuser array as shown below
intReturnedTotal integer Total entries returned in result for pagination
intFilterTotal integer Total entries found with applied filters
intTotal integer Total entries found
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Subuser Array

Parameter Type Description
strUsername string The subuser API username
strRole string This will return null and is used for internal purposes
strContactID string The unique contact ID
strContactName string The subusers name
strContactEmail string The subusers email
strContactNumber string The subusers contact number
strContactCompany string The subusers company name
strContactAddress array The subusers address lines
strContactCity string The subusers city
strContactProvince string The subusers province
strContactPostalCode string The subusers postal code
strContactCountry string The subusers country
strContactFax string The subusers fax number
strContactType string This will return subuser
strStatus string Whether or not the user is active

Delete SubUser

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'testSubUsr'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('subuser', $params, 'DELETE', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "a2927360-0a41-11ec-a144-5dd6cebf3471",
  "strMessage": "Successful",
  "objReseller": {
    "username": "yourusername",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Deletes a subuser

HTTP Request

DELETE /subuser

Query Parameters

Parameter Required Description
username yes The username of the subuser to be deleted

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Suspend SubUser

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'testSubUsr'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('subuser/suspend', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "a2927360-0a41-11ec-a144-5dd6cebf3587",
  "strMessage": "Successful",
  "objReseller": {
    "username": "yourusername",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Suspends a subuser

HTTP Request

POST /subuser/suspend

Query Parameters

Parameter Required Description
username yes The username of the subuser to be suspended

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Unsuspend SubUser

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'username' => 'testSubUsr'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('subuser/unsuspend', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "a2927360-0a41-11ec-a144-5dd6cebf3327",
  "strMessage": "Successful",
  "objReseller": {
    "username": "yourusername",
    "balance": "435.00",
    "accountType": "pre",
    "lowBalance": true
  },
  "strApiHost": "api_dnode03"
}

Unsuspends a subuser

HTTP Request

POST /subuser/unsuspend

Query Parameters

Parameter Required Description
username yes The username of the subuser to be unsuspended

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Template

List Contact Templates

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'list' => 'full'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/contact', $params, 'GET', $headers);

print_r($result);
?>

Success Response for simple list:

{
  "intReturnCode": 1,
  "strUUID": "3ed19d50-0bc8-11ec-90af-dbc3d106a2b0",
  "strMessage": "Successful",
  "arrTemplates": [
    {
      "strTemplateName": "Sample Tpl1",
      "strType": "registrant",
      "strTemplateId": "BJSHlzwGM9lR5XK1",
      "boolDefaultTemplate": 1
    },
    {
      "strTemplateName": "Sample Tpl1",
      "strType": "admin",
      "strTemplateId": "EXe0RQwQMfxcM0mX",
      "boolDefaultTemplate": 1
    },
    {
      "strTemplateName": "Sample Tpl1",
      "strType": "tech",
      "strTemplateId": "eQAaRp40KBfuFYxb",
      "boolDefaultTemplate": 1
    },
    {
      "strTemplateName": "Sample Tpl1",
      "strType": "billing",
      "strTemplateId": "m4Gtti4lL7G4THQF",
      "boolDefaultTemplate": 1
    }
  ],
  "intTotal": 4,
  "intFilterTotal": 4,
  "intReturnedTotal": 4,
  "objReseller": {
    "username": "yourusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

Success Response for full list:

{
    "intReturnCode": 1,
    "strUUID": "3dc72600-0bcc-11ec-9bd1-538c742daf8e",
    "strMessage": "Successful",
    "arrTemplates": [
        {
            "arrContact": {
                "name": "John Doe",
                "address1": "219 Osborn Road",
                "address2": "Houghton Estate",
                "address3": "",
                "postal": "2198",
                "country": "za",
                "city": "Johannesburg",
                "province": "Gauteng",
                "email": "john.doe@mydomainname.co.za",
                "fax": "",
                "phone": "+27.123456789",
                "company": ""
            },
            "strTemplateName": "Sample Tpl1",
            "strType": "registrant",
            "strTemplateId": "BJSHlzwGM9lR5XK1",
            "boolDefaultTemplate": 1
        },
        {
            "arrContact": {
                "name": "John Doe",
                "address1": "219 Osborn Road",
                "address2": "Houghton Estate",
                "address3": "",
                "postal": "2198",
                "country": "za",
                "city": "Johannesburg",
                "province": "Gauteng",
                "email": "john.doe@mydomainname.co.za",
                "fax": "",
                "phone": "+27.123456789",
                "company": ""
            },
            "strTemplateName": "Sample Tpl1",
            "strType": "admin",
            "strTemplateId": "EXe0RQwQMfxcM0mX",
            "boolDefaultTemplate": 1
        },
        {
            "arrContact": {
                "name": "John Doe",
                "address1": "219 Osborn Road",
                "address2": "Houghton Estate",
                "address3": "",
                "postal": "2198",
                "country": "za",
                "city": "Johannesburg",
                "province": "Gauteng",
                "email": "john.doe@mydomainname.co.za",
                "fax": "",
                "phone": "+27.123456789",
                "company": ""
            },
            "strTemplateName": "Sample Tpl1",
            "strType": "tech",
            "strTemplateId": "eQAaRp40KBfuFYxb",
            "boolDefaultTemplate": 1
        },
        {
            "arrContact": {
                "name": "John Doe",
                "address1": "219 Osborn Road",
                "address2": "Houghton Estate",
                "address3": "",
                "postal": "2198",
                "country": "za",
                "city": "Johannesburg",
                "province": "Gauteng",
                "email": "john.doe@mydomainname.co.za",
                "fax": "",
                "phone": "+27.123456789",
                "company": ""
            },
            "strTemplateName": "Sample Tpl1",
            "strType": "billing",
            "strTemplateId": "m4Gtti4lL7G4THQF",
            "boolDefaultTemplate": 1
        }
    ],
    "intTotal": 4,
    "intFilterTotal": 4,
    "intReturnedTotal": 4,
    "objReseller": {
        "username": "yourusername",
        "balance": "1106.00",
        "accountType": "pre",
        "lowBalance": false
    },
    "strApiHost": "api-dnode05"
}

Gets a list of contact templates

HTTP Request

GET /template/contact

Query Parameters

Parameter Required Description
default no true to fetch default template only. Default is false
type no Which type of template to search for. Can be either registrant,admin,billing or tech. If omitted all types are returned
list no Whether a simple or full list should be returned. Defaults to simple
name no The template name to search for
templateId no The templateId to search for
search no The template name to search for
sortBy no What field to sort the returned result by. Options are name, type, contact, default and email
order no Order to sort by. Options are ascending or descending
startPoint no For pagination, the start point for the returned results
limit no For pagination, the amount of reseller accounts to return

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrTemplates string Template array as shown below
intReturnedTotal integer Total entries returned in result for pagination
intFilterTotal integer Total entries found with applied filters
intTotal integer Total entries found
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Templates Array

Parameter Type Description
arrContact array The contact details array is only returned for full list
strTemplateName string The template name
strType string Which type of contact the template is meant for. Can be either registrant,admin,billing or tech
strTemplateId string The unique template ID
boolDefaultTemplate string Whether or not the template is set to be the default

arrContact Array

Parameter Type Description
name string The contact persons name
email string The contact persons email
company string The company name
phone string The contact number
fax string The fax number
address1 string The contact persons address line 1
address2 string The contact persons address line 2
address3 string The contact persons address line 3
city string The contact persons city
province string The contact persons province
postal string The contact persons postal code
country string The contact persons country

Create Contact Template

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'templateName' => 'My Company template',
    'type' => 'registrant',
    'name' => 'John Doe',
    'email' => 'john.doe@mydomainname.co.za',
    'country' => 'ZA',
    'province' => 'Gauteng',
    'phone' => '+27.123456789',
    'postalCode' => '2192',
    'address1' => '1 Zuid Street',
    'city' => 'Johannesburg',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/contact', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "927703a0-0bea-11ec-86e4-4da3796a5def",
  "strMessage": "Successful",
  "objReseller": {
    "username": "yourusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

Creates a new contact template

HTTP Request

POST /template/contact

Post Parameters

Parameter Required Description
templateName yes A name for the template. There is a unique constraint over the template name + contact type
type yes Options are registrant,admin,billing,tech,all
default no Whether the template is to be set as the default template for this type. Default value is false
name yes The contact persons name
company yes The contact persons company name
email yes The contact persons email address
country yes The contact persons country in ISO 3166-1 alpha-2 code
province yes The contact persons state or province
phone yes The contact persons contact number
postalCode yes The contact persons area or postal code
address1 yes The contact persons address line 1
address2 no The contact persons address line 2
address3 no The contact persons address line 3
city yes The contact persons city

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Update Contact Template

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'templateId' => 'm4Gtti4lL7G4THQF',
    'templateName' => 'My 2nd Company template',
    'type' => 'registrant',
    'name' => 'John Doe',
    'email' => 'john.doe@mydomainname.co.za',
    'country' => 'ZA',
    'province' => 'Gauteng',
    'phone' => '+27.123456789',
    'postalCode' => '2198',
    'address1' => '219 Osborn rd',
    'city' => 'Johannesburg',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/contact', $params, 'PUT', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "1f761c20-0bf0-11ec-b07c-a7d52de395a5",
  "strMessage": "Successful",
  "objReseller": {
    "username": "yourusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

Updates a contact template

HTTP Request

PUT /template/contact

Post Parameters

Parameter Required Description
templateId no The ID of the template to update
templateName no A name for the template to update
type no Options are registrant,admin,billing,tech,all
default no Whether the template is to be set as the default template for this type. Default value is false
name yes The contact persons name
company yes The contact persons company name
email yes The contact persons email address
country yes The contact persons country in ISO 3166-1 alpha-2 code
province yes The contact persons state or province
phone yes The contact persons contact number
postalCode yes The contact persons area or postal code
address1 yes The contact persons address line 1
address2 no The contact persons address line 2
address3 no The contact persons address line 3
city yes The contact persons city

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Remove Contact Template

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'templateId' => 'm4Gtti4lL7G4THQF',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/contact', $params, 'DELETE', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "d6468830-0bf0-11ec-b831-1b748c641c5c",
  "strMessage": "Successful",
  "objReseller": {
    "username": "yourusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

Deletes a contact template

HTTP Request

DELETE /template/contact

Post Parameters

Parameter Required Description
templateId no The ID of the template to update
templateName no A name for the template to update
type no The template contact type

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

List NS Templates

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'list' => 'full'
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/ns', $params, 'GET', $headers);

print_r($result);
?>

Success Response for simple list:

{
  "intReturnCode": 1,
  "strUUID": "aae63ca0-0bf4-11ec-91e5-b578ea3b50af",
  "strMessage": "Successful",
  "arrTemplates": [
    {
      "strTemplateName": "Sample Template 1",
      "strTemplateId": "63fb5a3db2",
      "boolDefaultTemplate": 0
    },
    {
      "strTemplateName": "Sample Template 2",
      "strTemplateId": "afc8047172",
      "boolDefaultTemplate": 1
    }
  ],
  "intTotal": 2,
  "intFilterTotal": 2,
  "intReturnedTotal": 2,
  "objReseller": {
    "username": "yourusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

Success Response for full list:

{
  "intReturnCode": 1,
  "strUUID": "5451ec90-0bf4-11ec-9d87-e3795e80af32",
  "strMessage": "Successful",
  "arrTemplates": [
    {
      "arrNameservers": [
        "ns1.mynameserver.co.za",
        "ns2.mynameserver.co.za",
      ],
      "strTemplateName": "Sample Template 1",
      "strTemplateId": "63fb5a3db2",
      "boolDefaultTemplate": 0
    },
    {
      "arrNameservers": [
        "ns1.myothernameserver.co.za",
        "ns2.myothernameserver.co.za",
      ],
      "strTemplateName": "Sample Template 2",
      "strTemplateId": "afc8047172",
      "boolDefaultTemplate": 1
    }
  ],
  "intTotal": 2,
  "intFilterTotal": 2,
  "intReturnedTotal": 2,
  "objReseller": {
    "username": "yourusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
    "strApiHost": "api-dnode05"
}

Gets a list of nameserver templates

HTTP Request

GET /template/ns

Query Parameters

Parameter Required Description
default no true to fetch default template only. Default is false
list no Whether a simple or full list should be returned. Defaults to simple
name no The template name to search for
templateId no The templateId to search for
search no The template name to search for
sortBy no What field to sort the returned result by. Options are name, date and default
order no Order to sort by. Options are ascending or descending
startPoint no For pagination, the start point for the returned results
limit no For pagination, the amount of reseller accounts to return

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrTemplates string Template array as shown below
intReturnedTotal integer Total entries returned in result for pagination
intFilterTotal integer Total entries found with applied filters
intTotal integer Total entries found
objReseller ResellerObject Reseller Object contains the users billing details
strApiHost string This is the api server that handled the transaction

Templates Array

Parameter Type Description
arrNameservers array The nameserver array is only returned for full list and contains an array of ns strings
strTemplateName string The template name
strTemplateId string The unique template ID
boolDefaultTemplate string Whether or not the template is set to be the default

Create NS Template

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'name' => 'My Company template',
    'ns' => [
        'ns1.mynameserver.com',
        'ns2.mynameserver.com',
        'ns3.mynameserver.com',
    ],
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/ns', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "a9fc98c0-0bf6-11ec-803c-cf8135b6561b",
  "strMessage": "Successful",
  "objReseller": {
    "username": "yourusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

Creates a new nameserver template

HTTP Request

POST /template/ns

Post Parameters

Parameter Required Description
name yes A unique name for the template
default no Whether the template is to be set as the default ns template. Default value is false
ns yes An array of nameserver items

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Update NS Template

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'name' => 'My Company template',
    'ns' => [
        'ns1.mynameserver.com',
        'ns2.mynameserver.com',
        'ns3.mynameserver.com',
    ],
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/ns', $params, 'PUT', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "d62184e0-0bf7-11ec-97ff-ef9c9141de8f",
  "strMessage": "Successful",
  "objReseller": {
    "username": "yourusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

Updates a nameserver template

HTTP Request

PUT /template/ns

Post Parameters

Parameter Required Description
name yes The unique name for the template
default no Whether the template is to be set as the default ns template. Default value is false
ns yes An array of nameserver items

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Remove NS Template

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'templateName' => 'My Company template',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/ns', $params, 'DELETE', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "22fc4e50-0bf8-11ec-8a3a-c35c9fa54e53",
  "strMessage": "Successful",
  "objReseller": {
    "username": "yourusername",
    "balance": "1106.00",
    "accountType": "pre",
    "lowBalance": false
  },
  "strApiHost": "api-dnode05"
}

Deletes a nameserver template

HTTP Request

DELETE /template/ns

Post Parameters

Parameter Required Description
templateId no The ID of the template to update
templateName no A name for the template to update

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

List DNS Templates

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'showRecords' => true
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/dns', $params, 'GET', $headers);

print_r($result);
?>

Success Response for showRecords = true list:

{
  "intReturnCode": 1,
  "strUUID": "1aaeabb0-9641-11ec-846c-e1b2ca73cc34",
  "strMessage": "Successful",
  "arrTemplates": [
    {
      "name": "SampleTpl",
      "default": 1,
      "arrRecords": [
        {
          "templateId": 6,
          "content": "<ipaddress>",
          "name": "<domain>",
          "priority": 0,
          "ttl": 600,
          "type": "A"
        },
        {
          "templateId": 6,
          "content": "<domain>",
          "name": "www.<domain>",
          "priority": 0,
          "ttl": 600,
          "type": "CNAME"
        }
      ]
    }
  ],
  "strApiHost": "api-dnode05"
}

Success Response for showRecords = false list:

{
  "intReturnCode": 1,
  "strUUID": "2fe61e50-9641-11ec-9fb1-b52d117b5781",
  "strMessage": "Successful",
  "arrTemplates": [
    {
      "name": "SampleTpl",
      "default": 1
    }
  ],
  "strApiHost": "api-dnode05"
}

Gets a list of DNS templates (and records)

HTTP Request

GET /template/dns

Query Parameters

Parameter Required Description
showRecords no true to include records linked to template. Default is false

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
arrTemplates string Template array as shown below
strApiHost string This is the api server that handled the transaction

Templates Array

Parameter Type Description
name string The template name
default string Whether or not the template is set to be the default
arrRecords array The DNS record array is only returned for showRecords = true list and contains an array of dns records

DNS Records Array

Parameter Type Description
templateId integer The DNS template ID
priority integer Priority of the DNS record
ttl integer The TTL of the DNS record
type string Type of DNS record (A, AAA, AAAA,MX, SOA, TXT, CNAME, CAA, NS, PTR, SPF, SRV)
content string The value / destination of the DNS record
name string The alias / name of the record

Create DNS Template

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'name'    => 'MyDnsTemplate',
    'default' => 'true',

];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/dns', $params, 'POST', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "75eb4080-963f-11ec-8cf5-b9e957ff2e64",
  "strMessage": "Successful",
  "strApiHost": "api-dnode05"
}

Creates a new DNS template

HTTP Request

POST /template/dns

Post Parameters

Parameter Required Description
name yes A unique name for the template
default no Whether the template is to be set as the default dns template. Default value is false

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Update DNS Template

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'name' => 'MyDnsTemplate',
    'name1' => '<domain>',
    'content1' => '<ipaddress>',
    'type1' => 'A',
    'ttl1' => '600',
    'prio1' => '0',
    'name2' => 'www.<domain>',
    'content2' => '<domain>',
    'type2' => 'CNAME',
    'ttl2' => '600',
    'prio2' => '0',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/dns', $params, 'PUT', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "86273f40-9640-11ec-bbb1-9d493421ccca",
  "strMessage": "Successful",
  "strApiHost": "api-dnode05"
}

Updates a DNS template's records

HTTP Request

PUT /template/dns

Post Parameters

Parameter Required Description
name yes The unique name of the template
default no Whether the template is to be set as the default dns template. Default value is false
type1 yes Type of DNS record (A, AAA, AAAA,MX, SOA, TXT, CNAME, CAA, NS, PTR, SPF, SRV)
ttl1 no Defaults the TTL to 3600
name1 no Name of the record. If the domain is not appended to the name, it will be done automatically
content1 yes The value or destination of the DNS record
prio1 no Defaults to 0 (highest priority)
type999 no Type of DNS record (A, AAA, AAAA,MX, SOA, TXT, CNAME, CAA, NS, PTR, SPF, SRV)
ttl999 no Defaults the TTL to 3600
name999 no Name of the record. If the domain is not appended to the name, it will be done automatically
content999 no The value or destination of the DNS record
prio999 no Defaults to 0 (highest priority)

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Remove DNS Template

Sample Request:

<?php

function domainsCurl($endpoint, $params = array(), $method = 'GET', $headers = array())
{
    $ch = curl_init();

    $url = 'https://api.domains.co.za/api' . '/' . $endpoint;

    if ($method != 'POST') {
        $url .= '?' . http_build_query($params);
    } else {
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    }
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $output = curl_exec($ch);

    if (curl_error($ch)) {
        $output = curl_error($ch);
    }

    curl_close($ch);

    return $output;
}

$token = 'Your secret token from the auth function goes here.';

$params = [
    'name' => 'SampleTpl',
];

$headers = [
    'Authorization: Bearer ' . $token
];

$result = domainsCurl('template/dns', $params, 'DELETE', $headers);

print_r($result);
?>

Success Response:

{
  "intReturnCode": 1,
  "strUUID": "22fc4250-0bf8-18ec-8a3a-c35c9fa52e53",
  "strMessage": "Successful",
  "strApiHost": "api-dnode05"
}

Deletes a nameserver template

HTTP Request

DELETE /template/dns

Post Parameters

Parameter Required Description
name yes The name of the template to delete

Response Parameters

Parameter Type Description
intReturnCode integer Api call return code, corresponds to return codes
strUUID string Unique identifier for the api transaction
strMessage string Api call status message
strApiHost string This is the api server that handled the transaction

Objects

Reseller Object

Sample Object:

{
  "username": "yourusername",
  "balance": "100.00",
  "accountType": "pre",
  "lowBalance": false
}

The reseller object contains details pertaining to a reseller, specifically billing information

Parameter Type Description
username string The username of the reseller
balance float The balance of the reseller
accountType string Whether the reseller is pre or post billing
lowBalance boolean Whether or not the reseller is in a low balance state

Contact Object

Sample Object:

{
  "strContactId":"58be5d32ddd21",
  "strContactName":"John Doe",
  "strContactEmail":"john.doe@mydomainname.co.za",
  "strContactNumber":"+27.0123456789",
  "strContactCompany":"My Company",
  "strContactAddress":["219 Osborn Rd","Houghton Estate Office Park",""],
  "strContactCity":"Johannesburg",
  "strContactProvince":"Gauteng",
  "strContactPostalCode":"2198",
  "strContactCountry":"ZA",
  "strContactFax":"",
  "strContactType":"registrant",
  "strStatus":"ok,linked",
  "strVerificationStatus":"Verified"
}

The contact object contains details pertaining to a domain contact

Parameter Type Description
strContactId string Unique epp contact ID for the contact object
strContactName string The contact persons name
strContactEmail string The contact persons email address
strContactNumber string The contact persons contact number
strContactCompany string The contact persons company name
strContactAddress array The contact persons address in array format
strContactCity string The contact persons city
strContactProvince string The contact persons state or province
strContactPostalCode string The contact persons area or postal code
strContactCountry string The contact persons country in ISO 3166-1 alpha-2 code
strContactFax string The contact persons fax number
strContactType string Whether the contact is registrant,admin,billing or tech
strStatus string Contains the EPP status of the contact
strVerificationStatus string Whether or not contact data has been verified. Only applies to registrant
php