XML-RPC Interface

# Introduction

Back to the developer docs index

This document contains information on the XML-RPC interface that Nucleus provides, and the error messages it spits out. Please note that the specification of this interface might still undergo changes in the future.

The URL for the Nucleus XML-RPC interface is:
http://www.yourserver.com/yourpath/nucleus/xmlrpc/server.php

# The Blogger API (XML-RPC)

Nucleus implements the Blogger API. This allows for tools and services that can communicate with Blogger, to be able to also communicate with Nucleus. Because the way Nucleus works, some interpretations of parameters are slightly different, see the notes below for more info. The structure of method calls and responses are, of course, exactly the same as the methods at Blogger.

Here's the list of available methods. Click them to get more information (links go to either the Blogger API or the Blogger API Mailinglist).

- blogger.newPost
- blogger.editPost
- blogger.getPost
- blogger.deletePost
- blogger.getUsersBlogs
- blogger.getRecentPosts
- blogger.getUserInfo
- blogger.getTemplate
- blogger.setTemplate

Since Nucleus is structured somewhat differently inside, there are some differences in the way parameters are handled. An overview:

- Appkeys are ignored.
- Next to the body of a post, a Nucleus-item also has a title and a category. Blogger only has the body (known as 'contents'). To be able to use the extra parts, you can use `<title>` and `<category>` in the contents you send to Nucleus. These tags are only added in the getRecentPosts call
- What is known under Blogger as 'templates', is known under Nucleus as 'skins'. There can be more than one skin on the system, and each skin can be used by different blogs. The blogger.setTemplate and blogger.getTemplate methods will affect the default skin for the chosen blog, as selected in the Nucleus blog settings. The 'main' and 'archiveIndex' template types refer to the nucleus skinparts 'index' and 'archivelist'
- The `publish` parameter is used to determine wether a new post is to be added as a draft or not. When using `blogger.editPost`, the `publish` parameter is ignored unless it turns a draft into a published item
- When using the `getUserInfo` call, the 'lastname' in the result will be empty and 'firstname' will contain the full name. This is because Nucleus does not make a difference between first name and last name
- The `getRecentPostst`-method returns `authorName` and `title` as extra parameters. Blogger has been returning these also (although undocumented)

# metaWeblog API

Since v1.1, Nucleus also supports the metaWeblog API, which is an extention to the Blogger API.

In Nucleus v2.5, support was added for the `newMediaObject` and `getRecentPosts` methods as well (they weren't in the original metaWeblog specification)

A list of available methods is listed below (see the specification for more info):

- metaWeblog.newPost
- metaWeblog.editPost
- metaWeblog.getPost
- metaWeblog.getCategories
- metaWeblog.newMediaObject (v2.5)
- metaWeblog.getRecentPosts (v2.5)

As of Nucleus v3.22 we also support the `mt_text_more` and `mt_allow_comments` extensions to the metaWeblog API. This means that if you use an application that also supports these extensions, such as Ecto, you can also edit the extended body and determine whether or not you want to allow comments for an item.

# Movable Type API

Since v2.5, Nucleus supports the methods from the Movable Type API.

The list of available methods is listed below:

- mt.supportedMethods
- mt.supportedTextFilters
- mt.publishPost
- mt.getCategoryList
- mt.getPostCategories
- mt.setPostCategories
- mt.getRecentPostTitles
- mt.getTrackbackPings

Some notes:

- Nucleus only supports one category for each item. This means that all categories except the 'primary' category for an item will be ignored.
- Trackback is not implemented in the Nucleus core (it's avalailable as a plugin instead). Because of this, `mt.getTrackbackPings` will return an empty array by default.
- Nucleus doesn't have text filters, so `mt.getSupportedTextFilters` returns an empty array.

# Error Codes

Below is an overview of the types of errors you can get back from the methods:

Error Code | Error Message
--- | ---
801 | Login Error (probably bad username/password combination)
802 | No Such Blog
803 | Not a Team Member
804 | Cannot add Empty Items
805 | Amount parameter must be in range 1..20 (getRecentItems)
806 | No Such Item
807 | Not Allowed to Alter Item
808 | Invalid media type
809 | File is too large (max. upload filesize)
810 | Other error on newMediaObject (message will contain more info about what happened)
other codes < 100 | Errors encountered by the Useful Inc. XML-RPC implementation
other codes > 100 | Errors encountered by the XML parser