PeopleAggregator API: method metaWeblog.getCategories

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

Method: metaWeblog.getCategories

(metaWeblog API) Get the list of categories from a blog. [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 3 arguments, NOT a single struct, like most other methods in this API.

blogid

Type: string
Identifier for the 'blog' container for which you wish to get a category list (blogids can be obtained by calling blogger.getUsersBlogs() and looking for the 'blogid' parameter in the array items in the returned data).
Example: user:123

login

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

password

Type: string
User's password.
Example: testuser123

Return value (see also Exceptions)

Type: array

Content of each item:

item

Type: hash

Attributes:

categoryId

Type: string
ID of this category (used when posting to it)
Example: 1

categoryName

Type: string
Name of the category
Example: Random stuff

description

Type: string
Description of this category
Example: Things that don't fit into any other category

rssUrl

Type: string
URL of the RSS feed of this category
Example: http://peepagg/something/feed/cat/123

htmlUrl

Type: string
URL of the HTML rendering of this category
Example: http://peepagg/something/display/cat/123

Example REST (XML) request

Request

Response

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

<response>
 <item>
  <htmlUrl>http://peepagg/something/display/cat/123</htmlUrl>
  <rssUrl>http://peepagg/something/feed/cat/123</rssUrl>
  <description>Things that don't fit into any other category</description>
  <categoryId>1</categoryId>
  <categoryName>Random stuff</categoryName>
 </item>
</response>

Example REST (JSON) request

Request

Response

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

[{"htmlUrl": "http://peepagg/something/display/cat/123", "rssUrl": "http://peepagg/something/feed/cat/123", "description": "Things that don't fit into any other category", "categoryId": "1", "categoryName": "Random stuff"}]

Example XML-RPC call

Request

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

<?xml version='1.0'?>
 <methodCall>
  <methodName>metaWeblog.getCategories</methodName>
  <params>
   <param>
    <value><string>user:123</string></value>
   </param>
   <param>
    <value><string>testme</string></value>
   </param>
   <param>
    <value><string>testuser123</string></value>
   </param>
  </params>
 </methodCall>
 

Response

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

<?xml version='1.0'?>
 <methodResponse>
  <params>
   <param>
    <value><array><data>
     <value><struct>
      <member>
       <name>htmlUrl</name>
       <value><string>http://peepagg/something/display/cat/123</string></value>
      </member>
      <member>
       <name>rssUrl</name>
       <value><string>http://peepagg/something/feed/cat/123</string></value>
      </member>
      <member>
       <name>description</name>
       <value><string>Things that don't fit into any other category</string></value>
      </member>
      <member>
       <name>categoryId</name>
       <value><string>1</string></value>
      </member>
      <member>
       <name>categoryName</name>
       <value><string>Random stuff</string></value>
      </member>
     </struct></value>
    </data></array></value>
   </param>
  </params>
 </methodResponse>