[wp-hackers] Creating new categories via the XMLRPC API

John Keegan john at rackshare.com
Thu Feb 15 19:55:51 GMT 2007


OK, I'll decloak. ;-)

>> Make sure there is a WordPress API entry in the RSD for the site
>> before using the new API.
>
>I'm an idiot though.  What's the RSD?

RSD stands for "Really Simple Discovery" and is a method for blogging
clients to discover additional information about the API method to use
to interact with a given blog... This is how you are able to tell a
blogging tool just 3 items: a blog URL, a username, and a password, and
it can determine which API to use (MT, Metaweblog, Blogger, WordPress,
etc.) to communicate with your blog.

It works like this:

First, The blogging client parses the HTML HEAD area of a blog looking
for the RSD link, it might look like this:

<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://
photomatt.net/blog/xmlrpc.php?rsd" />

Next, the tool goes and fetches that URL, and would see something like this:

<?xml version="1.0" encoding="utf-8"?><rsd version="1.0" xmlns="http://
archipelago.phrasewise.com/rsd">
  <service>
    <engineName>WordPress</engineName>
    <engineLink>http://wordpress.org/</engineLink>
    <homePageLink>http://photomatt.net</homePageLink>
    <apis>
      <api name="WordPress" blogID="1" preferred="false" apiLink="http://
photomatt.net/xmlrpc.php" />
      <api name="Movable Type" blogID="1" preferred="true"
apiLink="http://photomatt.net/xmlrpc.php" />

      <api name="MetaWeblog" blogID="1" preferred="false"
apiLink="http://photomatt.net/xmlrpc.php" />
      <api name="Blogger" blogID="1" preferred="false" apiLink="http://
photomatt.net/xmlrpc.php" />
    </apis>
  </service>
</rsd>

This bit of HTML tells the client that it can speak 4 APIs, but prefers
the Movable Type API and tells the tool where the XML-RPC URL is and
what the Blog ID number of this blog is (required to interact with the
blog via the API).

The whole process saves end users considerable setup time, they don't
need to know their API endpoint or their Blog ID or even what kind of
API their blog uses.

So to get back to the "Make sure there is a WordPress API entry in the
RSD for the site" statement, if there is no entry in the RSD file, then
blogging clients and tools would assume that your blog does not support
the use of the WordPress API. Clients would not be able to "discover"
that the Wordpress API was supported on your blog.

-- 
John Keegan
john at RackShare.com
http://RackShare.com







More information about the wp-hackers mailing list