The CSArticle class includes methods for the retrieval of a particular article's details.
Note that it is not possible to use CSArticle to create, update or delete an article. This functionality is provided by making direct iCM requests using the ColdFusion API's iCM_obj_articleUpdate.
The ArticleID must be provided before making a get request to return the details of an article. Use TemplateID with get to return an empty article instance of that template type.
Use CSArticleMultiple to return multiple articles or to request an article using properties other than ArticleID.
Methods
Parameters must use the get-set structure described in the introduction - Java API (CSObjects).
get a string (comma separated) that lists the properties whose values should be returned, an asterisk to indicate that all properties should be returned, or an empty string to return nothingset the properties which should be set before the specified method is performed
CSArticle_get
Retrieves the details of an article. A secured article will return a CSSecurityException if no UserID is set with the request. A CSSecurityException will also be thrown if a UserID is supplied that doesn't have access to the article (or an ancestor article). For performance reasons, do not supply a UserID if the articles you are interested in are not secure. Performance can be improved by providing the GroupList alongside the UserID, if known. Security can be overridden using OverrideSecurity.
Request Parameters
Name | Type | Description |
---|---|---|
get | String | A comma separated list of properties to return |
set.ArticleID | Integer | Required. The ID of the article you'd like to get |
set.Detaillevel | Integer | Optional. The detail level to return, default 4 |
set.ExtensionDataReqd | Boolean | Optional. If true the article's extension data, the "article extras", will be returned in the ObjExtensionData property |
set.GroupList | String | Optional. A comma separated list of website user group IDs. Set in conjunction with UserID (otherwise serves no purpose) to improve performance, but assumes you know the user groups your user is a member of |
set.OverrideSecurity | Boolean | Optional. If true, article details (minus the article text) will be returned even if security checks fail |
set.UserID | Integer | Optional. Specifying UserID in combination with ArticleID will only return the requested article details if the user passes any security set on the article. If the article is not secure, this has no effect. If the article is secure and the UserID does not have access, a security exception is thrown |
{
"get":"",
"set": {
"ArticleID": 21,
"DetailLevel": 5,
"ExtensionDataReqd": true,
"GroupList": "1,2,3",
"OverrideSecurity": true,
"UserID": 1
}
}
Response
Name | Type | Description |
---|---|---|
data.itemData | Object | The properties of the get request |
"result": {
"data": {
"itemData": {}
},
"success": true
}
Example
Request:
function(params, credentials) {
var getArticle = this.callWorkerMethod("icmapi", "CSArticle_get", {
"get": "ArticleHeading,ObjExtensionData",
"set": {
"ArticleID": 1,
"ExtensionDataReqd": true,
"DetailLevel": 5
}
});
return getArticle;
}
Response:
Note that using
{
"id": 89,
"result": {
"_ItemClass": "CSArticle",
"ObjExtensionData": {
"Type": "FORM_CHILLHOMEX",
"Label": "ARTICLEEXTRA1",
"ObjectData": {
"HOMEPANELSETTING": "USEPICKER",
"HOMEBLOCKSROWS": "1",
"HOMEPANELARTICLES": "3",
"HOMEPANELDISPLAY": "BLOCKS",
"ENGLISHARTICLEID": "",
"SHOWBREADCRUMB": "No",
"SHOWCAROUSEL": "No",
"SHOWHEADING": "Yes"
}
},
"ArticleHeading": "Welcome to the GOSS Documentation Site"
},
"jsonrpc": "2.0"
}
Properties
Property | Type | Description |
---|---|---|
Archiveable | Boolean | True if the article has an archive date set |
ArchiveDate | DateTime | The archive date, for example "2018-01-12T10:29:59Z" |
ArchiveParentID | Integer | The ID of the parent beneath with this article will be archived to |
ArticleDisplay | Boolean | If true the article is visible on the site |
ArticleHeading | String | The article heading text |
ArticleID | Integer, Required | The article ID must be set when making a get request |
ArticleIntroText | String | The article introductory text |
ArticleLevel | Integer | The level of the article in the tree. The top-level is level zero. With a homepage at level zero, its child article are level 1, their child articles level 2 etc |
ArticleLinkText | String | The article's "alternate link" text |
ArticlePath | String | A list of article IDs, from the current to the site homepage. For example, if our current article has an ID of 21, its parent 9, its grand-parent (the site homepage) 1. the path would be "21,9,1,0" |
ArticlePathAsDelimList | Array | The ArticlePath example above would return ["21", "9", "1", "0"] |
ArticleSummary | String | The article summary text |
ArticleText | String | The article body text |
ArticleTextAdditional | Object | Additional text blocks, other than the body text, are returned as an object in the format {"BLOCKID": "<p>Text</p>"} |
BestLinkText | String | The best link text is the ArticleLinkText if present, if not the ArticleHeading will be returned |
BoostedKeywords | String | A comma separated list of the article's boosted keywords |
BoostValue | Integer | The boost value, -10 to +10 |
ChildArticleIDs | String | A comma separated list of child article IDs. Work in progress articles are prefixed with a P (note, their IDs will change when they are made live) |
CreationDate | DateTime | The date and time on which the article was created, for example "2018-01-12T10:29:59Z" |
DetailLevel | Integer | The level of detail returned. One of: 1 - LEVEL_ID: ArticleID only 2 - LEVEL_SUMMARY: ArticleID, ArticleHeading, ArticleIntroText, TemplateID, ArticleDisplay, ArticleLinkText and ArticleSummary 3 - LEVEL_DETAIL: All article data, except for ArticleText, ArticleTextAdditional and related content IDs 4 - LEVEL_ALL: All article data, except for related content IDs 5 - LEVEL_ALL_PLUS_RELATED: All article data The default level is 4 |
EndDate | DateTime | The date and time on which the article is scheduled to turn off, for example "2018-01-12T10:29:59Z" |
ExtensionDataReqd | Boolean | If true the article's extension data, the "article extras", will be returned in the ObjExtensionData property |
FriendlyURL | String | The article's friendly URL |
GroupList | String | A comma separated list of website user group IDs. Set in conjunction with UserID (otherwise serves no purpose) to improve performance, but assumes you know the user groups your user is a member of |
LastModifiedByUserID | Integer | The ID of the user who last modified the article |
LastModifiedDate | DateTime | The date and time on which the article was last modified, for example "2018-01-12T10:29:59Z" |
MetaDataOptionalIDs | String | A comma separated list of metadata IDs. This property will only have a value when an article is returned using CSArticleMultiple. It will contain the metadata IDs related to the current article that match those set in the MetaDataOptionalIDs call |
ObjExtensionData | Object | The article extension data. Will only be returned if ExtensionDataReqd is set as true. Returns null if there is none |
OverrideSecurity | Boolean | If true, article details (minus the article text) will be returned even if security checks fail |
OwnerID | Integer | The UserID of the article owner |
OwnerType | String | The type of the article owner (will always be User) |
ParentArticleID | Integer | The ArticleID of the parent article |
RelatedArticleIDs | String | A comma separated list of ArticleIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED) |
RelatedEventIDs | String | A comma separated list of EventIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED) |
RelatedFeatureIDs | String | A comma separated list of FeatureIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED) |
RelatedFormIDs | String | A comma separated list of FormIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED) |
RelatedForumIDs | String | A comma separated list of ForumIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED) |
RelatedLinkIDs | String | A comma separated list of LinkIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED) |
RelatedMediaIDs | String | A comma separated list of MediaIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED) |
RelatedMetaDataIDs | String | A comma separated list of MetadataIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED) |
RelatedPollIDs | String | A comma separated list of PollIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED) |
Reviewable | Boolean | True if a ReviewDate or ReviewInterval have been set |
ReviewDate | DateTime | The date and time on which the article update is due (whether explicitly set or calculated form the ReviewInterval), for example "2018-01-12T10:29:59Z" |
ReviewInterval | Integer | The number of hours between reviews |
SecureUserGroupIDs | String | A comma separated list of user group IDs, or an empty string if the article is not secured |
StartDate | DateTime | The date and time from which the article will display on the site, for example "2018-01-12T10:29:59Z" |
TemplateID | Integer | The ID of the template the article is using |
UserID | Integer | Specifying UserID in combination with ArticleID will only return the requested article details if the user passes any security set on the article. If the article is not secure, this has no effect. If the article is secure and the UserID does not have access, a security exception is thrown |
{
"_ItemClass": "CSArticle",
"Archiveable": false,
"ArchiveDate": "2109-05-27T11:33:27Z",
"ArchiveParentID": -1,
"ArticleDisplay": true,
"ArticleHeading": "Welcome to the GOSS Documentation Site",
"ArticleID": 1,
"ArticleIntroText": "",
"ArticleLevel": 0,
"ArticleLinkText": "Home",
"ArticlePath": "1,0",
"ArticlePathAsDelimList": ["1", "0"],
"ArticleSummary": "",
"ArticleText": "<p>Some text</p>",
"ArticleTextAdditional": null,
"BestLinkText": "Home",
"BoostedKeywords": "",
"BoostValue": 0,
"ChildArticleIDs": "4421,7557,7558,6591,7350,3130,3,2501,4,3101,7566,3102,2,6501,7651,7725",
"CreationDate": "2010-05-27T11:33:28Z",
"DetailLevel": 5,
"EndDate": "2109-05-27T11:33:27Z",
"ExtensionDataReqd": true,
"FriendlyURL": null,
"GroupList": "",
"LastModifiedByUserID": 57,
"LastModifiedDate": "2022-06-27T14:07:58Z",
"MetaDataOptionalIDs": null,
"ObjExtensionData": {
"Type": "FORM_CHILLHOMEX",
"Label": "ARTICLEEXTRA1",
"ObjectData": {
"HOMEPANELSETTING": "USEPICKER",
"HOMEBLOCKSROWS": "1",
"HOMEPANELARTICLES": "3",
"HOMEPANELDISPLAY": "BLOCKS",
"ENGLISHARTICLEID": "",
"SHOWBREADCRUMB": "No",
"SHOWCAROUSEL": "No",
"SHOWHEADING": "Yes"
}
},
"OverrideSecurity": false,
"OwnerID": 1,
"OwnerType": "User",
"ParentArticleID": 0,
"RelatedArticleIDs": "7567,7568,7569,7570,7571,7572,7573,7574",
"RelatedEventIDs": "",
"RelatedFeatureIDs": "G89,G94,G104",
"RelatedFormIDs": "",
"RelatedForumIDs": "",
"RelatedLinkIDs": "",
"RelatedMediaIDs": "",
"RelatedMetaDataIDs": "13382",
"RelatedPollIDs": "",
"Reviewable": false,
"ReviewDate": null,
"ReviewInterval": 0,
"SecureUserGroupIDs": "",
"StartDate": "2010-05-27T11:33:27Z",
"TemplateID": 42,
"UserID": 0
}