.AL Domain Registration API Example

<?php


/* 

   -----------------
   Registrant Status
   ----------------- 
   
   can have these values:
   
   "Person Natyror" 		-> In case the Registrant is an Individual ( Albanian or Foreign )
   "Person Juridik Privat" 	-> In case the Registrant is a Company ( Albanian or Foreign )
   "Person Fizik Tregtar"	-> In case the Registrant is a Small Business ( Albanian Only ) 
   "Institucione Te Tjera"	-> Association / Other ( Albanian or Foreign )
   "Person Juridik Publik"	-> Government Institution  ( Albanian Only )
   
   -----------------
   Identity Form
   ----------------- 
   
   can have these values:
   
   "Identity Card" 			-> Registrant Identity Card Number  ( Albanian or Foreign )
   "Passport" 				-> Registrant Passport Number  ( Albanian or Foreign )
   "Organisation ID"		-> Registrant Organisation Number  ( Albanian or Foreign )
   
   -----------------
   Identity Number
   ----------------- 
   The Selected Document Number
   
   -----------------
   Vat Number
   ----------------- 
   Optional if  Registrant Status is "Person Natyror"  but required for any other Registrant Statuses.
   The Company NIPT/NUIS can be Albanian NUIS or EU VAT Number for Example: EE102143182 or International Company Registration Number

*/




$domainAL_ExtraFields = 

array(
   "Registrant Status"             => "Person Natyror",
   "Identity Form"                 => "Identity Card",
   "Identity Number"               => "I999999S",
   "Registrant Address"            => "Example Street 99",
   "Vat Number"  => "J999999D",
);



$data = array(
    "action"		=> "RegisterDomain",
    "token"             => "AaLc8eNZWsZtWlT9LtT7NUha",
    "authemail"         => "test@exampledomain.com",
    "sld"		=> "domainexample",
    "tld"		=> "al",
    "regperiod"		=> 1,
    "nameserver1"       => "ns1.domainexample.com",
    "nameserver2"       => "ns2.domainexample.com",
    "nameserver3"       => "ns3.domainexample.com",
    "nameserver4"       => "ns4.domainexample.com",
    "nameserver5"       => "ns5.domainexample.com",
    "dnsmanagement"	=> 1,
    "emailforwarding"	=> 1,
    "idprotection"	=> 1,
    "firstname"         => "John",
    "lastname"          => "Doe",
    "companyname"	=> "Company Name",
    "address1"          => "Address 1",
    "address2"          => "Address 2",
    "city"		=> "City",
    "state"             => "ST",
    "country"           => "IT",
    "postcode"          => "12345",
    "phonenumber"	=> "4455677888990",
    "email"             => "user@domainexample.com",
    "adminfirstname"	=> "John",
    "adminlastname"	=> "Doe",
    "admincompanyname"	=> "Company Name",
    "adminaddress1"	=> "Address 1",
    "adminaddress2"	=> "Address 2",
    "admincity"		=> "City",
    "adminstate"	=> "ST",
    "admincountry"	=> "IT",
    "adminpostcode"	=> "12345",
    "adminphonenumber"	=> "4455677888990",
    "adminemail"	=> "admin@domainexample.com",
    "domainfields"      => base64_encode(serialize($domainAL_ExtraFields))
);


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://namebrave.com/domainsResellerAPI/api.php");
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'SSLv3');
$result = curl_exec($ch);
$res    = json_decode($result, true);
print_r($res);
curl_close($ch);
?>
Was this answer helpful? 0 Users Found This Useful (0 Votes)