addBlogCategories

Previous page  First page  Next page

Description

Adds a set of categories to an existing blog.

 

 

Syntax

reseller.addBlogCategories(version, username, password, blog_id, struct)

 

 

Request Fields

version - Specifies the version number of the API. Set this to "1.3".  This value is currently ignored, but will be useful for API changes in future versions.

 

username - Your reseller account username.

 

password - Your reseller account password.

 

blog_id - The ID number of the blog to which you want to add categories.

 

struct - A list of categories containing structs with the following structure:

 

  label (required) - category name

  type (required) - possible values: article, photo

  subcats (optional) - a list of structs defining sub categories for this category

 

Example:

 

   [ { 'label' => 'News',

       'type' => 'article'

     },

     { 'label' => 'Family',

       'type' => 'article',

       'subcats' => [

           { 'label' => 'Christmas', 'type' => 'photo' },

           { 'label' => 'Vacations', 'type' => 'photo' },

       ]

     }

   ]

 

This would represent a category structure like:

 

Main Menu

News (article)

Family (article)

Christmas (photo album)

Vacations (photo album

 

The struct describing the categories to be added should contain the following field:

 

categories (see categories array description below in addBlog documentation)

 

 

Response Fields

Returns [is_success, result_list] where is_success is a Boolean indicating whether the operation succeeded. result_list is a copy of the original categories list with one of the following attributes provided where relevant:

 

duplicate (Boolean)
error_msg (text string)

 

 

Notes

Categories that already exist will be ignored.

 

Any error other than a duplicate category will result in the entire operation failing, and is_success will be false.

 

Specifying an existing category would result in the operation succeeding (is_success = true), however the category's struct in result_list would contain { duplicate => true }.