API Reference

Collections.updateManualCollection

This method is used to update a manual collection. The possible uses for this would be to re-order the media in the collection, or delete media from a collection.

The newOrder 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 deletedFiles argument is an array containing media ID's that are going to be removed form the collection. After the request is made these pieces of media will not be included in the response.

The collection name and description as well as the autoactive and addtotop parameters can be changed with the updateCollectionInfo method.


Syntax

bool collections.updateManualCollection ( int collection, array newOrder = array(), array deletedFiles = array() )

Arguments

NameTypeRequiredDefault valueDescription
collectionintRequirednoneThe collection ID.
newOrderarrayOptionalarray()The new order of the media in the collection. This must be passed in an array.

The correct syntax is is ...?newOrder[[MEDIA_ID1]]=1&newOrder[MEDIA_ID2]=2
deletedFilesarrayOptionalarray()The files to be deleted from the collection. This must be passed in an array.

The correct syntax is is ...?deletedFiles[]=MEDIA_ID1&deletedFiles[]=MEDIA_ID2

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.newspark.ca/services/rest/collections/updateManualCollection?collection=[COLLECTION_ID]&deletedFiles[]=[MEDIA_ID_TO_DELETE]&newOrder[[MEDIA_ID1]]=1&newOrder[[MEDIA_ID2]]=2&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 updateManualCollection.

Add a Comment

  • captcha