This module deletes a media item from the library.
Both the username and password should be provided using the default credentials of an API Key. See "Supplying Default Credentials" in URLs, Keys and Authentication.
As with deleting media items manually in iCM, the physical file will not necessarily be removed. Version history policies may mean the file stays in place so it can be restored later.
Properties
Name | Type | Description |
---|---|---|
MediaID | Integer, required | The ID of the media item to delete |
CSUserName | String, required | The username of the iCM user deleting the media item - use an API Key |
CSUserPassword | String, required | An MD5 hash of the password of the iCM user - use an API Key |
VersionNotes | String, optional | Notes to add to the version history. There's a maximum length of 256 characters |
Example
function(params, credentials) {
let deleteMedia = this.callWorkerMethod("icmapi", "iCM_obj_mediaDelete", {
"attributes": {
"MediaID": 2017
}
}, {
"options": {
"apiKey": "<Your API Key>"
}
});
return deleteMedia;
}
Returns
If the request was successful the result data object will contain an object called CONTENT which includes the media ID, and another called STATE indicating the media item was deleted successfully.
{
"id": 119,
"result": {
"CONTENT": {
"MediaID": 3609
},
"STATE": {
"Status": "ACCESS GRANTED"
}
},
"jsonrpc": "2.0"
}