PeopleAggregator API: method metaWeblog.editPost

Arguments | Return value | REST (XML) example | REST (JSON) example | XML-RPC example

Method: metaWeblog.editPost

(metaWeblog API) Modifies an existing content item. [NOTE: DO NOT USE THE REST FORM OF THIS API CALL; THE METAWEBLOG API IS XML-RPC ONLY]

Arguments (see also Authentication)

If calling by XML-RPC, note that this method takes 5 arguments, NOT a single struct, like most other methods in this API.

postid

Type: string
Identifier for the post you wish to modify (as returned from metaWeblog.newPost).
Example: user:123:345

login

Type: string
User's login name.
Example: testme

password

Type: string
User's password.
Example: testuser123

post

Type: hash

Attributes:

title

Type: string
Post title.
Example: Test post
Default:

link

Type: string
Something the post links to.
Example: http://example.org/a_link.html
Default:

description

Type: string
Post content.
Example:

This is a test post.

publish

Type: boolean
true if the post should be published immediately, or false if it should be kept as a draft.
Example: True

Return value (see also Exceptions)

Type: boolean
Always returns 'true'
Example: True

Example REST (XML) request

Request

POST /api/xml/metaWeblog/editPost HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 242

login=testme&password=testuser123&post=%7B%27link%27%3A+%27http%3A%2F%2Fexample.org%2Fa_link.html%27%2C+%27description%27%3A+%27%3Cp%3EThis+is+a+test+post.%3C%2Fp%3E%27%2C+%27title%27%3A+%27Test+post%27%7D&publish=True&postid=user%3A123%3A345

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 42

<response>true</response>

Example REST (JSON) request

Request

POST /api/json/metaWeblog/editPost HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 242

login=testme&password=testuser123&post=%7B%27link%27%3A+%27http%3A%2F%2Fexample.org%2Fa_link.html%27%2C+%27description%27%3A+%27%3Cp%3EThis+is+a+test+post.%3C%2Fp%3E%27%2C+%27title%27%3A+%27Test+post%27%7D&publish=True&postid=user%3A123%3A345

Response

HTTP/1.1 200 OK
Content-Type: application/x-javascript
Content-Length: 4

true

Example XML-RPC call

Request

POST /api/xmlrpc HTTP/1.1
Content-Type: text/xml
Content-Length: 1984

<?xml version='1.0'?>
 <methodCall>
  <methodName>metaWeblog.editPost</methodName>
  <params>
   <param>
    <value><string>user:123:345</string></value>
   </param>
   <param>
    <value><string>testme</string></value>
   </param>
   <param>
    <value><string>testuser123</string></value>
   </param>
   <param>
    <value><struct>
     <member>
      <name>link</name>
      <value><string>http://example.org/a_link.html</string></value>
     </member>
     <member>
      <name>description</name>
      <value><string>&lt;p&gt;This is a test post.&lt;/p&gt;</string></value>
     </member>
     <member>
      <name>title</name>
      <value><string>Test post</string></value>
     </member>
    </struct></value>
   </param>
   <param>
    <value><boolean>1</boolean></value>
   </param>
  </params>
 </methodCall>
 

Response

HTTP/1.1 200 OK
Content-Type: text/xml
Content-Length: 329

<?xml version='1.0'?>
 <methodResponse>
  <params>
   <param>
    <value><boolean>1</boolean></value>
   </param>
  </params>
 </methodResponse>