How can I get a Post with XML-RPC in WordPress?

After some digging around with the WordPress XML-RPC documentation, it seems that there isn’t a way to remotely obtain a “post” (such as a news article) through the XML-RPC interface. The documentation only mentions wp.getPage – if I try and pass in a PostID to this method, it returns:

 [faultCode] => 404 [faultString] => Sorry, no such page. 

… but wp.GetPage obviously does work when I pass a valid PageID. Does anyone have any ideas how I might go about solving this? Ideally, without extending the XML-RPC mechanism on the remote site (as access to these could be tricky)

Related posts

Leave a Reply

4 comments

  1. I managed to figure this out. You can do this by using the “blogger.getPost” method. There isn’t much documentation for this on the WordPress site, but if you check out xmlrpc.php in the root of the WordPress directory you will find a complete list of XML-RPC functions, including:

            // Blogger API
            'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
            'blogger.getUserInfo' => 'this:blogger_getUserInfo',
            'blogger.getPost' => 'this:blogger_getPost',
            'blogger.getRecentPosts' => 'this:blogger_getRecentPosts',
            'blogger.getTemplate' => 'this:blogger_getTemplate',
            'blogger.setTemplate' => 'this:blogger_setTemplate',
            'blogger.newPost' => 'this:blogger_newPost',
            'blogger.editPost' => 'this:blogger_editPost',
            'blogger.deletePost' => 'this:blogger_deletePost',
    

    Hope this helps anyone who struggles with this in future.