myelin: bzero API v0.01
Integration

The bzero API is how you get at bzero weblog posts from other tools, like SharpBlog or w.bloggar.

Prior art

Most of the functionality we need is already in other APIs.

The following methods are taken from other systems. Error codes are from the Nucleus CMS API.

Blogger API (version 1.0)
blogger.getUsersBlogs( string appKey, string login, string password )
metaWeblog API (version 1.0)
string metaWeblog.newPost( string blogid, string login, string password, struct data, string publishNow )
New methods: bzero.*

Here are the new methods. One to help clients figure out what servers implement, and one to make it easier to get the information you need to make a useful 'select post to edit' screen.

struct bzero.getCapabilities()

Returns a struct with one field for each API implemented by the server. The value of each field is the version number of the revision of the API understood.

e.g. { 'blogger': [ '1.0', '2.0' ], 'metaWeblog': [ '1.0' ], 'bzero': [ '0.01' ] }

The following functions are implemented in each API. Only API / revision number pairs as given below are valid return codes:

'blogger' 1.0:

'metaWeblog' 1.0:

'bzero' 0.01:

Note that the bzero API does not include all of the blogger and metaWeblog APIs, and as such bzero itself will only return { 'bzero': [ '0.01' ] } when queried for its capabilities. Radio would probably return { 'blogger': [ '1.0' ], 'metaWeblog': [ '1.0' ] } and Blogger would return { 'blogger': [ '1.0' ] }. If a second version of the Blogger API comes out, an application supporting both it and the old version should return { 'blogger': [ '1.0', '2.0' ] }

array bzero.getRecentPosts( string blogid, string login, string password, string maxPosts )

Returns an array of structs, identical to the output from blogger.getRecentPosts, except with one extra field, 'title', which contains the post title.

Can fail with error 801 (login error).

Can fail with error 802 (no such weblog).

struct bzero.getPost( string blogid, string postid, string login, string password )

Returns a struct containing the post data as it would be stored in an RSS item. This is the same as metaWeblog.getPost, except it allows you to specify a blogid as well as a postid. bzero can have multiple blogs with the same postid, so requires this extra parameter.

Can fail with error 801 (login error).

Can fail with error 802 (no such weblog).

Can fail with error 806 (no such post).

bool bzero.editPost( string blogid, string postid, string login, string password )

Returns true. This is the same as metaWeblog.editPost, except it allows you to specify a blogid as well as a postid. bzero can have multiple blogs with the same postid, so requires this extra parameter.

Can fail with error 801 (login error).

Can fail with error 802 (no such weblog).

Can fail with error 806 (no such post).

    ⇒ myelin | notes | christchurch | net [ video hire ] | software [ dbwrappers | xmlrpc | pycs | pss ] | contact