TransIP API PHP client examples file. This file contains some code snippets. An example of all functions is included. You can copy this code to your own scripts. Copyright (c) 2005 Transip BV /* Always start your script by including the config file * and the library: */ include("transip_config.php"); include("transip_api.php"); /* To enable test mode, use this function before doing your * TransIP request */ transip_set_test_mode(); /* Check if a domain exists */ $domain = "example.com"; $check = transip_check($domain); // $check is array $available = $check[$domain]; // get result from array if ($available) echo "Domain is available!\n"; else echo "Domain is unavailable!\n"; /* Check multiple domains in one run */ $domains = array("example.com", "example123123.com"); $available = transip_check($domains); foreach ($available as $domain=>$value) { echo "$domain is available? "; echo $value ? "yes!\n" : "no!\n"; } /* Request WHOIS information on a domain */ echo transip_whois("transip.nl") . "\n"; /* Register a domain */ $nameservers["ns1"] = "ns0.transip.nl"; $nameservers["ns2"] = "ns1.transip.nl"; $nameservers["ns3"] = "ns2.transip.nl"; $nameservers["transipAutoIP"] = "80.69.67.22"; $whois["ownerFirstDomain"] = "transip.nl"; $whois["ownerName"] = "Transip BV"; $whois["ownerAddress"] = "Tielweg 3"; $whois["ownerPostcode"] = "2803 PK"; $whois["ownerPlace"] = "Gouda"; $whois["ownerCountry"] = "nl"; $whois["adminName"] = "Transip BV"; $whois["adminContactName"] = "Hop"; $whois["adminContactInitials"] = "WW"; $whois["adminContactGender"] = "M"; $whois["adminAddress"] = "Tielweg 3"; $whois["adminPostcode"] = "2803 PK"; $whois["adminPlace"] = "Gouda"; $whois["adminCountry"] = "nl"; $whois["adminPhone"] = "+31182504424"; $whois["adminEmail"] = "support@transip.nl"; $whois["techName"] = "Transip BV"; $whois["techContactName"] = "Niknam"; $whois["techContactInitials"] = "A"; $whois["techContactGender"] = "M"; $whois["techAddress"] = "Tielweg 3"; $whois["techPostcode"] = "2803 PK"; $whois["techPlace"] = "Gouda"; $whois["techCountry"] = "nl"; $whois["techPhone"] = "+31182504424"; $whois["techEmail"] = "support@transip.nl"; echo "Registering domain: "; echo transip_register("an.example.domain", $nameservers, $whois, $userref = ""); /* Modify a domain */ $nameservers["ns1"] = "ns0.transip.net"; $nameservers["ns2"] = "ns1.transip.net"; $nameservers["ns3"] = "ns2.transip.net"; $nameservers["transipAutoIP"] = "80.69.67.22"; echo transip_modify("example.net", $nameservers); /* Change WHOIS on a domain */ $whois["ownerFirstDomain"] = "transip.nl"; $whois["ownerName"] = "Transip BV"; $whois["ownerAddress"] = "Tielweg 3"; $whois["ownerPostcode"] = "2803 PK"; $whois["ownerPlace"] = "Gouda"; $whois["ownerCountry"] = "nl"; $whois["adminName"] = "Transip BV"; $whois["adminContactName"] = "Hop"; $whois["adminContactInitials"] = "WW"; $whois["adminContactGender"] = "M"; $whois["adminAddress"] = "Tielweg 3"; $whois["adminPostcode"] = "2803 PK"; $whois["adminPlace"] = "Gouda"; $whois["adminCountry"] = "nl"; $whois["adminPhone"] = "+31182504424"; $whois["adminEmail"] = "support@transip.nl"; $whois["techName"] = "Transip BV"; $whois["techContactName"] = "Niknam"; $whois["techContactInitials"] = "A"; $whois["techContactGender"] = "M"; $whois["techAddress"] = "Tielweg 3"; $whois["techPostcode"] = "2803 PK"; $whois["techPlace"] = "Gouda"; $whois["techCountry"] = "nl"; $whois["techPhone"] = "+31182504424"; $whois["techEmail"] = "support@transip.nl"; $organization_change = true; // If true change (company) name; paid for .nl domains // If false only change address/admin/tech details echo transip_chown("example.net", $whois, $organization_change) . "\n"; /* Lock and unlock a domain */ echo transip_lock("example.net", true)."\n"; echo transip_lock("example.net", false)."\n"; /* List of domains */ var_dump(transip_list()); var_dump(transip_list(2,10)); // show 2 domains at position 10 (0-based) /* Show domain details */ $show = transip_show("example.nl"); var_dump($show);