Hello, I am looking to create a bot that registers domains, but having some issues making the api calls.Documentation is here - www.freenom.com/en/freenom-api.html. What I am looking specifically to do is -
Register a domain
Method: POST
Parameter | Description | Required | Multiple |
domainname | The name of the domain | Yes | No |
period | The period of registration. If not given it will default to 1Y for paid domains and will default to 3M for free domains | No | No |
forward_url | The URL the domain name should forward to | No* | No |
forward_mode | The type of forward. Can be cloak or 301_redirect. cloak is default. | No | No |
nameserver | Nameserver to use. A minimum of 2 nameservers is required | No* | Yes |
owner_id | Contact ID of domain owner | Yes** | No |
billing_id | Contact ID of billing contact | No | No |
tech_id | Contact ID of technical contact | No | No |
admin_id | Contact ID of admin contact | No | No |
E-mail address used for authentication | Yes | No | |
password | Password used for authentication | Yes | No |
domaintype | The type of the domain: PAID or FREE | Yes | No |
idshield | Identity protection parameter, possible values : enabled or disabled | No** | No |
autorenew | Autorenewal setting for this domain. Possible values: enabled or disabled. | No | No |
Notes: * forward_url and nameservers are mutual exclusive. Either the forward_url OR nameservers need to be specified. It is not possible to specify both. In case the nameserver is under the same domain, a glue record must be created for this domain. This can be done by registering Nameserver records.
** In case idshield is enabled owner_id doesn't need to be specified.
Returned propertiesProperty | Description | Type |
result | DOMAIN REGISTERED or NOT AVAILABLE | Both |
domain | One or multiple hashes with result of domain name registration | Both |
?currency | The currency for given prices | Paid |
?domainname | The domain name as requested | Both |
?domaintype | The domaintype of the checked domainname | Both |
?expirationdate | The date the domain will expire in YYYYMMDD | Both |
?period | The registration period of the registered domainname | Both |
?partnerprice | The amount to be paid by the reseller | Paid |
?retailprice | The amount to be paid by the enduser. (public price) | Paid |
?owner_id | Contact ID of domain owner | Paid |
?tech_id | Contact ID of technical contact | Paid |
?billing_id | Contact ID of billing contact | Paid |
?admin_id | Contact ID of administrative contact | Paid |
?status | REGISTERED or NOT AVAILABLE | Both |
?authcode | Generated authorization code | Paid |
?autorenew | Autorenewal flag. Either enabled or disabled. | Paid |
status | OK | Both |
Example: Registering a domain for 2 years with nameservers under the domain.
Request
curl -X POST https://api.freenom.com/v2/domain/register.xml\
-d "domainname=test001.tk\
&period=2Y\
&nameserver=ns1.test001.tk\
&nameserver=ns2.test001.tk\
&owner_id=JSMTH01\
&[email protected]\
&password=68bb651cb1\
&domaintype=PAID
"
<freenom>
<domain>
<domainname>TEST001.TK</domainname>
<domaintype>PAID</domaintype>
<period>2Y</period>
<currency>EUR</currency>
<retailprice>32.50</retailprice>
<partnerprice>15.60</partnerprice>
<expirationdate>20100711</expirationdate>
<owner_id>JSMTH01</owner_id>
<billing_id>JSMTH01</billing_id>
<admin_id>JSMTH01</admin_id>
<tech_id>JSMTH01</tech_id>
<authcode>88398480402849880</authcode>
<autorenew>enabled</autorenew>
<status>REGISTERED</status>
</domain>
<result>DOMAIN REGISTERED</result>
<status>OK</status>
</freenom>