NAME

WWW::eNom::Role::Command::Raw - Low Level Access to eNom API

SYNOPSIS

use WWW::eNom;

my $eNom     = WWW::eNom->new( ... );
my $response = $eNom->Check(
    SLD => 'enom',
    TLD => 'com',
);

REQUIRES

username
password
_uri
response_type

DESCRIPTION

This role composes a series of methods into the consuming class (WWW::eNom) that directly expose methods of the eNom API. It is the lowest level of access to the eNom API and is intended only for the most advanced usages that are not covered by other commands.

NOTE You almost never want to make this low level of a call. You really should be looking at the commands to find the specific method to accomplish your goals.

METHODS

Most of the eNom API Methods have been included and are exposed based on the name of the method as documented in eNom's API Reference Docs. If you really wish to use the eNom API directly this is how you would do it, but keep in mind you'll have to read the details of the documentation for that method and handle the parsing of request params and the response yourself. Again, you should try very hard to avoid doing this, if you find some functionalty that is not exposed through WWW::eNom a bug report or pull request is your best bet.

However, if your heart is set then let's use an example method to demonstrate how best to make use of these low level API calls.

Check

use WWW::eNom;

my $eNom = WWW::eNom->new(
    ...
    response_type => 'xml_simple',
);

 my $response = $eNom->Check( SLD => 'enom', TLD => 'com', );

Although not required, it is recommend that you specify a response_type of 'xml_simple' when making low level requests. This will at least make the response a HashRef (rather than a string). This response should look very similar to the response documented by the specific method with eNom with the following modifications made to make the system easier to work with.

"responses" returns an ArrayRef of HashRefs
Keys which end with a number are transformed into an ArrayRef

If you had a response:

{
    RRPText1 => 'Domain Not Available',
    RRPText2 => 'Domain Available',
    RRPText3 => 'Domain Not Available',
}

This is automagically converted into...

{
    RRPText => [ 'Domain Not Available', 'Domain Available', 'Domain Not Available' ],
}

This is especially important when looking at errors or the "ErrX" response. Rather than having the numbered responses, that is converted to an ArrayRef.

These changes make a possible response look like:

{
    Domain  => [qw(enom.com enom.net enom.org enom.biz enom.info)],
    Command => "CHECK",
    RRPCode => [qw(211 211 211 211 211)],
    RRPText => [
        "Domain not available",
        "Domain not available",
        "Domain not available",
        "Domain not available",
        "Domain not available"
    ]
}

However, keep in mind you will need to refer to the actual documentation from eNom because even similar methods could have vastly different responses.