2010-11-15 24 views
0

Comment puis-je effectuer les opérations suivantes avec cette API?Domain API Loop

formulaire est configuré en PHP pour les utilisateurs enregistrés pour saisir le nom de domaine Sur soumettre ..

Vérifiez si le domaine est disponible>

  • Si NO> sortie XML> exécuter à nouveau la boucle en 5 minutes
  • Si OUI> sortie XML> aller de l'avant et achat (registre) le domaine> boucle d'extrémité

Merci beaucoup!

code API Exemple

<?php /** * Set the API URL */ $sApiUrl = "https://www.apiurl.com/"; 


/** * Set POST Parameters */ $aParams = Array(
      'uid'  => "--USERNAME--", // Username 
      'pw'  => "--APIKEY--",  // API Key 
      'command' => "querydomain",  // Command to Rum 
      'sld'  => "sampledomain", // Main part of the Domain 
      'tld'  => "com");   // Domain Extension 


/** * Run the cURL command */ 
$oCurl = curl_init(); curl_setopt($oCurl, CURLOPT_URL, $sApiUrl); 
curl_setopt($oCurl, CURLOPT_POST, 1); 
curl_setopt($oCurl, CURLOPT_POSTFIELDS, $aParams); 
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, false); 
$sResponse = curl_exec($oCurl); curl_close($oCurl); 


/** * Turn results into Simple XML Object */ 
$oOutput = new SimpleXmlElement($sResponse); 


/** * Debugging output, so we can see what we just got */ 
print_r($oOutput); 

?> 

API Commandes

check Checks whether a domain name is available for registration. 
purchase Registers a new domain name. 
transfer Requests a domain transfer to registrar. 
extend Extends (renews) domain registration. 
changepassword Changes the domain password. 
sendpassword Send domain password to domain owner. 
contacts Changes domains contacts. 
querydomain Returns detailed information about the domain. 
sendepp Sends gTLD epp key to domain owner. 
refillaccount Refills your reseller account with funds. 
changedomainns Changes domains name servers. 
sendtransferemail Sends transfer authorisation request to domain owner. 
addchildns Add child name server to domain. 
updatechildns Update details for child name server. 
removechildns Remove child name server from domain. 
pushdomain Push domain to another registrar reseller. 
getdnsrecords Get domain name server records for a domain. 
enablednsdomain Create DNS domain service for domain. 
adddnsrecord Add new DNS record to domain. 
updatednsrecord Update DNS record for a domain. 
removednsrecord Remove DNS record from a domain. 
updatednssoa Update DNS SOA record for a domain. 
disablednsdomain Destroy DNS domain service for a domain. 
getmailrecords Get mail forwarding records for a domain. 
addmailforwarder Add a mail forwarder to a domain. 
removemailforwarder Remove a mail forwarder from a domain. 
updatemailforwarder Update the details of a Mail Forwarder for a domain. 
geturlrecords Get URL Forwarding records for a domain. 
addurlforwarder Add a URL Forwarding record to a domain. 
updateurlforwarder Update a URL Forwarding record for a domain. 
removeurlforwarder Remove a URL Forwarding record for a domain. 
getreglock Get registry lock details for a domain. 
setreglock Set a registry lock for a domain. 
updatecontact Update an address book entry. 
getapiinfo Get information about the Domain System API. 
transferout Push a domain name to another registrar, given their tag. 

XML exemple ci-dessus émis par

SimpleXMLElement Object 

( [résultats] => SimpleXMLElement Object ( )

[errors] => SimpleXMLElement Object 
    (
     [error] => SimpleXMLElement Object 
      (
       [domain] => SimpleXMLElement Object 
        (
         [name] => google.com 
         [status] => SimpleXMLElement Object 
          (
           [code] => 211 
           [text] => Unavailable 
           [description] => The domain name you queried has been registered through another registrar. 
          ) 

        ) 

      ) 

    ) 

[errorcount] => 1 
[exectime] => 0.399 second(s) 
[enviroment] => live 
[version] => 2.3.9 beta 

)

+0

Les preneurs sur une réponse? :) – iCeR

Répondre

0

je peux voir ce que vous essayez de faire. Cependant, quelle partie en particulier avez-vous des problèmes? Il semble que vous ayez déjà l'API. Est-ce que ça ne fonctionne pas correctement?

Avez-vous besoin d'aide pour écrire le PHP pour faire votre 'Oui'/'Non' ci-dessus?

Et pourquoi "vérifiez-vous à nouveau dans 5 minutes"?

+0

Je n'ai aucune idée de comment réaliser la boucle en utilisant l'API et PHP. Je mettrai à jour l'OP avec le XML sorti de l'exemple ci-dessus. J'ai juste besoin d'aide pour coder le script php pour faire la vérification, en utilisant la sortie api et xml. Possible même de courir la boucle après un sommeil de 30 secondes? Merci beaucoup! – iCeR

+0

Oublié de répondre à votre question .. La raison de la vérification est de vérifier si disponible (il est sur le point d'être purgé du registre), enregistrer, si indisponible (pas encore purgé), essayez encore et encore jusqu'à ce qu'il soit disponible. – iCeR