Toggle menu

iCM_obj_articleDelete

This module deletes an article from the database.

iCM and your website must both be running on the same server for this module to work. Articles can only be deleted from the iCM database defined in autoconfig, it does not accept a datasource parameter.

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.

Properties

NameTypeDescription
ArticleIDInteger, requiredThe ID of the article to delete
CSUserNameString, requiredThe username of the iCM user deleting the article - 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 deleteArticle = this.callWorkerMethod("icmapi", "iCM_obj_articleDelete", {
        "attributes": {
            "ArticleID": 45
        }
    }, {
        "options": {
            "apiKey": "<Your API Key>"
        }
    });
    return deleteArticle;
}

Returns

If the request was successful the result data object will contain an object called CONTENT which includes the article ID and another called STATE indicating the article was deleted successfully.

{
    "id": 96,
    "result": {
        "CONTENT": {
            "Status": "ACCESS GRANTED",
            "ArticleID": 3606
        },
        "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