API Reference

Collections.getCollections

This method returns a list of collections from the specified vhost returned in a array. Each array will contain the collection information.


Syntax

bool collections.getCollections ( int vhost, int type = 0 )

Arguments

NameTypeRequiredDefault valueDescription
vhostintRequirednoneThe ID of the vhost the collection belongs to.
typeintOptional0The type of collections you want returned, 1 for manual, and 2 for saved search.

Response

The response will be an array of items for each collection in the vhost. Each item will contain information about a collection.

NameTypeDescriptionDefault Values
idINTThe collection IDINT
vhostINTThe vhost ID that the collection belongs to.INT
thumbnailSTRINGA thumb url of an image to represent the collection.empty STRING
typeINTThis determines whether the collection is a saved search collection or a manual collection. Saved search is represented by 1 and manual collection by 2.1/2
nameSTRINGThe name of the collection. This is used for recognition of the channel.STRING
descriptionSTRINGAn overview of the media content that is in the collection.STRING
createdYYYY-MM-DD HH:MM:SSThe date the collection was created in our system.YYYY-MM-DD HH:MM:SS
baseurlSTRINGDEPRECATEDSTRING
channelINTThe channel that is used as a filter if the collection type is a saved search.empty / channel ID
addtotopINTWhen this is set the channel will be added to the top of the channel list.0/1
autoactiveINTThis sets the collection that it will be set as published as its default state.0/1

Sample Response

Sample REST Response
http://api.newspark.ca/services/rest/collections/getCollections?vhost=[VHOST_ID]&APIKEY=[APIKEY]
<?xml version="1.0" encoding="UTF-8"?>
<result>
  <item>
      <id>COLLECTION_ID</id>
      <vhost>VHOST_ID</vhost>
      <thumbnail/>
      <type>2</type>
      <name>COLLECTION_NAME</name>
      <description>Saved Collection Description</description>
      <created>2012-02-01 10:45:01</created>
      <baseurl/>
      <channel>FILTERED_CHANNEL_ID</channel>
      <addToTop>0</addToTop>
      <autoActive>1</autoActive>
  </item>
  <item>
      <id>COLLECTION_ID</id>
      <vhost>VHOST_ID</vhost>
      <thumbnail/>
      <type>2</type>
      <name>COLLECTION_NAME</name>
      <description>Saved Collection Description</description>
      <created>2012-02-01 10:45:01</created>
      <baseurl/>
      <channel>FILTERED_CHANNEL_ID</channel>
      <addToTop>0</addToTop>
      <autoActive>1</autoActive>
  </item>
</result>
Sample JSON Response
{
    "status": true,
    "result": [
        {
            "id": COLLECTION_ID,
            "vhost": VHOST_ID,
            "thumbnail": null,
            "type": 2,
            "name": "COLLECTION_NAME",
            "description": "Saved Collection Description",
            "created": "2012-02-01 10:45:01",
            "baseurl": null,
            "channel": FILTERED_CHANNEL_ID,
            "addToTop": 0,
            "autoActive": 1
        },
        {
            "id": COLLECTION_ID,
            "vhost": VHOST_ID,
            "thumbnail": null,
            "type": 2,
            "name": "COLLECTION_NAME",
            "description": "Saved Collection Description",
            "created": "2012-02-01 10:45:01",
            "baseurl": null,
            "channel": FILTERED_CHANNEL_ID,
            "addToTop": 0,
            "autoActive": 1

        }
    ]
}

Code examples

0 comments

Be the first to comment on getCollections.

Add a Comment

  • captcha