Ihr Browser lässt keine Web-Fonts zu. Unsere Webseiten nutzen Web-Fonts basierte Icons. Um unseren Service zu verbessern, erlauben Sie bitte Ihrem Browser Web-Fonts zu benutzen.
Wir stellen ein!
Deutsch | English | Español

1.5. Client implementation

1.5.1. Implementation in PHP

The implementation in PHP requires the xml-rpc library and the attached domrobot class in file domrobot.class.php.

<?php
  header('Content-type: text/plain; charset=utf-8');
  require "domrobot.class.php";

  $addr = "https://api.domrobot.com/xmlrpc/";
  $usr = "your_username";
  $pwd = "your_password";
  
  $domrobot = new domrobot($addr);
  $domrobot->setDebug(false);
  $domrobot->setLanguage('en');

  $res = $domrobot->login($usr,$pwd);
  if ($res['code']==1000) {
    $obj = "domain";
    $meth = "check";
    $params = array();
    $params['domain'] = "mydomain.com";
    $res = $domrobot->call($obj,$meth,$params);
    print_r($res);
  } else {
    print_r($res);
  } 

1.5.2. Implementation in Java

The implementation in Java requires the included .JAR files.

import model.ArrayElement;
import model.Element;
import model.MapElement;
import org.apache.xmlrpc.XmlRpcException;
import java.net.MalformedURLException;

public class InwxJavaExample {
  public static void main(String args[]) throws MalformedURLException, XmlRpcException {
    System.out.println("Starting inwx Java example ...");
    String username = "your username";
    String password = "your password";

    Connector connector = new Connector();
    if (connector.login(username,password)) {
      ArrayElement myDomains = connector.checkDomain("inwx23 werew4rewr.de");
      for ( Element item : (Element[]) myDomains.getArray(  ) ) {
        MapElement _item = (MapElement) item;
        System.out.println("tld: " + _item.get("tld").toString());
        System.out.println("name: " + _item.get("name").toString());
        System.out.println("domain: " + _item.get("domain").toString());
        System.out.println("status: " + _item.get("status").toString());
        System.out.println("price: " + _item.get("price").toString());
      }

      ArrayElement domains = connector.getAllNS();
      for ( Element item : (Element[]) domains.getArray(  ) ) {
        MapElement _item = (MapElement) item;
        System.out.println(_item.get("domain")+":"+_item.get("type"));
      }
      
      connector.logout();
      System.out.println("logout");
    }//if login
  }
}

1.5.3. Implementation in Python

The implementation in Python requires the provided python example files and you need to set up your InterNetworX credentials in the conf.cfg file.

The example is based on the source code of Philipp Klaus (https://github.com/pklaus/python-inwx-xmlrpc).

from inwx import domrobot, prettyprint
from configuration import get_account_data

def main():
    api_url, username, password = get_account_data(True)
    inwx_conn = domrobot(api_url, False)
    loginRet = inwx_conn.account.login({'lang': 'en', 'user': username, 'pass': password});

    domain = "mydomain.com"
    checkRet = inwx_conn.domain.check({'domain': domain})
    print prettyprint.domain_check(checkRet)
    
if __name__ == '__main__':
    main()

1.5.4. Implementation in Perl

The implementation in Perl is based on the XMLRPC::Lite and the HTTP::Cookies modules, available via CPAN.

#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;

use HTTP::Cookies;
use XMLRPC::Lite; # +trace => 'all';

my $addr = "https://api.ote.domrobot.com/xmlrpc/"; # OT&E
#my $addr = "https://api.domrobot.com/xmlrpc/"; # Live

# your credentials here
my $usr = 'your_username';
my $pwd = 'your_password';

my ($proxy,$result);
$proxy = XMLRPC::Lite
      -> proxy($addr, cookie_jar => HTTP::Cookies->new(ignore_discard => 1));

$result = $proxy->call('account.login', { user => $usr, pass => $pwd })->result;
if ( $result->{code} == 1000 ) {  # Command completed successfully

	# domain availability check
	$result = $proxy->call('domain.check', { 
		domain => ['mydomain.com','mydomain2.net']})->result;
	print Dumper($result);
	
} else {
	die Dumper($result); # login failed
}
__END__

1.5.5. Implementation in Ruby

The implementation in Ruby requires the Domrobot.rb class in the folder ruby/inwx.

The example is based on the source code of Fabian Becker (https://github.com/halfdan/ruby-inwx-xmlrpc) and requires Ruby 1.9.x.

require "inwx/Domrobot"
require "yaml"

addr = "api.ote.domrobot.com"
# addr = "api.domrobot.com"
user = "your_username"
pass = "your_password"

domrobot = INWX::Domrobot.new(addr)

result = domrobot.login(user,pass)
puts YAML::dump(result)

object = "domain"
method = "check"

params = { :domain => "mydomain.com" }

result = domrobot.call(object, method, params)

puts YAML::dump(result)

1.5.6. Implementation in Node.js

The implementation and documentation for the Node.js client is provided by Matthias Kadenbach and available on GitHub:

https://github.com/mattes/inwx-nodejs