Changes the properties of a media item.
bool media.updateFile ( int/array id, array newProperties, mixed options = array() )
Name | Type | Required | Default value | Description |
---|---|---|---|---|
id | int/array | Required | none | ID or array of IDs of the media item you want to update. |
newProperties | array | Required | none | An associated array with new and or updated values to be applied to the media item. |
options | mixed | Optional | array() |
The options array may contain the following parameters.
Name | Type | Description | Possible Values |
---|---|---|---|
uid | INT | The new user ID for the media item. | INT |
title | STRING | The new title for the media item. | N/A |
message | STRING | The new message for the media item. | N/A |
hidden | STRING | The hidden status of the media item. | HIDDEN or SHOWN |
tags | STRING | Updated tags for the media item. This will overwrite the existing tags with the newly specified tags. | N/A |
moderationstatus | INT | The new moderation status of the media item. Media Moderation Notifications: Media Moderation notification emails can be sent when media is approved or denied. To send these emails, set the `Approved Moderation Email` and `Denied Moderation Email` templates in the channeldetail page of the channel that the media are in. | 0,1,2,3,-1 (Check the word possibilities unmoderated, accepted, denied, deleted, notdenied, moderated, all) |
channel | INT | The channel ID of the updated channel the media item will be a member of. | INT |
parentid | INT | The new parent ID for the media item. This can be used to assign a media item as a comment along with updating the media context as well or switching a comment from one parent media item to another. | INT |
metadata | ARRAY | The new or updated additional values for the media item. | 'metadata': {'user': {'keyvalue': 'test update'}} |
language | STRING | The 2-letter ISO code that will be used to updated the media's language value. | STRING |
date | YYYY-MM-DD HH:MM:SS | The new date that will be stored for reference to the creation date of the media item. | YYYY-MM-DD HH:MM:SS |
startdate | YYYY-MM-DD HH:MM:SS | The starting date that will be stored for reference for the availability of the media item. | YYYY-MM-DD HH:MM:SS |
enddate | YYYY-MM-DD HH:MM:SS | The ending date that will be stored for reference for the end of availability of the media item. | YYYY-MM-DD HH:MM:SS |
offensive | INT | The number of times that this media has been reported as offensive. | INT |
geo_latitude | FLOAT | The geographic latitude of the file in degrees latitude, specified as a float up to 14 decimals. | 50.00000000000001 |
geo_longitude | FLOAT | The geographic longitude of the file in degrees latitude, specified as a float up to 14 decimals. | -70.00000000000001 |
externalids | ARRAY | This is an array of the third party IDs for the file; it is available only if the file is hosted by one of our partners, such as Twitter, Instagram, Youtube, Brightcove, Widen and Ooyala. The external id provider values are stored as an integer, and are below:
NOTE 1 Each recordset in the array is an array itself that contains the following:
NOTE 2Only one record can be the primary external id for each media. NOTE 3The record that is noted as the primary external id is stored in the externalid with the reference to the external id provider stated before the external id. | Format array ( < ext. id provider 1 > => '< external id a >', < ext. id provider 2 > => '< external id b >' ) Example 1: Updates media's external ids for Brightcove and Instagram. array( 1 => '545433_57632' 3 => '545433_57633' ) Example 2: Sets the `primary external id` the media yo 2. NOTEYou can not set the `primary external id` to an externali id that does not exist for the media. array( 1 => '545433_57632' 3 => '545433_57633' ) |
The response returned on success and failure of media update.
Name | Type | Description | Possible Values |
---|---|---|---|
result | boolean | The returned result of the request to update the media item. | true/false |
status | boolean | The status of the request as a whole. Unrelated to the success of updating the media item but rather was the request executed in full. | true/false |
<?xml version="1.0" encoding="UTF-8"?> <result>1</result>
{ "status": true, "result": 1 }