Create a Network

Operation Summary: 
Creates a new network and associated network administrator.
Resource URL: 
https://api.compendiumblog.com/app/network/create
HTTP method: 
POST
HTTP Status Codes: 
201 Created
HTTP Status Code Details: 

201 Created
The network was successfully created.

Response Representations: 
JSON (application/json)
Permitted Roles: 
Super Administrator
Super Delegate
Required Parameters: 
CompanyName
A canonical name to use for the company. Does not have to be unique.
Subdomain
The subdomain of the URL (e.g. blog)
Domain
The domain of the URL (e.g. example.com).
Administrator
Attributes to be used in creating the network's administrative account. The structure of this argument is discussed in greater detail in the notes section.
Optional Parameters: 
CategoryName
A conceptual term describing the products or services promoted by the network. Defaults to the value of CompanyName.
UberblogTitle
The title of the blog which will display all of the network's compended content. Defaults to the value of CompanyName.
Notify
Specifies whether the application should fire the Network.Create.Login.Notify event. For more information, see the Notification Event portion of the Additional Information section of this reference guide entry.
PublisherNetworkId
If specified, the newly created network will be linked to the specified network in a content syndication relationship. For more information, see the Content Syndication portion of the Additional Information section of this reference guide entry.
Response Values: 
Success
The network was successfully created.
Error
The network could not be created.
Response Structure: 

JSON

Responses are single-member objects which have a property name based on the type of result.

The Success result will look like:

{ 'Success' : string }

where the string value is the GUID for the new network.

The Error result will be a flat array of objects, which have keys for the message name and explanatory text.

{
     'Error' : [
       { 'Name' : string, 'Message' : string },
       { 'Name' : string, 'Message' : string },
       ...   
    ]
 }
Error Types: 
CompanyName
Invalid CompanyName specified. Max length of 50, min length of 1.
Subdomain
Invalid Subdomain specified. Max length of 50, min length of 1.
Domain
Invalid Domain specified. Max length of 50, min length of 1.
Administrator
Invalid Administrator definition specified.
CategoryName
Invalid CategoryName specified. Max length of 50, min length of 1.
UberblogTitle
Invalid UberblogTitle specified. Max length of 50, min length of 1.
Notify
Invalid Notify value specified. The value of Notify must be true or false.
Create
Error creating new network.
Additional Notes: 

Uniqueness
Note that the Subdomain/Domain combination must be unique for our entire system.

Administrator Parameter
The Administrator parameter specifies the appropriate values for the network administrator of a network. It is a JSON object of the form:

{
    'UserName'     : string,       // administrator login name, maximum of 320 characters
    'EmailAddress' : string,       // administrator contact e-mail, maximum of 320 characters
    'FirstName'    : string,       // administrator's given name, maximum of 30 characters
    'LastName'     : string        // administrator's surname, maximum of 30 characters
}

Notification Event

The Network.Create.Login.Notify event typically sends a new account e-mail to the address specified for the network administrator.

If the Notify parameter is set to true, the event will fire. If set to false, the event firing will be suppressed. If the parameter is omitted, a value of true is implied.

Content Syndication

If the PublisherNetworkId is specified in a network creation operation, the newly created network is said to subscribe to the publisher network. A subscriber network consists exclusively of keyword blogs that re-purpose content from the publisher network. No Default Permissions users may be added to a subscriber network. No uberblog will be created for a subscriber network, even if information for an uberblog is specified by the caller.

The publisher and subscriber networks must share the same domain (e.g foo.example.com and bar.example.com). The candidate publisher network must not already be a subscriber in a pre-existing syndication relationship. The publisher/subscriber relationship is irrevocable, meaning a subscriber network remains a subscriber network over the lifespan of the network.

Command Line Example

curl -H "Accept: application/vnd.compendium.blog;version=2,application/json" --user someuser:mgc3crqk45ufzkfb -d 'CompanyName=Foo&Subdomain=blog&Domain=example.com&Administrator={"UserName":"joeadmin","EmailAddress":"joe@example.com","FirstName":"Joe","LastName":"Admin"}' https://api.test.compendiumblog.com/app/network/create 

Comments

Creating a network in the test environment

When using the https://api.test.compendiumblog.com/app/network/create endpoint in the test environment, it should be noted that the subdomain parameter should be only the bottom-level domain (i.e. blogging) and the domain should have .test.compendiumblog.com appended to the actual domain name (i.e. compendiumblog.com.test.compendiumblog.com).

Drupal 6 Appliance - Powered by TurnKey Linux