API Reference

Collections.updateSearchCollection

This method is used to update a saved search collection.

The settings argument is an array of media ID's in the collection and the new order that they should be returned to in from this point forward.

The collection name and description can be changed with the updateCollectionInfo method.


Syntax

bool collections.updateSearchCollection ( int collection, array settings )

Arguments

NameTypeRequiredDefault valueDescription
collectionintRequirednoneThe collection ID.
settingsarrayRequirednoneThe array of fields to be updated.

Settings Array

The collection fields that can be updated.

NameTypeDescriptionDefault ValuesPossible ValuesRequired
filetypeINT OR ARRAY of INTOnly include the specified file types when adding media into the saved search collection.empty(all)empty,0,1,2,3,4required
sortSTRINGThe sort order of to apply to the media in the collection when returned in a request.uploadupload, hits, commentcount, rating, votecountrequired
channelINTWe channel that will be used to filter media from. Only media in the specified channel will be returned. You can also specify if you want to include media from children channel of the one selected.emptyINTrequired
sortdirSTRINGThe order which the sort filter will be applied. Ascending or descending orderASC / DESCSTRINGno
includeChildChannelsSTRINGThis specifies if media from the above channel's children will be returned in the response.falsetrue / falseno
timelimitINTA filter to only return media uploaded from a specific amount of time in the past. For example to specify media uploaded in the last 24 hours we would use 3600. (24 hr = 3600 sec)emptyINTno
limitSTRINGThe maximum number of media to be returned during a request.25STRINGno
limitSelectBOOLUsed to turn on and off the limit field.BOOLno
querySTRINGA string to filter media by.emptySTRINGno

Response

The response will be 1 if the update was a success.

NameTypeDescriptionDefault Values
idINTThe success result will be 1 if the update was completed.INT

Sample Response

Sample REST Response
http://api.filemobile.com/services/rest/collections/updateSearchCollection?collection=[COLLECTION_ID]&settings[filetype]=1&settings[channel]=[CHANNEL_ID]&settings[sort]=[NEW_SORT_PARAM]&settings[sortdir]=[SORT_DIRECTION]&settings[includeChildChannels]=true&settings[limit]=5&settings[limitSelect]=false&settings[query]=[QUERY_VALUE]&settings[timelimit]=8000&APIKEY=[APIKEY]
<?xml version="1.0" encoding="UTF-8"?>
<result>1</result>
Sample JSON Response
{
    "status": true,
    "result": 1
}

Code examples

0 comments

Be the first to comment on updateSearchCollection.

Add a Comment

  • captcha