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
Name | Type | Description |
---|---|---|
ArticleID | Integer, required | The ID of the article to delete |
CSUserName | String, required | The username of the iCM user deleting the article - 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 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"
}