Dreamscape Reseller REST API Documentation

Information about REST API

Dreamscape Reseller REST API allows you quickly and easily integrate with our system. At the moment, the REST API provides the following capabilities:

  1. management of customers;
  2. management of Domain names;
  3. management of Hosting products (Web Hosting, Email Hosting, Servers, etc.);
  4. management of all the other products (SSL Certificate, Site Builder, Simple SEO, etc.);
  5. financial stuff: balance, invoices;
  6. various handbooks (list of currencies, list of TLDs with pricing, etc.).

To facilitate integration with REST API there is the Sandbox server. Using it you can test the all API methods. Sandbox server is analogous to a real server, but at the same time it is completely isolated and all actions performed on it do not affect the real server: real domains are not registered, money is not deducted from the account, etc. Read more about it in Sandbox section.

The Dreamscape Reseller REST API is available at the following URL:

https://reseller-api.ds.network

The API methods Documentation

We have prepared a page where you can see the full list of available API methods with a list of input parameters and examples of requests and responses. Also, you can try out all requests using that page.

Find & test all API calls here

Integration with Dreamscape Reseller REST API

In case you need to develop your custom integration with the REST API, use the following instructions:

  1. Find out Reseller API Key.

    To find Reseller API Key go to Reseller Console > Account Settings > API & WHMCS > API Setup.

  2. Generate Request ID. It must be MD5-hash and be unique for each request to avoid sending it twice if it was intercepted.

    You have the right to choose how to control the uniqueness. The main thing that it must be md5-hash.

    $request_id = md5(uniqid() . microtime(true)); // 7fd755f2390745071051fca4924831cd

  3. Create a signature which is an md5-hash from the concatenation of Request ID and API Key of the reseller.

    $api_key = '202cb962ac59075b964b07152d234b70';
    $signature = md5($request_id . $api_key); // 774d61236130b6ae545240613aca2716

  4. Specify the HTTP headers.

    Api-Request-Id: 7fd755f2390745071051fca4924831cd
    Api-Signature: 774d61236130b6ae545240613aca2716

The example of request scripts

This section contains examples of generating a signature and sending a request to Dreamscape Reseller REST API in some programming languages.

PHP

Download the ZIP-archive with examples for PHP programming language by following this link.

<?php

$api_key = '068d0a67ab617dc0d8a7f1481e8ae91d';
$request_id = md5(uniqid() . microtime(true));
$signature = md5($request_id . $api_key);
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'https://reseller-api.ds.network/domains/availability?domain_names[]=crazydomains.com.au&domain_names[]=vodien.com',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Api-Request-Id: ' . $request_id,
        'Api-Signature: ' . $signature,
    ],
]);

echo 'Response: ' . curl_exec($ch);

curl_close($ch);

Node.js

const fetch = require('node-fetch');
const crypto = require('crypto');

function md5(data) {
    return crypto.createHash('md5')
        .update(String(data))
        .digest('hex');
}

async function main() {
    const api_key = '068d0a67ab617dc0d8a7f1481e8ae91d';
    const request_id = md5(Date.now());
    const signature = md5(request_id + api_key);

    try {
        const url_search = 'domain_names[]=crazydomains.com.au&domain_names[]=vodien.com';
        const request = await fetch('https://reseller-api.ds.network/domains/availability?' + url_search, {
            method: 'GET',
            headers: {
                'Accept': 'application/json',
                'Api-Request-Id': request_id,
                'Api-Signature': signature,
            },
        });

        console.log('Response data:', await request.json());
    } catch (e) {
        console.error(e);
    }
}

main().catch(e => console.error(e));

Reseller API SDK

Reseller API PHP SDK

Reseller API PHP SDK - a library for interacting with the Reseller REST API using PHP programming language which provides a convenient and easy interface.
Using this library you will get the following features:

  1. call all the Reseller REST API methods;
  2. manipulate with data with use of objects instead of array;
  3. autocompletion for objects for all the entities in the IDE (domains, customers, products, etc);
  4. exception-based handling of errors;
  5. logging of requests, etc;

Download Reseller API PHP SDK Documentation

Sandbox

Sandbox is an isolated environment in which you can conduct your experiments. Performing actions in the sandbox does not affect the real account in any way. This means that funds will not be debited from your real balance, but it allows to order a test domains, products, etc in sandbox environment. The next services are presented in Sandbox:

  1. Reseller Console - https://reseller.sandbox.ds.network
  2. Dreamscape Reseller REST API - https://reseller-api.sandbox.ds.network

Notes:

  1. Sandbox credentials (login, password) are the same as for production environment.
  2. Reseller REST API is absolutely the same as for production. The Sandbox REST API server is available in the API methods Documentation, so you can test it here.

FAQ

  • I received HTTP code 401 "Unauthorized"

    If you receive HTTP code 401 "Unauthorized" it could mean the following:

    • wrong API Key

      Check that you are using the correct API Key.

    • the API Key contains extra characters (such as spaces at the beginning or end)

      Check the API Key for such characters. The API Key should contain only 32 alphanumeric characters in lowercase (eg c4ca4238a0b923820dcc509a6f75849b).

    • you use the Sandbox REST API Key when sending the request to the Production REST API or vice versa

      The API Key for the Sandbox REST API and for the Production REST API can be different. Login to the corresponding Reseller Console (Live or Sandbox) and copy the API Key from the page Account Settings > API & WHMCS > API Setup.

  • Can I use another format for requests different from JSON?

    You can use the following content types to send the request body:

    • application/json;
    • multipart/form-data;
    • application/x-www-form-urlencoded.

    In the case of responses, you will always receive content type application/json.

  • What is the maximum number of items per page?

    The maximum number of items per page - 100 items.

  • Do Reseller API details updates if I'll regenerate it in Sandbox Reseller Console?

    No, it's not. The Sandbox Reseller Console and the real Reseller Console are not related. That is, if you generate a new Reseller API Key or change some information in Sandbox Reseller Console these changes will not be applied to the real Reseller Console. This also works in the opposite direction - changes made in the real Reseller Console will not be applied in the Sandbox Reseller Console.

Predefined values

HTTP Codes

Code Title Description
200 OK The request was completed without errors.
201 Created The entity has been successfully created.
204 No Content The entity has been successfully deleted. The response body is empty.
400 Bad Request The application cannot or will not process the request because provided data are invalid.
401 Unauthorized Authentication headers is not specified or has an invalid format.
402 Payment Required Reseller account does not have sufficient funds to process the operation.
403 Forbidden The user might not have the necessary permissions for a resource.
404 Not Found The requested resource could not be found but may be available in the future.
500 Internal Server Error A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.

Customer Statuses as JSON

Id Name Description
1 Active Account active.
2 Pending Account is waiting for email verification.
3 Suspended Account suspended, can only login and add additional credit.
4 Disabled Account disabled, no login or any other action allowed.
5 Terminated Account deleted.

Domain Statuses as JSON

Id Name
1 Awaiting Registration
2 Registered
3 Awaiting Renewal
4 Awaiting Deleted
5 Deleted
6 Expired
7 Awaiting Transfer In
8 Awaiting Transfer Out
9 Error

Product Statuses as JSON

Id Name
1 Awaiting registration
2 Registered
3 Awaiting Renewal
4 Awaiting Deleted
5 Deleted
6 Expired

DNS Record Types as JSON

Type Description
A DNS A (IPv4) record.
AAAA DNS A (IPv6) record.
TXT DNS TXT record.
CNAME DNS CNAME (Canonical Name) record.
MX DNS MX record.
CAA DNS CAA record.
SRV DNS SRV record.
WEBFWD DNS WEBFWD (URL Forward) record.
MAILFWD DNS MAILFWD (Mail Forward) record.

Accepted Business and Trading Number Types as JSON

Type Description
ABN Australian Business Number
ACN Australian Company Number
VIC BN Victoria BN
NSW BN New South Wales BN
SA BN South Australia BN
NT BN Northern Territory BN
WA BN Western Australia BN
TAS BN Tasmania BN
ACT BN Australian Capital Territory BN
QLD BN Queensland BN
TM Trademark BN
OTHER The other type of BN

Product plans

Follow the link to see a list of product plans for different product types.

See product plans

Eligibility fields

Please follow this link to see a list of eligibility fields for different TLDs. Please note that you may not find the list of fields for the TLD you are interested in. We may be working on this now or planning to add support in the near future.

You can read more information about eligibility in this article.

See eligibility fields