Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

DomainWhoIs()

hitmanpt edited this page Feb 8, 2017 · 12 revisions

Through this explanation we assume that you have using WHMCS_API; on the begining of the file
And the API() class initialized as _api
If needed check the Getting Started page

Contents


Function Overview

Prototype: public DomainWhoIs DomainWhoIs(string Domain)

Input:

  • Domain: The domain to be checked (required)

Output: DomainWhoIs Model

Exception: "An API Error has Ocurred" witch contains an inner exception with further explanation of the error


Function Details

To call it just use DomainWhoIs dwhi = _api.DomainWhoIs("example.com");

The DomainWhoIs model does not have it's own namespace!

The result will be stored in dwhi variable with the result of the call (it should allways be success) the domain status and whois

The status dwhi.Status it's the registration status: available or unavailable

The whois dwhi.WhoIs is only returned if the domain is unavailable. The whois may or may not be an json string (when I tested it wasn't therefore there is no model built for it.

View all details about DomainWhoIs Model

WHMCS API Reference: https://developers.whmcs.com/api-reference/domainwhois/

Donate


Full example

using WHMCS_API;

namespace YourApp
{
  class YourClass
  {
    public void YourFunction()
    {
       API _api = new API("username", "password", "accesskey", "url");
       DomainWhoIs dwhi = _api.DomainWhoIs("example.com");
       Console.WriteLine("Domain Status: {0}", dwhi.Status);
    }
  }
}