Toggle menu

iCM_obj_mediaDelete

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

NameTypeDescription
MediaIDInteger, requiredThe ID of the media item to delete
CSUserNameString, requiredThe username of the iCM user deleting the media item - use an API Key
CSUserPasswordString, requiredAn MD5 hash of the password of the iCM user - use an API Key
VersionNotesString, optionalNotes 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"
}

Last modified on January 04, 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon