API Reference

Media.getTagList

Retrieve a list of tags for a media item.

This method returns an array containing a tag, hits and count key.

The response of this method can be sorted on 'tag', 'count' (for the number of occurrences of the tag) and 'hits' for the popularity of the tag.


Syntax

array media.getTagList ( int vhost, string sort = 'tag ASC', array filters = array(), int limit = 25, mixed startsWith = false )

Arguments

NameTypeRequiredDefault valueDescription
vhostintRequirednoneThe vhost ID.
sortstringOptional'tag ASC'Specify here which field you want to sort on.
filtersarrayOptionalarray()You can specify the filter parameters here as an array. Recognized filters are uid (userid), channel, filetype, moderationStatus, timeLimit (in seconds) and tag.
limitintOptional25The total number of tags you want to receive in your response.
startsWithmixedOptionalfalse

Response

The response consists of an array of item elements for each tag the vhost. Each item contains additional the information about the tag.

NameTypeDescriptionDefault Values
itemarrayAn array of items for each tag in the vhost. Each item contains information about the tag.empty

item

The options array may contain the following parameters.

NameTypeDescriptionDefault Values
namestringThe tag name.accounts, channels, groups etc...
hitsINTThe popularity rating of the tag.0
countINTThe frequency that the tag appears in the current vhost.0

Sample Response

Sample REST Response
http://api.filemobile.com/services/rest/media/getTagList?vhost=[VHOST_ID]
<?xml version="1.0" encoding="UTF-8"?>
<result>
  <item>
    <name>accounts</name>
    <hits>0</hits>
    <count>1</count>
  </item>
  <item>
    <name>channels</name>
    <hits>0</hits>
    <count>1</count>
  </item>
  <item>
    <name>example</name>
    <hits>0</hits>
    <count>1</count>
  </item>
</result>
Sample JSON Response
{
    "status": true,
    "result": [
        {
            "name": "accounts",
            "hits": "0",
            "count": "1"
        },
        {
            "name": "channels",
            "hits": "0",
            "count": "1"
        },
        {
            "name": "example",
            "hits": "0",
            "count": "1"
        }
    ]
}

Code examples

0 comments

Be the first to comment on getTagList.

Add a Comment

  • captcha