Toggle menu

iCM_obj_articleGet

This module can be used to return information about an article with the supplied article ID. Various security checks and detail levels can be set. Requesting a template ID instead of an article returns and empty article structure for that template type which can then be used with iCM_obj_articleUpdate to create a new article.

Properties

NameTypeDescription
ArticleIDInteger, optionalSet this to retrieve the contents of an existing article
ArticleTemplateIDInteger, requiredThe ID of an installed template. Set this to return the default structure an article of this template type should use. The default structure has default dates, template ID and archiveable states set but is otherwise empty
UserIDInteger, optionalA website user ID. Article content will only be returned if this user has access to the article. Without a UserID only non-secure article content will be returned. It is also possible to override security
GroupListString, optionalA comma separated list of website user group IDs the supplied UserID is in to optimise performance (otherwise serves no purpose)
PreviewBoolean, optionalSet true of you need to retrieve an article in the preview table (in practice, work in progress articles)
DetailLevelString, optionalThe detail level returned, see below
OverrideSecurityBoolean, optionalDefault false - secure articles will not be returned unless a UserID with access is set. If true any article can be retrieved. If set the STATE response object includes information about the security override. Article body text blocks are never returned when overriding security unless OverrideSecurityText is also true
ACCESS GRANTED - The article wasn't secure
SECURE ACCESS GRANTED - The supplied user had access to the article anyway
SECURE ACCESS DENIED - The supplied user didn't have access but you've overridden the security
OverrideSecurityTextBoolean, optionalSet true to also return article body text when overriding security
GetExtensionDataBoolean, optionalSet true to return the article extra data. Default false
LockBoolean, optionalIf true the article will be locked to the supplied CSUserName until unlocked in iCM or updated using iCM_obj_articleUpdate
CSUserNameString, optionalAn iCM username to lock the article to while getting it
DatasourceString, optionalThe name of a datasource to retrieve data from. Defaults to the iCM datasource

Detail Level

Setting the detail level determines the level of detail returned by the get request. The default level is ALL. 

LevelDescription
IDRetrieves ArticleID only
SUMMARYRetrieves ArticleID, ArticleHeading, ArticleIntroText, TemplateID, ArticleDisplay ArticleLinkText and ArticleSummary
DETAILRetrieves all article data, except for ArticleText, ArticleTextAdditional and related content IDs
ALLRetrieves all article data, except for related content IDs
ALL_PLUS_RELATEDRetrieves all article data

Returns

NameTypeDescription
ArchiveableBooleanIf true the article will be archived on the ArchiveDate
ArchiveDateDateTime, Required if Archiveable:trueThe date on which the article will be archived. Dates in an ISO 8601 combined format, ie "2018-02-01T00:00:00Z"
ArchiveParentIDInteger, Required if Archiveable:trueThe parent beneath which the article will move on its archive date
ArticleDateDateTimeThe creation date and time of the article. This will always be "now" but needs to be supplied as an empty string
ArticleDisplayStringEither "on" or "off". Defaults to "on" (the article is visible on the site)
ArticleDisplayDateDateTimeThe date and time from which the article will display. Defaults to the article create date/time if left blank. Dates in an ISO 8601 combined format, ie "2018-02-01T00:00:00Z"
ArticleDisplayEDateDateTimeThe date and time until which the article will display. Defaults to 100 years in the future if left blank. Dates in an ISO 8601 combined format, ie "2018-02-01T00:00:00Z"
ArticleHeadingString, RequiredThe article's heading text
ArticleIDInteger, RequiredThe ID of the article to be updated. Set as 0 to create a new article
ArticleIntroTextStringThe article introductory text
ArticleParentIDInteger, RequiredThe article ID beneath which the article will be created/updated
ArticleReviewDateDateTimeThe date and time on which the article update is due (whether explicitly set or calculated form the ReviewInterval). Leave blank for no review. Dates in an ISO 8601 combined format, ie "2018-02-01T00:00:00Z"
ArticleReviewIntervalStringThe number of hours between reviews. Leave blank for no review
ArticleSummaryStringThe article summary text
ArticleTemplateIDInteger, RequiredThe ID of the template the article will use
ArticleTextStringThe article body text. HTML will be tidied, and unsupported HTML elements removed, following the standard behaviour of the article editor
ArticleTextAdditionalObjectAdditional text blocks, other than the body text, are returned as an object in the format {"BLOCKID": "<p>Text</p>"}
BoostedKeywordsStringA comma separated list of the article's boosted keywords
BoostValueIntegerThe search boost value, -10 to +10
ChildArticleIDsStringA comma separated list of child article IDs. If manual ordering of articles is enabled this property can be used to reorder the child articles. Otherwise ignored
ExtensionObjectThe article's extension data. This MUST be supplied if the article's template specifies extension data
FriendlyURLStringThe article's friendly URL
LocationIndexIntegerThe ordering position where this article will be inserted within its siblings below the parent article if manual of articles is enabled. Otherwise ignored
OwnerIDIntegerThe ID of an iCM user to set as the article owner. Defaults to the ID of the user creating the article (ie the user provided by the API Key)
RelatedArticleListStringA comma separated list of content IDs to relate to this article
RelatedEventListStringA comma separated list of content IDs to relate to this article
RelatedFeatureListStringA comma separated list of content IDs to relate to this article
RelatedFormListStringA comma separated list of content IDs to relate to this article
RelatedForumListStringA comma separated list of content IDs to relate to this article
RelatedLinkListStringA comma separated list of content IDs to relate to this article
RelatedMediaListStringA comma separated list of content IDs to relate to this article
RelatedMetaDataListStringA comma separated list of content IDs to relate to this article
RelatedPollListStringA comma separated list of content IDs to relate to this article
RelatedProductListStringA comma separated list of content IDs to relate to this article
RelatedRackListStringA comma separated list of content IDs to relate to this article
SecureUserListStringA comma separated list of site user group IDs this article is secured to

Example

function(params, credentials) {
    let getArticle = this.callWorkerMethod("icmapi", "iCM_obj_articleGet", {
        "attributes": {
            "ArticleID": 57,
            "UserID": 3,
            "GetExtensionData": true,
            "OverrideSecurity": true
        }
    });
    return getArticle;
}

{
    "id": 124,
    "result": {
        "CONTENT": {
            "ArticleDate": "Thu Jan 04 09:54:49 GMT 2024",
            "BoostedKeywords": "",
            "ArticleHeading": "My New Article",
            "ArticleIntroText": "",
            "ArticleReviewNotes": "",
            "ArticleSummary": "",
            "ArchiveDate": "Mon Jan 04 09:54:48 GMT 2123",
            "BestLinkText": "My New Article",
            "Archiveable": "No",
            "OwnerID": 21,
            "ArticleLinkText": "",
            "ArticleTemplateID": 1,
            "FriendlyURL": "",
            "ChildArticleIDs": "",
            "ArticleReviewInterval": 0,
            "ArticleID": 3608,
            "LastModifiedDate": "Thu Jan 04 09:54:49 GMT 2024",
            "ArticleUserID": 21,
            "BoostValue": 0,
            "ArticleDisplay": "on",
            "ArticleText": "",
            "ArticleReviewDate": "",
            "ArticleDisplaydate": "Thu Jan 04 09:54:48 GMT 2024",
            "ArticleDisplayedate": "Mon Jan 04 09:54:48 GMT 2123",
            "ArticleParentID": 3424,
            "ArchiveParentID": "",
            "OwnerType": "User"
        },
        "STATE": {
            "Status": "ACCESS GRANTED",
            "Message": ""
        }
    },
    "jsonrpc": "2.0"
}

Last modified on 4 January 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon