addBlog

Previous page  First page  Next page

Description

Creates a new blog.

 

 

Syntax

reseller.addBlog(version, username, password, struct, create_user)

 

 

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.

 

struct

       

create_user - TRUE if a user is to be created as the owner of the blog, FALSE if an existing user is to assigned as the owner of the blog.

 

 

struct should contain the following fields:

 

name - (required) maximum length 255

 

keywords - (optional) Comma-separated list of meta keywords

 

description - (optional) Text description of blog for meta tag

 

custom_head - (optional) Text to be inserted in the <HEAD> portion of blog html pages.

 

hostname - (required) maximum length 255

 

secondary_hostnames - (optional) Array with up to two additional hostnames

 

package - (required) The package for this blog

 

trial_mode - (required) Boolean

 

locale - (optional) The language used when the blog is displayed.  Allowed values = en_US, en_CA, en_GB, fr_FR, and es_ES, if not submitted, the default used is en_US.

 

categories - (optional) Array

 

The categories field should be a list of structs, where each struct is defined as:

 

  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)

 

profile - (optional) Name of the blog settings profile to use

 

component_profile - (optional) ID of the component profile to use.

 

To get the ID of the component profile, query the system with the getComponentProfileList function.

 

Note: Since your component profiles will not change often, you will only need to use the getComponentProfileList function when adding a new profile and then use the cache as a base for building new accounts.

 

css_template - (optional) ID of the css template to use

 

user - struct of user information where fields are:
username (required) maximum length 25, only alpha numeric characters
password (required) maximum length 20, no spaces allowed
first_name maximum length 30
last_name maximum length 30
email (required if create_user) maximum length 255
nick_name (required if create_user) maximum length 50
url maximum length 255
timezone must be valid timezone from getTimezones()
locale (optional) the language used in the blog's Publisher Control Panel; allowed values = en_US, en_CA, en_GB, fr_FR, and es_ES, if not submitted, the default used is en_US

 

 

auto_transfer_upgrade_allowed - (optional) Allows you to enable automatic upgrades for transfer usage.  Automatic upgrades will prevent a blog from being disabled due to transfer-usage overages, by automatically increasing the blog's transfer allowance for the month that it exceeds its transfer amount.  Allowed values: '0' (do not activate) or '1' (activate).

 

auto_transfer_upgrade_quantity - (optional) Indicates the maximum amount that a blog enabled for automatic transfer upgrades may be upgraded.  Allowed values are "100" - "900" for MB, and "1024" for 1GB, "2048" for 2GB, and so on for GBs.  If other values are submitted, an error will be returned.

 

auto_transfer_upgrade_step_value - (optional) Indicates the increment amount that a blog enabled for automatic transfer upgrades will be upgraded. The blog will be updated in increments of the specified amount, as needed, until the auto_transfer_upgrade_quantity is reached. Allowed values are "100" - "900" for MB, and "1024" for 1GB, "2048" for 2GB, and so on for GBs.  If other values are submitted, an error will be returned.

 

 

Response Fields

This function returns the reseller.getBlogInfo struct upon success.

 

Note: if a blog is being mapped to an existing Blogware account, the account's username and password are both required fields.