WhiteHatBox
Share Page
Following(0)
Partner(s)
kabone76

HTTP POST - How to?

ReplyThanks 2017/07/05 14:48:09 0 0

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

Input
URL: https://api.freenom.com/v2/domain/register
Method: POST
Input
Description: Use this function to register a domain.
Parameters
ParameterDescriptionRequiredMultiple
domainnameThe name of the domainYesNo
periodThe period of registration. If not given it will default to 1Y for paid domains and will default to 3M for free domainsNoNo
forward_urlThe URL the domain name should forward toNo*No
forward_modeThe type of forward. Can be cloak or 301_redirect. cloak is default.NoNo
nameserverNameserver to use. A minimum of 2 nameservers is requiredNo*Yes
owner_idContact ID of domain ownerYes**No
billing_idContact ID of billing contactNoNo
tech_idContact ID of technical contactNoNo
admin_idContact ID of admin contactNoNo
emailE-mail address used for authenticationYesNo
passwordPassword used for authenticationYesNo
domaintypeThe type of the domain: PAID or FREEYesNo
idshieldIdentity protection parameter, possible values : enabled or disabledNo**No
autorenewAutorenewal setting for this domain. Possible values: enabled or disabled.NoNo


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 properties
PropertyDescriptionType
resultDOMAIN REGISTERED or NOT AVAILABLEBoth
domainOne or multiple hashes with result of domain name registrationBoth
?currencyThe currency for given pricesPaid
?domainnameThe domain name as requestedBoth
?domaintypeThe domaintype of the checked domainnameBoth
?expirationdateThe date the domain will expire in YYYYMMDDBoth
?periodThe registration period of the registered domainnameBoth
?partnerpriceThe amount to be paid by the resellerPaid
?retailpriceThe amount to be paid by the enduser. (public price)Paid
?owner_idContact ID of domain ownerPaid
?tech_idContact ID of technical contactPaid
?billing_idContact ID of billing contactPaid
?admin_idContact ID of administrative contactPaid
?statusREGISTERED or NOT AVAILABLEBoth
?authcodeGenerated authorization codePaid
?autorenewAutorenewal flag. Either enabled or disabled.Paid
statusOKBoth

Example: Registering a domain for 2 years with nameservers under the domain.

Input

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
"

Output
Response

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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>

Fuck BotChief! WhiteHatBox willl steal from you, disable your keys when they don't get their way
Aprilcaicai
2017/07/05 19:46:29
Please contacted us in Skype, we already known the problem.
kabone76
2017/07/06 00:28:32

Solved it myself turns out the data field needed -


password=passs123&email=hghjhgs810%40gmail.com&domaintype=FREE&period=12M&nameserver=ns1.test001.tk&nameserver=ns2.test001.tk&idshield=enabled&domainname=fdsdfghgfdgh.tk

Fuck BotChief! WhiteHatBox willl steal from you, disable your keys when they don't get their way
Aprilcaicai
2017/07/06 18:14:38

Thanks for your feedback.


So smart you are.

<< < 1> >>
VerifyCode
Advanced Option