API Sample Commands

Or call 1 (425) 274-4500

C#

using System;
using System.Xml;

class Program
{
  static void Main(string[] args)
  {
    // URL for API request
    const string url = "https://resellertest.enom.com/interface.asp?command=check&sld=enom&tld=com&responsetype=xml&uid=resellid&pw=resellpw";

    // Load the API results into an XmlDocument object
    var xmlDoc = new XmlDocument();
    xmlDoc.Load(url);

    // Read the results
    var rrpCode = xmlDoc.SelectSingleNode("/interface-response/RRPCode").InnerText;
    var rrpText = xmlDoc.SelectSingleNode("/interface-response/RRPText").InnerText;

    // Perform actions based on results
	switch (rrpCode) {
	  case "210":
	    Console.WriteLine("Domain available");
		break;
	  case "211":
        Console.WriteLine("Domain not available");
		break;
      default:
        Console.WriteLine("{0} {1}", rrpCode, rrpText);
		break;
	}

    Console.Read();
  }
}

Visual Basic

Option Explicit On
Option Strict On

Imports System
Imports System.Xml
Imports System.Xml.Schema

Module Module1

  Sub Main()

    ' URL for API request
    Const url = "https://resellertest.enom.com/interface.asp?command=check&sld=enom&tld=comasfsa&responsetype=xml&uid=resellid&pw=resellpw"

    ' Load the API results into an XmlDocument object
    Dim xmlDoc As New XmlDocument()
    xmlDoc.Load(url)

    ' Read the results
    Dim rrpCode As String = xmlDoc.SelectSingleNode("/interface-response/RRPCode").InnerText
    Dim rrpText As String = xmlDoc.SelectSingleNode("/interface-response/RRPText").InnerText

    ' Perform actions based on results
    Select Case rrpCode
      Case "210"
        Console.WriteLine("Domain available")
      Case "211"
        Console.WriteLine("Domain not available")
      Case Else
        Console.WriteLine("{0} {1}", rrpCode, rrpText)
    End Select

    Console.Read()

  End Sub

End Module

PHP

<?php
  // URL for API request
  $url =  'https://resellertest.enom.com/interface.asp?command=check&sld=enom&tld=com&responsetype=xml&uid=resellid&pw=resellpw';
  // Load the API results into a SimpleXML object
  $xml = simplexml_load_file($url);

  // Read the results
  $rrpCode = $xml->RRPCode;
  $rrpText = $xml->RRPText;
	
  // Perform actions based on results
  switch ($rrpCode) {
    case 210:
	  echo "Domain available";
	  break;
	case 211:
	  echo "Domain not available";
	  break;
	default:
	  echo $rrpCode . ' ' . $rrpText;
      break;
  }
?>

ASP

<%
  ' URL for API request
  const url = "https://resellertest.enom.com/interface.asp?command=check&sld=enom&tld=com&responsetype=xml&uid=resellid&pw=resellpw"

  ' Execute the HTTP request for the API command
  Dim http : Set http = Server.CreateObject ("MSXML2.ServerXMLHTTP")
  http.Open "GET", url, False
  http.Send
   
  ' Read the results
  Dim rrpCode : rrpCode = http.responseXml.selectSingleNode("/interface-response/RRPCode").text
  Dim rrpText : rrpText = http.responseXml.selectSingleNode("/interface-response/RRPText").text

  ' Perform actions based on results
  Select Case rrpCode
    Case "210"
	  Response.Write "Domain available"
    Case "211"
	  Response.Write "Domain not available"
    Case Else
	  Response.Write rrpCode & " " & rrpText
  End Select
%>

Java

import java.net.*;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.xml.xpath.*;

public class Program {
  public static void main(String[] args) throws Exception {
	
    // URL for API request
	URL url = new URL("https://resellertest.enom.com/interface.asp?command=check&sld=enom&tld=com&responsetype=xml&uid=resellid&pw=resellpw");
		
	// Load the API results into a DOM Document object
	Document doc = DocumentBuilderFactory.newInstance()
					     .newDocumentBuilder()
					     .parse(url.openStream());

	// Read the results
    XPath xp = XPathFactory.newInstance().newXPath();
    String rrpCode = xp.evaluate("/interface-response/RRPCode", doc);
    String rrpText = xp.evaluate("/interface-response/RRPText", doc);
        
    // Perform actions based on results
    if (rrpCode == "210") {
      System.out.println("Domain available");
    }
      else if (rrpCode == "211") {
        System.out.println("Domain not available");
    }
    else {
      System.out.println(rrpCode + " " + rrpText);
    }
  }
}

Perl

use LWP::Simple;
use XML::LibXML::XPathContext;

# URL for API request
my $url = "https://resellertest.enom.com/interface.asp?command=check&sld=enom&tld=com&responsetype=xml&uid=resellid&pw=resellpw";

# Load the API results into a SimpleXML object
my $xml = get($url);
my $doc = XML::LibXML->new()->parse_string($xml);

# Read the results
my $rrpCode = $doc->findvalue("/interface-response/RRPCode");
my $rrpText = $doc->findvalue("/interface-response/RRPText");

# Perform actions based on results
if ($rrpCode == "210") {
	print "Domain available";
} elsif ($rrpCode == "211") {
	print "Domain not available";
} else {
	print $rrpCode . " " . $rrpText;
}
   is part of Tucows, a leading domain name services company.
Copyright © 1998-2024 Enom LLC. All rights reserved. Terms & Conditions | Privacy Policy | Abuse Policy