Toggle menu

CSArticle

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 nothing
  • set 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

NameTypeDescription
getStringA comma separated list of properties to return
set.ArticleIDIntegerRequired. The ID of the article you'd like to get
set.DetaillevelIntegerOptional. The detail level to return, default 4
set.ExtensionDataReqdBooleanOptional. If true the article's extension data, the "article extras", will be returned in the ObjExtensionData property
set.GroupListStringOptional. 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.OverrideSecurityBooleanOptional. If true, article details (minus the article text) will be returned even if security checks fail
set.UserIDIntegerOptional. 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

NameTypeDescription
data.itemDataObjectThe 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 this.callWorkerMethod in an End Point parses the response, only returning the itemData in the result.

{
    "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

PropertyTypeDescription
ArchiveableBooleanTrue if the article has an archive date set
ArchiveDateDateTimeThe archive date, for example "2018-01-12T10:29:59Z"
ArchiveParentIDIntegerThe ID of the parent beneath with this article will be archived to
ArticleDisplayBooleanIf true the article is visible on the site
ArticleHeadingStringThe article heading text
ArticleIDInteger, RequiredThe article ID must be set when making a get request
ArticleIntroTextStringThe article introductory text
ArticleLevelIntegerThe 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
ArticleLinkTextStringThe article's "alternate link" text
ArticlePathStringA 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"
ArticlePathAsDelimListArrayThe ArticlePath example above would return ["21", "9", "1", "0"]
ArticleSummaryStringThe article summary text
ArticleTextStringThe article body text
ArticleTextAdditionalObjectAdditional text blocks, other than the body text, are returned as an object in the format {"BLOCKID": "<p>Text</p>"}
BestLinkTextStringThe best link text is the ArticleLinkText if present, if not the ArticleHeading will be returned
BoostedKeywordsStringA comma separated list of the article's boosted keywords
BoostValueIntegerThe boost value, -10 to +10
ChildArticleIDsStringA 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)
CreationDateDateTimeThe date and time on which the article was created, for example "2018-01-12T10:29:59Z"
DetailLevelIntegerThe 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
EndDateDateTimeThe date and time on which the article is scheduled to turn off, for example "2018-01-12T10:29:59Z"
ExtensionDataReqdBooleanIf true the article's extension data, the "article extras", will be returned in the ObjExtensionData property
FriendlyURLStringThe article's friendly URL
GroupListStringA 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
LastModifiedByUserIDIntegerThe ID of the user who last modified the article
LastModifiedDateDateTimeThe date and time on which the article was last modified, for example "2018-01-12T10:29:59Z"
MetaDataOptionalIDsStringA 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
ObjExtensionDataObjectThe article extension data. Will only be returned if ExtensionDataReqd is set as true. Returns null if there is none
OverrideSecurityBooleanIf true, article details (minus the article text) will be returned even if security checks fail
OwnerIDIntegerThe UserID of the article owner
OwnerTypeStringThe type of the article owner (will always be User)
ParentArticleIDIntegerThe ArticleID of the parent article
RelatedArticleIDsStringA comma separated list of ArticleIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED)
RelatedEventIDsStringA comma separated list of EventIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED)
RelatedFeatureIDsStringA comma separated list of FeatureIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED)
RelatedFormIDsStringA comma separated list of FormIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED)
RelatedForumIDsStringA comma separated list of ForumIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED)
RelatedLinkIDsStringA comma separated list of LinkIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED)
RelatedMediaIDsStringA comma separated list of MediaIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED)
RelatedMetaDataIDsStringA comma separated list of MetadataIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED)
RelatedPollIDsStringA comma separated list of PollIDs related to the current article. Only returned if the DetailLevel is set as 5 (ALL_PLUS_RELATED)
ReviewableBooleanTrue if a ReviewDate or ReviewInterval have been set
ReviewDateDateTimeThe 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"
ReviewIntervalIntegerThe number of hours between reviews
SecureUserGroupIDsStringA comma separated list of user group IDs, or an empty string if the article is not secured
StartDateDateTimeThe date and time from which the article will display on the site, for example "2018-01-12T10:29:59Z"
TemplateIDIntegerThe ID of the template the article is using
UserIDIntegerSpecifying 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
}

Last modified on October 27, 2022

Share this page

Facebook icon Twitter icon email icon

Print

print icon