R2D2 on God, 42, the Universe and everything else
  
  

WordPress XML RPC API seems out of date

 

I was trying to work out the call format for posting to WordPress 4.x using the built-in XML API (from an Android app I’m working on ) and kept getting constantly an error. Yes, compiling, running and posting from the Android open source WordPress app was working just fine.

So me being the engineer I am I’ve fired up Wireshark on my server and captured both requests… turns out that the calls made by the native app are using a slighlty DIFFERENT API… go figure. Yet, not quite so obvious when you search for it…

FAILING CALL

<?xml version=”1.0″ encoding=”iso-8859-1″?>
<methodCall>
<methodName>wp.newPost</methodName>
<params>
<param><value>1</value></param>
<param><value>user</value></param>
<param><value>password</value></param>
<param><value></value></param>
<param><value>post</value></param>
<param><value>draft</value></param>
<param><value>Test Post RPC title</value></param>
<param><value></value></param>
<param><value>Test RPC post Excerpt</value></param>
<param><value>This is a test post via XMLRPC SOAP</value></param>
</params>
</methodCall>

WORKING CALL
<?xml version=’1.0′ ?>
<methodCall>
<methodName>metaWeblog.newPost</methodName><params>
<param><value><i4>1</i4></value></param>
<param><value><string>user</string></value></param>
<param><value><string>password</string></value></param>
<param><value><struct><member><name>title</name><value><string>Test POST1 via RPC-XML interface client </string></value></member>
<member><name>wp_password</name><value><string></string></value></member>
<member><name>post_status</name><value><string>draft</string></value></member>
<member><name>description</name><value><string>Test POST1 content via RPC-XML interface client</string></value></member>
<member><name>mt_excerpt</name><value><string>Excerpt Test POST1 via RPC-XML interface client</string></value></member>
<member><name>mt_keywords</name><value><string></string></value></member>
<member><name>post_type</name><value><string>post</string></value></member>
<member><name>wp_post_format</name><value><string>standard</string></value></member>
</struct></value></param>
<param><value><boolean>0</boolean></value></param></params>
</methodCall>