Creating and updating channels via the HTTP API

The HTTP API has been updated to allow channels to be created and updated. To create a new channel , send an HTTP POST request to $/channels/create with the channel configuration as the post data (described below).

To update one or more existing channels, send an HTTP POST request to $/channels/create with the settings to be changed as the post data. The format is identical to that of the create request and only the settings specified in the post data will be applied, all other settings will remain unchanged. The channels to be updated are identified via the standard parameters in the request URL (id/name/filter/regex/folderId/folderName/subFolders).

The format of the configuration data used to create and update channels is the same as that returned by a $/channels/list request, except that there is no top-level <channels> node. For example, the following POST request sent to $/channels/create will create a new channel:

    <channel type="standard">
        <feedUrl> http://awasu.com/news.xml </feedUrl>
    </channel>

Creating channels

To create a normal channel, simply specify the feed URL e.g.

    <channel type="standard">
        <feedUrl> http://awasu.com/news.xml </feedUrl>
    </channel>

To create a plugin channel, specify the path to the plugin and optionally, any plugin parameter values e.g.

    <channel type="plugin">
        <pluginChannel path="{:INSTALL-DIR:}/Samples/SamplePythonChannel2/SamplePythonChannel2.py">
            <param name="nItems"> 3 </param>
        </pluginChannel>
    </channel>

To create a search channel, specify the query string and any other parameters e.g.

    <channel type="search">
        <searchQuery searchInUrls="no" searchInTitles="yes" searchInDescriptions="yes">
            query string
            <scoreCutoff> 25 </scoreCutoff>
        </searchQuery>
    </channel>

Channel configuration

Most channel configuration is fairly straight-forward and values are configured via child nodes in the root <channel> node.

Basic channel details such as name and description are usually specified by the publisher in the feed itself but can be overriden by the user e.g.

    <channel type="standard">
        <name> ... </name>
        <description> ... </description>
        <homeUrl> ... </homeUrl>
    </channel>
The channel summary page can be configured like this:
    <channel type="...">
        <channelSummary compact="no" showItems="..." itemWindow="..." contentFormat="..."> 
            <templateFilename> {:INSTALL-DIR:}/Resources/Channel Summary Templates/Rusty.template </templateFilename>
        </channelSummary>
    </channel>
where:

Authenticated feeds

The username and/or password can be set for channels as follows:

    <channel type="standard">
        <auth>
            <name> ... </name>
            <password> ... </password>
        </auth>
    </channel>
To remove the authentication details from a channel, include an empty <auth> node:
    <channel type="standard">
        <auth />
    </channel>

Channel hooks

Channel hooks can be added to new or existing channels as follows:

    <channel type="...">
        <channelHook path="...">
            <param name="..."> ... </param> <!-- as needed -->
            <param name="..."> ... </param>
        </channelHook>
    </channel>
To update a hook that has already been attached to a channel, it must be identified by its ID. The hook itself cannot be changed and so only the display name and/or hook parameters may be altered.

To detach a hook from a channel, include a delete="yes" attribute:

    <channel type="...">
        <channelHook id="..." delete="yes" />
    </channel>

Miscellaneous

Any settings that include a directory path (e.g. template filename or output filename) can use one of the following directory aliases:

When specifying parameters for plugin channels, channel hooks, etc. existing values can be deleted (and replaced with their default value, if applicable) by including a delete="yes" attribute. All values can be reset by including a delete="all" attribute.