Docstoc

SgR2R EPP API _PERL_- v1.2.4.doc - fanyong.net

Document Sample
SgR2R EPP API _PERL_- v1.2.4.doc - fanyong.net Powered By Docstoc
					                                                    SgR2R.EPP API User Guide    Page 1 of 23




SgR2R.EPP PERL API User Guide
Version 1.2.2 – 24-September-2008

This document is a concise guide to installing and using the SgR2R API. The SgR2R API is a
set of Perl Libraries intended for Unix based operating systems. The API creates Extensible
Provisioning Protocol (EPP) commands that can be used to communicate with the SGNIC
Registry EPP Gateway Server.
                                                                                             SgR2R.EPP API User Guide                          Page 2 of 23



Table of Contents

1.      Prerequisites ......................................................................................................................................... 4

2.      Installing the SgR2R API Startup Kit ...................................................................................................... 4

3.      Using the SgR2R API .............................................................................................................................. 6

     3.1.      The SgR2R EPP implementation.................................................................................................... 6

        3.1.1 Related Web Links on EPP............................................................................................................ 6

     3.2.      Logging in and establishing the session ........................................................................................ 6

        3.2.1          Maximum number of socket connections ............................................................................ 7

        3.2.2          Idle time-out and Absolute time-out .................................................................................... 7

     3.3       Calling the API ............................................................................................................................... 7

4.      Available Functions ............................................................................................................................... 8

     4.1       Session Management .................................................................................................................... 8

        4.1.1          EPPlogin................................................................................................................................. 8

        4.1.2          EPPgreeting ........................................................................................................................... 9

        4.1.3          EPPlogout .............................................................................................................................. 9

        4.1.4          EPPhello ................................................................................................................................ 9

     4.2 Domain Operations ............................................................................................................................. 9

        4.2.1          EPPdomaincheck ................................................................................................................... 9

        4.2.2          EPPdomaincreate ................................................................................................................ 10

        4.2.3          EPPdomaininfo .................................................................................................................... 10

        4.2.4          EPPdomainupdateadd......................................................................................................... 11

        4.2.5          EPPdomainupdaterem ........................................................................................................ 11

        4.2.6          EPPdomainupdatechange ................................................................................................... 11

        4.2.7          EPPdomainupdate............................................................................................................... 11
                                                                                          SgR2R.EPP API User Guide                         Page 3 of 23


      4.2.8          EPPdomaindelete ................................................................................................................ 13

      4.2.9          EPPdomaintransferrequest ................................................................................................. 13

      4.2.10         EPPdomaintransferoperation ............................................................................................. 13

      4.2.11         EPPdomaintransfer ............................................................................................................. 14

      4.2.12         EPPdomaintransferstatus ................................................................................................... 14

      4.2.13         EPPdomainrenew ................................................................................................................ 15

      4.2.14         EPPdomainupdatewhoisprofile........................................................................................... 16

      4.2.15         EPPdomaininfowhoisprofile ................................................................................................ 16

      4.2.16         EPPpollreq ........................................................................................................................... 16

      4.2.17         EPPpollack ........................................................................................................................... 16

   4.3       Contact Operations ..................................................................................................................... 17

      4.3.1          EPPcontactcreate ................................................................................................................ 17

      4.3.2          EPPcontactinfo .................................................................................................................... 18

      4.3.3          EPPcontactupdatechange ................................................................................................... 19

      4.3.4          EPPcontactdelete ................................................................................................................ 19

   4.4 Host Operations ................................................................................................................................ 20

      4.4.1          EPPhostcreate ..................................................................................................................... 20

      4.4.2          EPPhostinfo ......................................................................................................................... 21

      4.4.3          EPPhostupdate .................................................................................................................... 21

      4.4.4          EPPhostupdateadd .............................................................................................................. 22

      4.4.5          EPPhostupdateremove ....................................................................................................... 22

      4.4.6          EPPhostdelete ..................................................................................................................... 22

Appendix A Glossary of SgR2R.EPP Commands .......................................................................................... 23
                                                         SgR2R.EPP API User Guide       Page 4 of 23


1.       Prerequisites
A Unix or Linux based operating system and Perl 5.x.



2.       Installing the SgR2R API Startup Kit
The following packages are included in the SgR2R API Startup Kit.

        SGR2R::API::APIProtocol
        SGR2R::API::R2R_API
        SGR2R::API::XML_Builder_for_Request
        SGR2R::API::Objects

The installation procedures of these packages follow Perl CPAN module standards. Just extract
the files from the .gz file included, go into each module directories, and install the modules using
the following commands

         perl Makefile.PL
         make
         make install


3rd party NET::SSLeay package must be installed in the OS to allow SSL connection
establishment to EPP server. NET::SSLeay package is available for download in CPAN.
Installation commands for NET::SSLeay are the same as the above. CPAN URL:

         http://search.cpan.org/~sampo/Net_SSLeay.pm-1.25/



SSL certificate is required to connect to SGNIC EPP server. Registrar can use certificates
purchased from Verisign or Thawte. Alternately, registrar can request for SGNIC signed
certificate.
                                                         SgR2R.EPP API User Guide   Page 5 of 23


The Registrar.conf configuration file

The standard location of the configuration file Registrar.conf is /sgnic/SGR2R/conf. If the
location of the file is changed, please update the corresponding file path in the APIProtocol.pm
and R2R_API.pm packages and then re-install the modules.

Each registrar should obtain a Registrar ID and password from SGNIC. Please update the ID
and password values in the configuration file in order to communicate with the server. Without a
valid ID, the API client will not be able to communicate with the EPP server.

This is a sample of the registrar.conf file:

# Regstrar.conf
#
#
# Description:
# - SGR2R Registrar Package Configuration File
#
#
$epp_host = 'ote.sgnic.sg';
$epp_rercode = 'EPP-RRTEST004';
$epp_password = 'xxxxxxxx';
$epp_port = 700;
$epp_version = '1.0';
$epp_ssl = 1;
$cacert_file = "/sgnic/api/cert/sgnicote_trusted.pem";
$cert_file = "/sgnic/api/cert/sgnicote_public.pem";
$key_file = "/sgnic/api/cert/sgnicote_private.pem";
#
#
                                                       SgR2R.EPP API User Guide    Page 6 of 23


3.     Using the SgR2R API
This section describes how the SgR2R.EPP API could be used to perform domain transactions
at the SgR2R.EPP Gateway.

3.1.   The SgR2R EPP implementation
       The Extensible Provisioning Protocol (EPP) is a set of XML text protocol that permits
       multiple service providers to perform object provisioning operations using a shared
       central object repository. It provides a standard Internet domain name registration
       protocol for use between domain name registrars and registries, although the protocol
       can also be used with other applications and types of objects.

       The SgR2R API is a simple application-programming interface to help Registrars to
       communicate with the SGNIC Registry. The API provides a simple interface that can be
       used to create EPP XML commands and process the XML response sent back from the
       EPP gateway server. Thus Registrars are shielded from the application implementation
       details of EPP XML parser and builder.

       All API generated EPP commands need to be forwarded to the EPP gateway server with
       SSL. SgR2R implements the EPP connection-oriented operating mode. A registrar has
       to use the EPP login command to establish a secure session with the Registry server
       before any other commands can be issued. The EPP server transaction ID clTRID,
       together with the Registrar ID, is used to identify each Registrar client session.

       The SgR2R EPP implementation can be divided into 4 different groups Session
       management, Domain object operation, Contact object operation, and Host object
       operation. The commands transfer and renew are not implemented for the contact and
       host objects since these operations are deemed meaningless in the SgR2R system.

       3.1.1 Related Web Links on EPP
              For a detailed description of the EPP protocol, please refer to the following web
              sites

              1.   http://www.ietf.org/rfc/rfc4930.txt?number=4930
              2.   http://www.ietf.org/rfc/rfc4931.txt?number=4931
              3.   http://www.ietf.org/rfc/rfc4932.txt?number=4932
              4.   http://www.ietf.org/rfc/rfc4933.txt?number=4933
              5.   http://www.ietf.org/rfc/rfc4934.txt?number=4934




3.2.   Logging in and establishing the session
       Once the EPP gateway server receives the EPPlogin() command, if the validation is
       successful, it will send a success response back to client and establish the current SSL
                                                      SgR2R.EPP API User Guide      Page 7 of 23


      session. The client can then send additional commands to the gateway server. The
      EPPlogout() command can be used to instruct the EPP gateway server to close the
      current session.

      3.2.1   Maximum number of socket connections
              There are a maximum number of socket connections allowed for each registrar
              ID. If the number is exceeded, the next login request will be rejected.

      3.2.2   Idle time-out and Absolute time-out
              Each session has a time to live (TTL) of 10 minutes (i.e., The session will be
              closed once it has been inactive for 10 minutes). This is referred to as the Idle
              Timeout.

              All sessions will be terminated after 24 hours of continuous connection (Absolute
              Timeout).



3.3   Calling the API
      The SgR2R API can be used to check the availability of a domain name in any language
      or symbol, obtain the pricing for a particular domain name, and obtain information for a
      domain name, register a domain name as well as to provided suggested alternatives to a
      queried domain name. A comprehensive list of the available functions in the SgR2R API
      is included in the Section 4 Available Functions.

      API calling consist of 4 major parts namely connection establishment, session creation,
      transaction commands and close session. To establish a SSL connection, commands
      below are required:

      SGR2R::API::APIProtocol::EPPConnect();
      SGR2R::API::APIProtocol::EPPGreeting();

      The EPPConnect() command will auto establish SSL socket to SGNIC EPP server.
      EPPGreeting() command is used to capture the greeting sent by SGNIC EPP server to
      indicate that the SSL socket has been created successfully.

      After that, EPPlogin() command is required to establish session. SGNIC EPP server will
      authenticate the request based on username and password sent from the client.

      Commands for contact creation, host creation, domain creation etc can be sent after
      connection is established and session is created.

      Once all operations are done, EPPlogout() command is required to properly terminate
      the session. If the command is not sent, the socket will remain connected until timeout at
      server end. This will cause new connections unable to establish. Thus it is important to
      logout from the system properly.
                                                      SgR2R.EPP API User Guide     Page 8 of 23


       The following routine is an example to retrieve EPP transfer queue from the system:
       EPPpollreq()


       use SGR2R::API::R2R_API;
       use SGR2R::API::APIProtocol;

       SGR2R::API::APIProtocol::EPPConnect();
       SGR2R::API::APIProtocol::EPPGreeting();

       my $reply = SGR2R::API::R2R_API::EPPlogin();
       if ($reply->{RCODE} eq 1000) {
                print “Login Successful”;
                my $reply1 = SGR2R::API::R2R_API::EPPpollreq();
                if ($reply1->{RCODE} eq 1300) {
                         print “Queue is empty”;
                } else {
                         print “Queue is not empty”;
                }
       } else {
                print “Login Failed”;
       }

       SGR2R::API::R2R_API::EPPlogout();


4.     Available Functions
The following sections provide description of each command available in the API for performing
domain transactions with the SgR2R.EPP Gateway.

4.1    Session Management
       Session Management commands allow the registrar to login to or logout off the Gateway

       4.1.1 EPPlogin
              Issue this command to establish the connection session with the server.

              (%ref) = EPPlogin()
                     $ref ->{RCODE} = 1000 ; Login successful
                            {RCODE} = 2001 ; Command syntax error
                            {RCODE} = 2002 ; Login command received within existing
                            session
                            {RCODE} = 2201 ; Authorization error
                     $ref -> {MSG} ; return messages
                                                      SgR2R.EPP API User Guide    Page 9 of 23


      4.1.2   EPPgreeting
              Issue this command to check for acknowledgement from EPP server.

              (%ref) = EPPgreeting()
                     $ref -> {MSG} ; Connection to registry error

      4.1.3   EPPlogout
              Issue this command to close the SSL connection.

              (%ref) = EPPlogout()
                     $ref ->{RCODE} = 1500 ; Logout successful
                            {RCODE} = 2001 ; Command syntax error
                            {RCODE} = 2500 ; Logout command received within existing
                            session
                     $ref -> {MSG} ; return messages


      4.1.4 EPPhello
              A client can request a greeting message from the server to ensure connection is
              alive. This command is to be used for keeping the SSL sessions alive.

              (%ref) = EPPhello()
                     $ref -> {MSG} ; Server alive


4.2 Domain Operations
Domain Operation commands are used for domain oriented transactions such as domain
creation, update, transfer or status change.

      4.2.1   EPPdomaincheck
              The Domain check function is used to determine the availability of a domain
              name for registration. The domain check function does not automatically create
              or hold the domain name if the domain is available.

              (%ref) = EPPdomaincheck ($domain)
                     $ref -> {RCODE} = 1000 ; command completed successfully
                            {RCODE} = 2001 ; command syntax error
                     $ref -> {MSG} ; return messages

                     $ref -> {AVAILABLE} ; 1 – domain available, 0 – domain not available
                                               SgR2R.EPP API User Guide     Page 10 of 23


4.2.2   EPPdomaincreate
        The Domain Create function is used to initiate the registration of a domain name.
        Domain name, Contact handles as well as Name Server information must be
        provided.

        The dominfo hash is used to store the domain information. To update the whois
        profile information for each contact, please use the EPPcontactupdate function
        after the creation of the domain.

        (%ref) = EPPdomaincreate(\%dominfo)


           %dominfo parameters        Description
           NAME                       Domain Name
           TERM                       Term (No of yrs)
           OWNERID                    Registrant ID
           ADMINID                    Admin Contact
           TECHID                     Technical Contact
           BILLID                     Billing Contact
           AUTHINFO                   Authorization Information
           NS1, NS2,… NS13            Name Server

               $ref -> {RCODE} = 1000 ; command completed successfully
                      {RCODE} = 1001 ; command completed successfully; action
                      pending
                      {RCODE} = 2001 ; command syntax error
                      {RCODE} = 2003 ; required parameter missing
                      {RCODE} = 2004 ; parameter value range error
                      {RCODE} = 2005 ; parameter value syntax error
                      {RCODE} = 2104 ; billing failure
                      {RCODE} = 2201 ; authorization error
                      {RCODE} = 2302 ; object exists
                      {RCODE} = 2303 ; object does not exists
                      {RCODE} = 2306 ; parameter value policy error
                      {RCODE} = 2400 ; command failed
               $ref -> {MSG} ; return messages
               $ref -> {EXPIRE} ; return expiration date


4.2.3   EPPdomaininfo
        The Obtain Domain Information function is used to retrieve domain information.
        To retrieve the whois profile information for each contact, please use the
        EPPcontactinfo function.
                                              SgR2R.EPP API User Guide    Page 11 of 23


        (%ref) = EPPdomaininfo($domain_name)
               $ref -> {NAME} ; Domain name
               $ref -> {OWNERID} ; Registrant ID
               $ref -> {ADMINID} ; Admin Contact ID
               $ref -> {TECHID} ; Tech Contact ID
               $ref -> {BILLID} ; Billing Contact ID
               $ref -> {CRDATE} ; date of purchase
               $ref -> {EXDATE} ; expiry date
               $ref -> {STATUS} ; Statuses
               $ref -> {AUTHINFO} ; Authorization Information
               $ref -> {NS1} ; Primary Name Server Domain ; up to 13 name servers
               $ref -> {RCODE} = 1000 ; command completed successfully
                       {RCODE} = 2001 ; command syntax error
                       {RCODE} = 2003 ; required parameter missing
                       {RCODE} = 2004 ; parameter value range error
                       {RCODE} = 2005 ; parameter value syntax error
                       {RCODE} = 2201 ; authorization error
                       {RCODE} = 2303 ; object does not exists
                       {RCODE} = 2306 ; parameter value policy error
                       {RCODE} = 2400 ; command failed
               $ref -> {MSG} ; return messages


4.2.4   EPPdomainupdateadd
        Deprecated


4.2.5   EPPdomainupdaterem
        Deprecated


4.2.6   EPPdomainupdatechange
        Deprecated


4.2.7   EPPdomainupdate
        The Update Domain function is used to add or remove information to a registered
        domain name. You may add/remove Name servers, contacts and statuses for a
        domain name with this command. To create a new hostname (which could be
        used as a Name Server), please use the EPPhostcreate command. To create
        new contact, please use the EPPcontactcreate command. Note Duplicate status
        id or name server cannot be added/removed.
                                     SgR2R.EPP API User Guide   Page 12 of 23


           Hold Type Description     Code
           Hold Registrar Request    1
           Hold Court Order          2
           Hold Registrant Request   3
           Hold Breach of Contract   4




(%ref) = EPPdomainupdate(\%domadd, \%domrem, \%domchg)


   %domadd/    %domrem/      Description
   %domchg parameters
   NAME                      Domain Name
   OWNERID                   Registrant ID
   ADMINID                   Admin Contact
   TECHID                    Technical Contact
   BILLID                    Billing Contact
   AUTHINFO                  Authorization Information
   NS1, NS2,… NS13           Name Server
   UPD                       Client Update Prohibited
   TRF                       Client Transfer Prohibited
   RNW                       Client Renew Prohibited
   DEL                       Client Delete Prohibited
   HOLD                      Client Hold
   HOLDTYPE                  Hold Type

       $ref -> {RCODE} = 1000 ; command completed successfully
              {RCODE} = 2001 ; command syntax error
              {RCODE} = 2003 ; required parameter missing
              {RCODE} = 2004 ; parameter value range error
              {RCODE} = 2005 ; parameter value syntax error
              {RCODE} = 2102 ; unimplemented option
              {RCODE} = 2201 ; authorization error
              {RCODE} = 2300 ; object pending transfer
              {RCODE} = 2303 ; object does not exists
              {RCODE} = 2304 ; object status prohibits operation
              {RCODE} = 2306 ; parameter value policy error
              {RCODE} = 2400 ; command failed
      $ref - > {MSG} ; return messages
                                                 SgR2R.EPP API User Guide       Page 13 of 23


4.2.8   EPPdomaindelete
        The Delete Domain function is used to delete a registered domain name. Upon
        successful processing of the command, the domain will be placed under the
        Delete status code listed below and will be purged from the registry database
        directly or dropped into deletion escrow period. For further details, please refer to
        domain deletion policy.

                     Deletion Type Description        Code
                     Delete Registrar Request         1
                     Delete Court Order               2
                     Delete Registrant Request        3
                     Delete Breach of Contract        4
                     Delete Lame Domain               5




        (%ref) = EPPdomaindelete(\%info)


           %info parameters              Description
           NAME                          Domain Name
           DELTYPE                       Delete Type

               $ref -> {RCODE} = 1000 ; command completed successfully
                      {RCODE} = 2001 ; command syntax error
                      {RCODE} = 2003 ; required parameter missing
                      {RCODE} = 2201 ; authorization error
                      {RCODE} = 2300 ; object pending transfer
                      {RCODE} = 2303 ; object does not exists
                      {RCODE} = 2304 ; object status prohibits operation
                      {RCODE} = 2306 ; parameter value policy error
                      {RCODE} = 2400 ; command failed
               $ref -> {MSG} ; return messages


4.2.9   EPPdomaintransferrequest
        Deprecated



4.2.10 EPPdomaintransferoperation
        Deprecated
                                                 SgR2R.EPP API User Guide   Page 14 of 23


4.2.11 EPPdomaintransfer
      The Domain transfer request function is used to request transfer of a registered
      domain to the registrar issuing the command. The authinfo field is the
      authorization information required to authenticate request for registrar transfer.
      System allow multi years transfer with term 0,1,2.

      Action: approve, reject, cancel, request

      (%ref) = EPPdomaintransfer(\%dom, $action)


         %dom parameters               Description
         NAME                          Domain Name
         TERM                          Term (No of yrs)
         AUTHINFO                      Authorization Information

             $ref -> {RCODE} = 1000 ; command completed successfully
                    {RCODE} = 2001 ; command syntax error
                    {RCODE} = 2003 ; required parameter missing
                    {RCODE} = 2004 ; parameter value range error
                    {RCODE} = 2005 ; parameter value syntax error
                    {RCODE} = 2102 ; unimplemented option
                    {RCODE} = 2104 ; billing failure
                    {RCODE} = 2106 ; object is not eligible for transfer
                    {RCODE} = 2201 ; authorization error
                    {RCODE} = 2202 ; invalid authorization information
                    {RCODE} = 2300 ; object pending transfer
                    {RCODE} = 2301 ; object not pending transfer
                    {RCODE} = 2303 ; object does not exists
                    {RCODE} = 2304 ; object status prohibits operation
                    {RCODE} = 2306 ; parameter value policy error
                    {RCODE} = 2400 ; command failed
             $ref -> {MSG} ; return messages


4.2.12 EPPdomaintransferstatus
      The Domain transfer status function is used to request the transfer status of a
      registered domain. This command should be used by the winning registrar to
      check if a domain have already been successfully transferred to them or have
      been rejected by the current registrar. If so, they should update their own
      database to reflect the change as well as to inform their customer about the
      event.
                                          SgR2R.EPP API User Guide   Page 15 of 23


      (%ref) = EPPdomaintransferstatus($domainname)
             $ref -> {TRSTATUS} ; transfer status
             $ref -> {REID} ; requesting registrar ID
             $ref -> {REDATE} ; transfer request date
             $ref -> {ACID} ; ID of registrar to accept request
             $ref -> {ACDATE} ; deadline for accepting request
             $ref -> {RCODE} = 1000 ; command completed successfully
                     {RCODE} = 2001 ; command syntax error
                     {RCODE} = 2003 ; required parameter missing
                     {RCODE} = 2005 ; parameter value syntax error
                     {RCODE} = 2201 ; authorization error
                     {RCODE} = 2301 ; object not pending transfer
                     {RCODE} = 2303 ; object does not exists
                     {RCODE} = 2400 ; command failed
             $ref -> {MSG} ; return messages


4.2.13 EPPdomainrenew
     The Domain Renew function is used to extend the terms of a domain. Domain
     periods are specified in number of years. Note Date format DD-MMM-YYYY, e.g.
     24-DEC-2008

     (%ref) = EPPdomainrenew(\%dominfo)


        %dominfo parameters        Description
        NAME                       Domain Name
        TERM                       Term (No of yrs)
        CUREXPIREDATE              Current expiration date

            $ref -> {RCODE} = 1000 ; command completed successfully
                    {RCODE} = 2001 ; command syntax error
                    {RCODE} = 2003 ; required parameter missing
                    {RCODE} = 2004 ; parameter value range error
                    {RCODE} = 2005 ; parameter value syntax error
                    {RCODE} = 2104 ; billing failure
                    {RCODE} = 2201 ; authorization error
                    {RCODE} = 2300 ; object pending transfer
                    {RCODE} = 2303 ; object does not exists
                    {RCODE} = 2304 ; object status prohibits operation
                    {RCODE} = 2306 ; parameter value policy error
                    {RCODE} = 2400 ; command failed
            $ref -> {EXPIREDATE} ; new expiry date for domain
            $ref -> {MSG} ; return messages
                                            SgR2R.EPP API User Guide     Page 16 of 23


4.2.14 EPPdomainupdatewhoisprofile
      Deprecated



4.2.15 EPPdomaininfowhoisprofile
      Deprecated



4.2.16 EPPpollreq
      This command is issued to retrieve transfer queue. Single transfer queue will be
      returned with message queue id, losing registrar, gaining registrar and transfer
      dates.

      (%ref) = EPPpollreq()
             $ref -> {MSGID} ; Message ID
             $ref -> {QDATE} ; Queue Date
             $ref -> {DOMAIN} ; Domain Name
             $ref -> {STATUS} ; Status
             $ref -> {REID} ; Requestor ID
             $ref -> {REDATE} ; Request Date
             $ref -> {ACID} ; Acknowledgement ID
             $ref -> {ACDATE} ; Acknowledgement Date
             $ref -> {EXDATE} ; Queue Expiration Date
             $ref -> {RCODE} = 1300 ; command completed successfully
                     {RCODE} = 1301 ; command completed successfully; ack to
                     dequeue
                     {RCODE} = 2001 ; command syntax error
                     {RCODE} = 2400 ; command failed
             $ref -> {MSG} ; return messages


4.2.17 EPPpollack
      Once a transfer queue is polled, this command must be sent to clear current
      active queue. Once ACK command is sent, the request command above will be
      able to retrieve the next record in the queue.

      (%ref) = EPPpollack($msgid)
             $ref ->{RCODE} = 1000 ; command completed successfully
                    {RCODE} = 1300      ; command completed successfully; no
                    messages
                    {RCODE} = 1301 ; command completed successfully; ack to
                    dequeue
                                                      SgR2R.EPP API User Guide    Page 17 of 23


                             {RCODE} = 2001 ; command syntax error
                             {RCODE} = 2003 ; required parameter missing
                             {RCODE} = 2303 ; object does not exists
                             {RCODE} = 2308 ; data management policy violation
                             {RCODE} = 2400 ; command failed
                      $ref -> {MSG} ; return messages


4.3    Contact Operations
The Contact Operations commands allow you to create, modify and update contacts. Both
organizational contacts as well as personal contacts could be created using the same set of
commands.

       4.3.1   EPPcontactcreate
               The Create Contact function is used to create new contacts. The server will
               return a new contact ID in the response. For a company or individual, input the
               ORGNAME field, firstname and lastname fields. If you wish to create a parent
               organization for an individual, you must create a contact ID for each entity and
               then specify the relationship using the domain operation commands.

               Contact type Company O, Personal I
               Country code Use ISO3166 two character code

               (%ref) = EPPcontactcreate(\%contact)


                  %contact parameters         Description
                  ORGNAME                     Organization Name
                  FIRSTNAME                   First Name
                  LASTNAME                    Last Name
                  *TYPE                       Contact Type
                  *ID                         RCB/Personal ID
                  *AUTHINFO                   Authorization Information
                  *STREET1A                   Street Address 1a
                  STREET1B                    Street Address 1b
                  STREET1C                    Street Address 1c
                  *COUNTRY1                   Country
                  *POSTALCODE1                Postal code
                  STATE                       state
                  *PHONE1                     Telephone
                  PHONE2                      Fax Number
                  *EMAIL                      Email
                                              SgR2R.EPP API User Guide    Page 18 of 23


        * indicates mandatory fields

        For Company Contact Type, ORGNAME is mandatory.
        For Personal Contact Type, FIRSTNAME and LASTNAME are mandatory.

                $ref ->{RCODE} = 1000 ; Command completed successfully
                       {RCODE} = 2003 ; Required parameter missing
                       {RCODE} = 2004 ; Parameter value range error
                       {RCODE} = 2005 ; Parameter value syntax error
                       {RCODE} = 2305 ; Object association prohibits operation
                       {RCODE} = 2400 ; Command failed
               $ref -> {MSG} ; return messages
               $ref -> {CONTACTID} ; ID of the new contact


4.3.2   EPPcontactinfo
        The Obtain Contact Information function retrieves the contact information based
        on a particular Contact ID.

        (%ref) = EPPcontactinfo($contactid)
               $ref -> {FIRSTNAME} ; first name
               $ref -> {LASTNAME} ; last name
               $ref -> {ORGNAME} ; organization name
               $ref -> {TYPE} ; type
               $ref -> {ID} ; RCB Number/ Personal ID
               $ref -> {AUTHINFO} ; Authorization Information
               $ref -> {STREET1A} ; Street address a
               $ref -> {STREET1B} ; Street address b
               $ref -> {STREET1C} ; Street address c
               $ref -> {COUNTRY1} ; Country
               $ref -> {POSTALCODE1} ; Postal Code
               $ref -> {STATE} ; State
               $ref -> {PHONE1} ; Phone number
               $ref -> {PHONE2} ; Fax number
               $ref -> {EMAIL} ; Email
               $ref ->{RCODE} = 1000 ; Command completed successfully
                       {RCODE} = 2003 ; Required parameter missing
                       {RCODE} = 2303 ; Object does not exists
                       {RCODE} = 2201 ; Authorization error
                       {RCODE} = 2400 ; Command failed
               $ref -> {MSG} ; return messages
                                                SgR2R.EPP API User Guide       Page 19 of 23


4.3.3   EPPcontactupdatechange
        The Update Contact Change function is used to update contacts information.

        (%ref) = EPPcontactupdatechange(\%contact)

           %contact parameters           Description
           *CONTACTID                    Contact ID
           ORGNAME                       Organization Name
           FIRSTNAME                     First Name
           LASTNAME                      Last Name
           *ID                           RCB/Personal ID
           *AUTHINFO                     Authorization Information
           *STREET1A                     Street Address 1a
           STREET1B                      Street Address 1b
           STREET1C                      Street Address 1c
           *COUNTRY1                     Country
           *POSTALCODE1                  Postal code
           STATE                         state
           *PHONE1                       Telephone
           PHONE2                        Fax Number
           *EMAIL                        Email

               * indicates mandatory fields

        For Company Contact Type, ORGNAME is mandatory.
        For Personal Contact Type, FIRSTNAME and LASTNAME are mandatory.

               $ref -> {RCODE} = 1000 ; Command completed successfully
                       {RCODE} = 2003 ; Required parameter missing
                       {RCODE} = 2004 ; Parameter value range error
                       {RCODE} = 2005 ; Parameter value syntax error
                       {RCODE} = 2303 ; Object does not exists
                       {RCODE} = 2305 ; Object association prohibits operation
                       {RCODE} = 2201 ; Authorization error
                       {RCODE} = 2400 ; Command failed
               $ref -> {MSG} ; return messages


4.3.4   EPPcontactdelete
        The Delete Contact function is used to delete a contact. This operation will fail if
        a contact still has outstanding domains assigned to it.

        (%ref) = EPPcontactdelete($contactid)
               $ref ->{RCODE} = 1000 ; Command completed successfully
                                                      SgR2R.EPP API User Guide     Page 20 of 23


                             {RCODE} = 2003 ; Required parameter missing
                             {RCODE} = 2303 ; Object does not exists
                             {RCODE} = 2305 ; Object association prohibits operation
                             {RCODE} = 2201 ; Authorization error
                             {RCODE} = 2308 ; Data management policy violation
                             {RCODE} = 2400 ; Command failed
                      $ref -> {MSG} ; return messages


4.4 Host Operations
Host Operations are concerned with creating hostnames under a particular domain name. The
Host Operations allow the creation, modification and deletion of hostnames. If you wish to set a
hostname as a name server for a domain name, you should use the EPPdomainupdate
commands.

       4.4.1   EPPhostcreate
               The Create host function is used to create new hostnames (name servers to be
               used for domain names). Note that a .SG host name can only be created if the
               corresponding .SG domain has been created, and that authenticity that the
               domain is currently sponsored by the requesting registrar is established. Out of
               zone and in zone host must be created using this command before issuing
               domain creation command.

               IPType v4, v6

               (%ref) = EPPhostcreate(\%host)


                  %host parameters             Description
                  NAME                         Host Name
                  IP1, IP2… IP13               IP Address
                  IPTYPE1,IPTYPE2…             IP Type
                  IPTYPE13

                      $ref ->{RCODE} = 1000 ; Command completed successfully
                             {RCODE} = 2003 ; Required parameter missing
                             {RCODE} = 2005 ; Parameter value syntax error
                             {RCODE} = 2201 ; Authorization error
                             {RCODE} = 2302 ; Object exists
                             {RCODE} = 2303 ; Object does not exists
                             {RCODE} = 2305 ; Object association prohibits operation
                             {RCODE} = 2306 ; Parameter value policy error
                             {RCODE} = 2400 ; Command failed
                      $ref -> {MSG} ; error message
                                                SgR2R.EPP API User Guide       Page 21 of 23


4.4.2   EPPhostinfo
        The host info function is used to retrieve information about a host.

        (%ref) = EPPhostinfo($hostname)
               $ref -> {NAME}       ; host name
               $ref -> {IP1}        ; IP Address 1
               $ref -> {IP2}        ; IP Address 2
               $ref -> {IP3}        ; IP Address 3
                                    ; Up to 13 IPs
               $ref -> {IPTYPE1}    ; IP Address 1
               $ref -> {IPTYPE2}    ; IP Address 2
               $ref -> {IPTYPE3}    ; IP Address 3
                                    ; Up to 13 IPTypes
               $ref ->{RCODE} = 1000 ; Command completed successfully
                       {RCODE} = 2005 ; Parameter value syntax error
                       {RCODE} = 2303 ; Object does not exists
                       {RCODE} = 2400 ; Command failed

               $ref -> {MSG} ; return messages


4.4.3   EPPhostupdate
        The host update function is used to add or remove IP addresses to a host. (a
        maximum of 13 IP addresses may be included for each host)

        (%ref) = EPPhostupdate(\%host, \%remhost)


           %host/           %remhost Description
           parameters
           NAME                          Host Name
           NEWNAME                       New Host Name (only required if change of
                                         host name)
           IP1, IP2… IP13                IP Address
           IPTYPE1,IPTYPE2…              IP Type
           IPTYPE13

               $ref ->{RCODE}     = 1000 ; Command completed successfully
                      {RCODE}     = 2003 ; Required parameter missing
                      {RCODE}     = 2005 ; Parameter value syntax error
                      {RCODE}     = 2201 ; Authorization error
                      {RCODE}     = 2302 ; Object exists
                      {RCODE}     = 2303 ; Object does not exists
                      {RCODE}     = 2305 ; Object association prohibits operation
                                                SgR2R.EPP API User Guide   Page 22 of 23


                       {RCODE} = 2306 ; Parameter value policy error
                       {RCODE} = 2400 ; Command failed

               $ref -> {MSG} ; error message


4.4.4   EPPhostupdateadd
        Deprecated


4.4.5   EPPhostupdateremove
        Deprecated


4.4.6   EPPhostdelete
        The host delete function is used to delete a host.

        (%ref) = EPPhostdelete($hostname)
               $ref ->{RCODE} = 1000 ; Command completed successfully
                      {RCODE} = 2003 ; Required parameter missing
                      {RCODE} = 2303 ; Object does not exists
                      {RCODE} = 2305 ; Object association prohibits operation
                      {RCODE} = 2308 ; Data management policy violation
                      {RCODE} = 2400 ; Command failed
               $ref -> {MSG} ; error message
                                     SgR2R.EPP API User Guide   Page 23 of 23


Appendix A Glossary of SgR2R.EPP Commands

Session Management

4.1.1 EPPlogin
4.1.2 EPPgreeting
4.1.3 EPPlogout
4.1.4 EPPhello

Domain Operations

 4.2.1 EPPdomaincheck
4.2.2 EPPdomaincreate
4.2.3 EPPdomaininfo
4.2.4 EPPdomainupdateadd
4.2.5 EPPdomainupdateremove
4.2.6 EPPdomainupdatechange
4.2.7 EPPdomainupdate
4.2.8 EPPdomaindelete
4.2.9 EPPdomaintransferrequest
4.2.10 EPPdomaintransferoperation
4.2.11 EPPdomaintransfer
4.2.12 EPPdomaintransferstatus
4.2.13 EPPdomainrenew
4.2.14 EPPdomainupdatewhoisprofile
4.2.15 EPPdomaininfowhoisprofile
4.2.16 EPPpollreq
4.2.17 EPPpollack

Contact Operations

4.3.1 EPPcontactcreate
4.3.2 EPPcontactinfo
4.3.3 EPPcontactupdatechange
4.3.4 EPPcontactdelete

Host Operations

4.4.1 EPPhostcreate
4.4.2 EPPhostinfo
4.4.3 EPPhostupdate
4.4.4 EPPhostupdateadd
4.4.5 EPPhostupdateremove
4.4.6 EPPhostdelete

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:49
posted:6/4/2011
language:English
pages:23