The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::eNom - Interact with eNom, Inc.'s reseller API

SYNOPSIS

        use strict;
        use warnings;
        use WWW::eNom;

        my $enom = WWW::eNom->new(
                username      => "resellid",
                password      => "resellpw",
                response_type => "xml_simple",
                test          => 1
        );
        $enom->AddToCart(
                EndUserIP => "1.2.3.4",
                ProductType => "Register",
                SLD => "myspiffynewdomain",
                TLD => "com"
        );
        ...

METHODS

new

Constructs a new object for interacting with the eNom API. If the "test" parameter is given, then the API calls will be made to the test server instead of the live one.

As of v0.3.1, an optional "response_type" parameter is supported. For the sake of backward compatibility, the default is "xml_simple"; see below for an explanation of this response type. Use of any other valid option will lead to the return of string responses straight from the eNom API. These options are:

  • xml

  • html

  • text

AddBulkDomains (and many others)

        my $response = $enom->AddBulkDomains(
                ProductType => "register",
                ListCount   => 1,
                SLD1        => "myspiffynewdomain",
                TLD1        => "com",
                UseCart     => 1
        );

Performs the specified command - see the eNom API users guide (https://www.enom.com/resellers/APICommandCatalogEnom.pdf) for the commands and their arguments.

For convenience, if you pass the "Domain" argument, it will be split into "SLD" and "TLD"; that is, you can say

        my $response = $enom->Check( SLD => "myspiffynewdomain", TLD => "com" );

or

        my $response = $enom->Check( Domain => "myspiffynewdomain.com" );

The default return value is a Perl hash (via XML::Simple) representing the response XML from the eNom API; the only differences are

  • The "errors" key returns an array instead of a hash

  • "responses" returns an array of hashes

  • Keys which end with a number are transformed into an array

So for instance, a command Check( Domain = "enom.@" )> (the "@" means "com, net, org") might return:

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

You will need to read the API guide to check whether to expect responses in "RRPText" or "responses"; it's not exactly consistent.

RELEASE NOTE

As of v1.0.0, this module has been renamed to WWW::eNom. Net::eNom is now a thin wrapper to preserve backward compatibility.

AUTHORS

Richard Simões, <rsimoes AT cpan DOT org> Simon Cozens, <simon AT simon-cozens DOT org>

ACKNOWLEDGEMENTS

Thanks to the UK Free Software Network (http://www.ukfsn.org/) for their support of this module's development. For free-software-friendly hosting and other Internet services, try UKFSN.

COPYRIGHT & LICENSE

Copyright 2011 Simon Cozens and Richard Simões.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU Lesser General Public License as published by the Free Software Foundation; or any compatible license.

See http://dev.perl.org/licenses/ for more information.