API Reference

Channels.getChannels

Returns the list of channels for the specified vhost.


Syntax

array channels.getChannels ( int vhost, mixed order = false, mixed visibility = 'ALL', int parentchannel = false )

Arguments

NameTypeRequiredDefault valueDescription
vhostintRequirednoneThe vhost ID that the list of channels belong to in MediaFactory.
ordermixedOptionalfalseThe order in which you wish to have the channel list returned to you in.
visibilitymixedOptional'ALL'The visibility of the channel you want to filter on for the returned list of channels.
parentchannelintOptionalfalseIf set - the component returns only channels that are children of the given channel.

Response

This is the response received on success of the getChannels method call. If there are no channels in your vhost you will be returned an empty XML response.

NameTypeDescriptionPossible Values
idINTThe current channel ID.INT channel ID
createdYYYY-MM-DD HH:MM:SSThe date the channel was created.YYYY-MM-DD HH:MM:SS
vhostINTThe vhost ID.INT
nameSTRINGThe channel name defined in MediaFactory.STRING
shortnameSTRINGThe given short given retrieved in MediaFactory. By Default this is the channel name, all lowercase and have spaces " " replaced by underscores "_".STRING
parentchannelINTThe ID of the current channel's parent. This is for nested channel lists.INT
thumburlSTRINGOBSOLETESTRING
statusINTThe moderation status of the current channel.0,1,2,3,4
descriptionSTRINGA short summary for the purpose of the channel. This is defined in MediaFactory.STRING
readonlyINTOBSOLETE0/1
disableembedINTDEPRECATED0/1
modemailacceptedINTThe ID of the email to use for Media approved in the channel.INT
modemaildeniedINTThe moderation email ID of the email to use for Media denied in the channel.INT
emailaddressSTRINGEmail address to be used for media intake through email. Leave empty to disable, must be unique.STRING
defaultsortSTRINGThe default sort order of the media within the channel.'name ASC', 'name DESC', 'shortname ASC', 'shortname DESC', 'id ASC', 'id DESC', 'createdDate ASC', 'createdDate DESC'
visibilitySTRINGThe current visibility of the channel.SHOWN, HIDDEN
geoblockingSTRINGA list of accepted country codes to have the content from the channel display. This setting is set in the channel settings.ca,us,au etc.
groupidDEPRECATEDDEPRECATEDDEPRECATED
groupnameDEPRECATEDDEPRECATEDDEPRECATED

Sample Response

Sample REST Response
http://api.newspark.ca/services/rest/channels/getChannels?vhost=[VHOST_ID]
<?xml version="1.0" encoding="UTF-8"?>
<result>
  <item>
    <id>CHANNEL_ID</id>
    <created>2012-01-20 12:08:57</created>
    <vhost>VHOST_ID</vhost>
    <name>Comments</name>
    <shortname>comments</shortname>
    <parentchannel>0</parentchannel>
    <thumburl/>
    <status>1</status>
    <description/>
    <readonly>0</readonly>
    <disableembed>0</disableembed>
    <modemailaccepted>0</modemailaccepted>
    <modemaildenied>0</modemaildenied>
    <emailaddress/>
    <defaultsort>upload DESC</defaultsort>
    <visibility>SHOWN</visibility>
    <geoblocking/>
    <groupid>0</groupid>
    <groupname/>
  </item>
  <item>
    <id>CHANNEL_ID</id>
    <created>2012-01-20 12:08:44</created>
    <vhost>VHOST_ID</vhost>
    <name>Documentation</name>
    <shortname>documentation</shortname>
    <parentchannel>0</parentchannel>
    <thumburl/>
    <status>1</status>
    <description/>
    <readonly>0</readonly>
    <disableembed>0</disableembed>
    <modemailaccepted>4266</modemailaccepted>
    <modemaildenied>0</modemaildenied>
    <emailaddress/>
    <defaultsort>upload DESC</defaultsort>
    <visibility>SHOWN</visibility>
    <geoblocking/>
    <groupid>0</groupid>
    <groupname/>
  </item>
</result>

Sample JSON Response
{
    "status": true,
    "result": [
        {
            "id": "CHANNEL_ID",
            "created": "2012-01-20 12:08:57",
            "vhost": "VHOST_ID",
            "name": "Comments",
            "shortname": "comments",
            "parentchannel": "0",
            "thumburl": "",
            "status": "1",
            "description": "",
            "readonly": "0",
            "disableembed": "0",
            "modemailaccepted": "0",
            "modemaildenied": "0",
            "emailaddress": null,
            "defaultsort": "upload DESC",
            "visibility": "SHOWN",
            "geoblocking": null,
            "groupid": "0",
            "groupname": ""
        },
        {
            "id": "CHANNEL_ID",
            "created": "2012-01-20 12:08:44",
            "vhost": "VHOST_ID",
            "name": "Documentation",
            "shortname": "documentation",
            "parentchannel": "0",
            "thumburl": "",
            "status": "1",
            "description": "",
            "readonly": "0",
            "disableembed": "0",
            "modemailaccepted": "4266",
            "modemaildenied": "0",
            "emailaddress": null,
            "defaultsort": "upload DESC",
            "visibility": "SHOWN",
            "geoblocking": null,
            "groupid": "0",
            "groupname": ""
        }
    ]
}

Code examples

0 comments

Be the first to comment on getChannels.

Add a Comment

  • captcha