API Reference

Collections.getCollectionData

This method returns the collection info along with media in the collection based upon the collection ID requested. This method returns two arrays, "info" and "data". The "info" array holds the collection ID information where the "data" array holds a list of arrays for each media item in the collection.

Syntax

array collections.getCollectionData ( int collection, bool editMode = false, bool sane_metadata = false )

Arguments

NameTypeRequiredDefault valueDescription
collectionintRequirednoneThe ID of the collection.
editModeboolOptionalfalseWhether to include pending media.
sane_metadataboolOptionalfalseWhether to unserialize metadata.

Sample Response

Sample REST Response
http://api.newspark.ca/services/rest/collections/getCollectionData?collection=[COLLECTION_ID]
<?xml version="1.0" encoding="UTF-8"?>
<result>
  <info>
    <id>COLLECTION_ID</id>
    <vhost>VHOST_ID</vhost>
    <thumbnail/>
    <type>1</type>
    <name>COLLECTION_NAME</name>
    <description>COLLECTION_DESCRIPTION</description>
    <created>2012-02-03 11:40:39</created>
    <baseurl/>
    <channel>0</channel>
    <addToTop>0</addToTop>
    <autoActive>1</autoActive>
  </info>
  <data>
    <item>
      <extension>png</extension>
      <filename>filemobile_lydhz6cTvy1qcnl1ho1_500.png</filename>
      <filetype>1</filetype>
      <hits>49</hits>
      <id>MEDIA_ID</id>
      <message>MEDIA_MESSAGE</message>
      <moderationstatus>2</moderationstatus>
      <position>4</position>
      <rating>0</rating>
      <tags>media example test upload</tags>
      <title>MEDIA_TITLE</title>
      <uid>USER_ID</uid>
      <upload>2012-01-25 16:36:47</upload>
      <user_name>USER_NAME</user_name>
      <user_nickname/>
      <vhost>VHSOT_ID</vhost>
      <votecount>0</votecount>
      <publicUrl>http://fmdevs3.filemobile.com/storage/MEDIA_ID</publicUrl>
      <thumbUrl>http://fmdev.s3.amazonaws.com/storage/MEDIA_ID</thumbUrl>
      <location>fmdevs3</location>
      <moderationdeniedid>2</moderationdeniedid>
    </item>
  </data>
</result>
Sample JSON Response
{
    "status": true,
    "result": {
        "info": {
            "id": COLLECTION_ID,
            "vhost": VHOST_ID,
            "thumbnail": null,
            "type": 1,
            "name": "COLLECTION_NAME",
            "description": "COLLECTION_DESCRIPTION",
            "created": "2012-02-03 11:40:39",
            "baseurl": null,
            "channel": 0,
            "addToTop": 0,
            "autoActive": 1
        },
        "data": [
            {
                "extension": "png",
                "filename": "filemobile_lydhz6cTvy1qcnl1ho1_500.png",
                "filetype": 1,
                "hits": 49,
                "id": MEDIA_ID,
                "message": "MEDIA_MESSAGE",
                "moderationstatus": 2,
                "position": "4",
                "rating": 0,
                "tags": "media example test upload",
                "title": "MEDIA_TITLE",
                "uid": USER_ID,
                "upload": "2012-01-25 16:36:47",
                "user_name": "USER_NAME",
                "user_nickname": "",
                "vhost": VHOST_ID,
                "votecount": 0,
                "publicUrl": "http://fmdevs3.filemobile.com/storage/MEDIA_ID",
                "thumbUrl": "http://fmdev.s3.amazonaws.com/storage/MEDIA_ID",
                "location": "fmdevs3",
                "moderationdeniedid": 2
            }
        ]
    }
}

Code examples

0 comments

Be the first to comment on getCollectionData.

Add a Comment

  • captcha