|
Sample Domain Names API Flow and some Notes
Buying Process for a single Domain Name
- Checking Domain Availability: First call the
DomOrder.checkAvailabilityMultiple() method to discover if the domain name in question is
available for registration.
- Customer Selection/Addition: If the domain name is available, you will
have to retrieve the Customer Id of the Customer who wishes to buy the it.
If the Customer already exists, you can use Customer.getCustomerId() to
get it or use Customer.signUp() to create a new one. The Customer Id
will be in the return value in both cases.
- Get Registration Info: You'll need the Name Servers and the Contact
Ids to register a domain name at the Registry. Get the list of existing Contacts
using DomContact.listByType().
- Validate the parameters: Now pass all the information required to
DomOrder.validateDomainRegistrationsParams() to validate them and ensure
correctness.
- Register the Domain: Call DomOrder.addWithoutValidation() with
all the parameters you've just validated and you're basically done.
IMPORTANT- Using DomOrder.add(): The use of DomOrder.add() to
register a domain is now deprecated. This method is single-threaded and
inefficient and so is much slower than using steps 4 and 5 in the Buying process
flow. Use the DomOrder.validateDomainRegistrationsParams(),
DomOrder.addWithoutValidation() method pair instead.
- Adding
Contacts for .US and .COOP domains: The Contacts for .US and
.COOP need to have addition information to be correctly added. .US requires a
Nexus Category while .COOP requires 2 Sponsors. When attempting to
register these domains, DomOrder.validateDomainRegistrationsParams() will
return "InsufficientContactDataException in DomValidation while adding order"
in the status has under the error key. When you see this error, you
should use DomContactExt.setContactDetails() to set the relevant
additional information and try again. If you attempt to call
DomOrder.addWithoutValidation() with these incomplete Contacts for .US or
.COOP, you will get "Error during adding Contact" in the status hash under
the error key.
Modifying Domain
Name Details
Click here to know
more about Domain Name Registration &
Management >>
There is no single
DomOrder.mod() method. Rather, you must call the relevant method to modify
the appropriate property of a domain name. For example, to modify the Domain
Secret, call DomOrder.modifyDomainSecret() and so on.
Modifying Domain Contact
Details
Click here to know
how to modify the Whois / Contact
Details of a Domain Name >>
There is a bit of a niggle when
modifying the Contacts to be used by a domain name. One can first get the
Contact Ids for a particular domain name by calling DomOrder.getDetails() with
the orderid and ContactIds in the options Vector. We can then use
DomContact.listNames() to get a list of all Contacts belonging to a
particular Customer and show this in a list on the screen. We can then use
DomOrder.modifyContact() to modify the Contacts being used.
If the Customer chooses to
modify the Registrant Contact, then we should check if it is fit to be used in
such a manner by calling DomContactExt.isValidRegistrantContact(). Some
Registries like .US and .COOP require additional information and this can be
supplied to the Contact with a call to DomContactExt.setContactDetails()
if DomContactExt.isValidRegistrantContact() returns false.
If an attempt is made to use an
incorrect Contact Id (one which would fail the
DomContactExt.isValidRegistrantContact() test), then a
InsufficientContactDataException is thrown. You can catch it and then set
the details using DomContactExt.setContactDetails().
|