IntroductionΒΆ
The WebFaction API is a powerful XML-RPC interface for managing many control panel and account tasks. With the WebFaction API, you can automate application installation, email address configuration, and more.
Like other XML-RPC APIs, the WebFaction API works by sending a short piece of XML over HTTP. Luckily, many languages have XML-RPC libraries to make requests quick and painless.
For example, you can send an XML-RPC request using Python‘s xmlrpclib module:
>>> import xmlrpclib
>>> server = xmlrpclib.ServerProxy('https://api.webfaction.com/')
>>> session_id, account = server.login('widgetsco', 'widgetsrock')
Or with Ruby’s xmlrpc package:
>> require 'xmlrpc/client'
=> true
>> require 'pp'
=> true
>> server = XMLRPC::Client.new2("https://api.webfaction.com/")
#<XMLRPC::Client:0x5b1698 @cookie=nil, @create=nil, @port=443>
>> pp server.call("login", "widgetsco", "widgetsrock")
["ca4c008c24c0de9c9c8",
{"mail_server"=>"Mail5",
"web_server"=>"Web55",
"username"=>"widgetsco",
"id"=>687,
"home"=>"/home"}]
=> nil
To learn more about XML-RPC and find an implementation in your favorite language, please visit XMLRPC.com. .. include:: common.subs
