<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Regru::API - Perl bindings for Reg.ru API v2

VERSION
    version 0.004

SYNOPSIS
        my $client = Regru::API-&gt;new(
            username =&gt; 'test',
            password =&gt; 'test',
        );

        # trivial API request
        my $resp = $client-&gt;nop;

        if ($resp-&gt;is_success) {
            print $response-&gt;get('user_id');
        }
        else {
            print "Error code: " . $resp-&gt;error_code . ", Error text: " . $resp-&gt;error_text;
        }

DESCRIPTION
    Regru::API implements simplified access to the REG.API v2 provided by
    REG.RU LLC. This is a JSON-driven implementation. Input/output request
    data will transforms from/to JSON transparently.

  Categories (namespaces)
    REG.API methods are divided into categories (namespaces). When you wish
    to make an API request to some REG.API method, that belongs to some
    namespace (category) you should get a namespace handler (defined as
    trivial client's method):

        # suppose we already have a client
        $client-&gt;user-&gt;nop;

        # or like this
        $zone = $client-&gt;zone;
        $zone-&gt;register_ns(...);

    At the moment there are the following namespaces:

    root
        General purpose methods such as "nop", "reseller_nop" etc which are
        described below. Actually is a virtual namespace defined by client.
        No needs to get namespace handler. The methods of this "namespace"
        are available as client's methods directly.

            $client-&gt;nop;
            $client-&gt;reseller_nop;

        See "REG.API METHODS".

    user
        User account management methods.

            # suppose we already have a client
            $client-&gt;user-&gt;nop;

        See Regru::API::User for details and REG.API Account management
        functions &lt;https://www.reg.com/support/help/API-version2#user_fn&gt;.

    domain
        Domain names management methods.

            # suppose we already have a client
            $client-&gt;domain-&gt;get_nss(
                domain_name =&gt; 'gallifrey.ru',
            );

        See Regru::API::Domain for details and REG.API Domain management
        functions &lt;https://www.reg.com/support/help/API-version2#domain_fn&gt;.

    zone
        DNS resource records management methods.

            # suppose we already have a client
            $client-&gt;zone-&gt;clear(
                domain_name =&gt; 'pyrovilia.net',
            );

        See Regru::API::Zone for details and REG.API DNS management
        functions &lt;https://www.reg.com/support/help/API-version2#zone_fn&gt;.

    service
        Service management methods.

            # suppose we already have a client
            $client-&gt;service-&gt;delete(
                domain_name =&gt; 'sontar.com',
                servtype    =&gt; 'srv_hosting_plesk',
            );

        See Regru::API::Service for details and REG.API Service management
        functions
        &lt;https://www.reg.com/support/help/API-version2#service_fn&gt;.

    folder
        User folders management methods.

            # suppose we already have a client
            $client-&gt;folder-&gt;create(
                folder_name =&gt; 'UNIT',
            );

        See Regru::API::Folder for details and REG.API Folder management
        functions &lt;https://www.reg.com/support/help/API-version2#folder_fn&gt;.

    bill
        Invoice management methods.

            # suppose we already have a client
            $client-&gt;bill-&gt;get_not_payed(
                limit =&gt; 10,
            );

        See Regru::API::Bill for details and REG.API Invoice management
        functions &lt;https://www.reg.com/support/help/API-version2#bill_fn&gt;.

  Methods accessibility
    All REG.API methods can be divided into categories of accessibility. On
    manual pages of this distibution accessibility marked by "scope" tag. At
    the moment the following categories of accessibility present:

    everyone
        All methods tagged by this one are accessible to all users. Those
        methods does not require authentication before call.

    clients
        This tag indicates the methods which accessible only for users
        registered on reg.com &lt;https://www.reg.com&gt; website. Strongly
        required an authenticated API request.

    partners
        Group of methods which accessible only for partners (resellers) of
        the REG.RU LLC. Actually, partners (resellers) able to execute all
        methods of the REG.API without any restrictions.

  Request parameters
    Each API request should contains a set of parameters. There are the
    following parameters:

    authentication parameters
        These parameters are mandatory for the each method that requires
        authentication. This group of parameters includes "username" and
        "password". Both parameters should be passed to the constructor and
        their will be added to API request.

    management parameters
        This group include parameters defines input/output formats,
        encodings and language prefecence. Some parameters are fixed to
        certains values, some might be set via passing values to the
        constructor: see "io_encoding" and "lang" options.

    service identification parameters
        The group of parameters with aims to point to the particular service
        or group of services such as domain names, folders, etc. Should be
        passed to an API request together with "method specific parameters".

        More info at REG.API Service identification parameters
        &lt;https://www.reg.com/support/help/API-version2#inputparams_identific
        ation&gt;

    method specific parameters
        Parameters applicable to a particular API method. Very wide group.
        Strongly recommended to consult with REG.API documentation for each
        method before perform an API request to it. The distribution's
        manual pages includes links to documentation for each API method
        call. The main source for the method specific parameters available
        at REG.API General description of functions
        &lt;https://www.reg.com/support/help/API-version2#common_fn_descr&gt;.

  Response parameters
    Response parameters of the API request automatically handles by
    Regru::API::Response module. There is no reasons to do some addtional
    work on them. Each response may contains the following set of fileds:

    result
        The result of API request. Either "success" or "error". Can be
        accessed via attribute is_success in boolean context.

    answer
        The answer of API method call. May appear only when result of API
        request was successful. Can be accessed via attribute answer.
        Default value is "{}" (empty HashRef). Gets assigned a default value
        if result of API request was finished with error.

    error_code
        The error code of API method call. May appear only when result of
        API request finished with error. Can be accessed via attribute
        error_code. See details at REG.API Common error codes
        &lt;https://www.reg.com/support/help/API-version2#std_error_codes&gt;.

    error_text
        The short description of error. The language depends on option lang
        "new" passed to constructor. May appear only when result of API
        request finished with error. Can be accessed via attribute
        error_text. See details at REG.API Common error codes
        &lt;https://www.reg.com/support/help/API-version2#std_error_codes&gt;.

    error_params
        Additional parameters included to the error. May appear only when
        result of API request finished with error. Can be accessed via
        attribute error_params.

  Access to REG.API in test mode
    REG.RU LLC provides an access to REG.API in test mode. For this, might
    be used a test account with "username" and "password" equals to test.

        my $client = Regru::API-&gt;new(username =&gt; 'test', password =&gt; 'test');
        # we're in test mode now
        $client-&gt;domain-&gt;get_prices;

    In the test mode REG.API engine (at server-side) handles API request:
    ensures necessary checks of input parameters, produces response but
    actually does not perform any real actions/changes.

    Also, for debugging purposes REG.API provides a special set of methods
    allows to ensure the remote system for availability without workload at
    minimal response time. Each namespace has method called nop for that.

METHODS
  new
    Creates a client instance to interract with REG.API.

        my $client = Regru::API-&gt;new(
            username =&gt; 'Rassilon',
            password =&gt; 'You die with me, Doctor!'
        );

        my $resp = $client-&gt;user-&gt;get_balance;

        print $resp-&gt;get('prepay') if $resp-&gt;is_success;

        # another cool code...

    Available options:

    username
        Account name of the user to access to reg.com &lt;https://www.reg.com&gt;
        website. Required. Should be passed at instance create time.
        Although it might be changed at runtime.

            my $client = Regru::API-&gt;new(username =&gt; 'Cyberman', password =&gt; 'Exterminate!');
            ...
            # at runtime
            $client-&gt;username('Dalek');

    password
        Account password of the user to access to reg.com
        &lt;https://www.reg.com&gt; website or an alternative password for API
        defined at Reseller settings &lt;https://www.reg.com/reseller/details&gt;
        page. Required. Should be passed at instance create time. Although
        it might be changed at runtime.

            my $client = Regru::API-&gt;new(username =&gt; 'Master', password =&gt; 'Doctor');
            ...
            # at runtime
            $client-&gt;password('The-Master.');

    io_encoding
        Defines encoding that will be used for data exchange between the
        Service and the Client. At the moment REG.API v2 supports the
        following encodings: "utf8", "cp1251", "koi8-r", "koi8-u", "cp866".
        Optional. Default value is utf8.

            my $client = Regru::API-&gt;new(..., io_encoding =&gt; 'cp1251');
            ...
            # or at runtime
            $client-&gt;io_encoding('cp1251');

            my $resp = $client-&gt;user-&gt;create(
                user_login      =&gt; 'othertest',
                user_password   =&gt; '111',
                user_email      =&gt; 'test@test.ru',
                user_first_name =&gt; $cp1251_encoded_name
            );

    lang
        Defines the language which will be used in error messages. At the
        moment REG.API v2 supports the following languages: "en" (English),
        "ru" (Russian) and "th" (Thai). Optional. Default value is en.

            my $client = Regru::API-&gt;new(..., lang =&gt; 'ru');
            ...
            # or at runtime
            $client-&gt;lang('ru');

            $client-&gt;username('bogus-user');
            print $client-&gt;nop-&gt;error_text; # -&gt; "РћС€РёР±РєР° Р°СѓС‚РµРЅС‚РёС„РёРєР°С†РёРё РїРѕ РїР°СЂРѕР»СЋ"

    debug
        A few messages will be printed to STDERR. Default value is 0
        (suppressed debug activity).

            my $client = Regru::API-&gt;new(..., debug =&gt; 1);
            ...
            # or at runtime
            $client-&gt;debug(1);

  user
    Returns a handler to access to REG.API user account management methods.
    See Regru::API::User.

  domain
    Returns a handler to access to REG.API domain name management methods.
    See Regru::API::Domain.

  zone
    Returns a handler to access to REG.API DNS resource records management
    methods. See Regru::API::Zone.

  service
    Returns a handler to access to REG.API service management methods. See
    Regru::API::Service.

  folder
    Returns a handler to access to REG.API folder management methods. See
    Regru::API::Folder.

  bill
    Returns a handler to access to REG.API invoice management methods. See
    Regru::API::Bill.

  namespace_handlers
    Creates shortcuts to REG.API categories (namespaces). Used internally.

REG.API METHODS
  nop
    For testing purposes. Scope: everyone. Typical usage:

        $resp = $client-&gt;nop;

    Answer will contains an user_id and login fields.

    More info at Common functions: nop
    &lt;https://www.reg.com/support/help/API-version2#nop&gt;.

  reseller_nop
    Similar to previous one but only for partners. Scope: partners. Typical
    usage:

        $resp = $client-&gt;reseller_nop;

    Answer will contains an user_id and login fields.

    More info at Common functions: nop
    &lt;https://www.reg.com/support/help/API-version2#reseller_nop&gt;.

  get_user_id
    Get the identifier of the current user. Scope: clients. Typical usage:

        $resp = $client-&gt;get_user_id;

    Answer will contains an user_id field.

    More info at Common functions: nop
    &lt;https://www.reg.com/support/help/API-version2#get_user_id&gt;.

  get_service_id
    Get service or domain name identifier by its name. Scope: clients.
    Typical usage:

        $resp = $client-&gt;get_service_id(
            domain_name =&gt; 'teselecta.ru',
        );

    Answer will contains a service_id field or error code if requested
    domain name/service not found.

    More info at Common functions: nop
    &lt;https://www.reg.com/support/help/API-version2#get_service_id&gt;.

SEE ALSO
    Regru::API::Bill

    Regru::API::Domain

    Regru::API::Folder

    Regru::API::Service

    Regru::API::User

    Regru::API::Zone

    Regru::API::Response

    REG.API Common functions
    &lt;https://www.reg.com/support/help/API-version2#tests_fn&gt;

    REG.API Common error codes
    &lt;https://www.reg.com/support/help/API-version2#std_error_codes&gt;

BUGS
    Please report any bugs or feature requests on the bugtracker website
    https://github.com/regru/regru-api-perl/issues

    When submitting a bug or request, please include a test-file or a patch
    to an existing test-file that illustrates the bug or desired feature.

AUTHORS
    *   Polina Shubina &lt;shubina@reg.ru&gt;

    *   Anton Gerasimov &lt;a.gerasimov@reg.ru&gt;

COPYRIGHT AND LICENSE
    This software is copyright (c) 2013 by REG.RU LLC.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

</pre></body></html>