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

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

Arguments

NameTypeRequiredDefault valueDescription
vhostintRequirednoneThe ID of the vhost the collection belongs to.
typeintOptional0The type of collections to return: 1 for manual, 2 for saved search.
includeCountboolOptionalfalseWhether to include media count per collection.

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