Get history of content by doc ID

get

/km/api/v1/content/docId/{docId}/history

This method returns list of ContentHistory objects associated with all the versions of the LATEST version of the document specified by document Id. User can override the default user locale by passing the 'langpref' URL parameter. As a note, the URL parameter, 'contentState', will be ignored. A ContentHistory Object represents an action performed on a given document.

This service accepts action filter list to filter history by action type. To filter by multipe values filter values should be separted by colon (:).

Possible values for this parameter are :

  • CREATED
  • EDITED
  • GSR_EDITED
  • APPROVED
  • REJECTED
  • PUBLISHED
  • PENDING_PUBLISHED
  • GSR_PUBLISHED
  • UNPUBLISHED
  • LOCALIZED
  • REVERTED
  • MOD_CATEGORY
  • MOD_SITE_VIS
  • MOD_USER_VIS
  • LOCALIZATION_REQUESTED
  • LOCALIZATION_CLEARED
  • METADATA_CHANGED
  • WORKFLOWCOMMENT_ADDED

NOTE:Values for this parameter are case sensetive. If this parameter is not passed unfiltered results will be returned.

Example URIs

The example URIs for this method are as follows:

  • http://<IM_REST_API_HOST>/km/api/latest/content/docId/{docId}/history

    The request returns list of ContentHistory objects associated with the specified document.

  • http://<IM_REST_API_HOST>/km/api/latest/content/docId/{docId}/history?action=EDITED:CREATED

    The request returns list of ContentHistory objects associated with the specified content object.

Request

Supported Media Types
Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

OK.
Body ()
Root Schema : ResultList ContentHistory
Type: object
Title: ResultList ContentHistory
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : ContentHistory
Type: object
Title: ContentHistory
Show Source
Nested Schema : ContentKey
Type: object
Title: ContentKey
Show Source
Nested Schema : allTranslations
Type: array

This field will return list of all translated content that the user can view

This field will only be populated if allTranslations query parameter is passed in with value true.

Show Source
Nested Schema : ArticleStatusKey
Type: object
Title: ArticleStatusKey
Show Source
Nested Schema : LocaleKey
Type: object
Title: LocaleKey
Show Source
Nested Schema : DataForm
Type: object
Title: DataForm
Show Source
Nested Schema : AggregateFormResults
Type: object
Title: AggregateFormResults
Show Source
Nested Schema : schemaAttributes
Type: array

This field will return list of schema attributes associated with the content type of this content.

This field will only be populated if additionalFields query parameter is passed in with value schemaAttributes.

Show Source
Nested Schema : questions
Type: array
To Many Relationship to Question
Show Source
Nested Schema : UserKey
Type: object
Title: UserKey
Show Source
Nested Schema : views
Type: array
To Many Relationship to View
Show Source
Nested Schema : DataFormQuestion
Type: object
Title: DataFormQuestion
Show Source
Nested Schema : answers
Type: array
To Many Relationship to Answer
Show Source
Nested Schema : DataFormKey
Type: object
Title: DataFormKey
Show Source
Nested Schema : DataFormAnswer
Type: object
Title: DataFormAnswer
Show Source
Nested Schema : DataFormQuestionKey
Type: object
Title: DataFormQuestionKey
Show Source
Nested Schema : ViewKey
Type: object
Title: ViewKey
Show Source
Nested Schema : questions
Type: array
To Many Relationship to AggregateQuestionResult
Show Source
Nested Schema : AggregateQuestionResult
Type: object
Title: AggregateQuestionResult
Show Source
Nested Schema : answers
Type: array
To Many Relationship to AggregateAnswerResult
Show Source
Nested Schema : AggregateAnswerResult
Type: object
Title: AggregateAnswerResult
Show Source
Nested Schema : SchemaAttribute
Type: object
Title: SchemaAttribute
Show Source
Nested Schema : children
Type: array
List of child nodes of the current element
Show Source
Nested Schema : localizedAttributes
Type: array
List of LocalizedAttributes of this SchemaAttribute name and description in various Locales
Show Source
Nested Schema : schemaAttributeUserGroupList
Type: array
List of user groups that can be used to secure this attribute. This should be a subset of the list of user groups assigned to the ContentType
Show Source
Nested Schema : LocalizedAttributes
Type: object
Title: LocalizedAttributes
Show Source
Nested Schema : SchemaAttributeUserGroup
Type: object
Title: SchemaAttributeUserGroup
Show Source
Nested Schema : UserGroupKey
Type: object
Title: UserGroupKey
Show Source
Back to Top

Examples

The following example shows how to get a list of ContentHistory objects associated with all the versions of the latest version of the document specified by document Id:

curl -X GET "https://<IM_REST_API_HOST>/km/api/latest/content/docId/{docId}/history" -u "<username:password>" -H "Accept: application/json" -H "Content-Type: application/json"

Example of Response Body

The following shows an example of the response body in JSON format.

{
  ""items"": [
    {
      ""content"": {
        ""recordId"": ""27BA7D089309424D86657C14C4B637A6"",
        ""versionId"": ""30EB204D1ED04E57A912F0289816D68B"",
        ""documentId"": ""FAQ1"",
        ""title"": ""Q query  Testing --update2"",
        ""version"": ""3.0"",
        ""answerId"": 1000018,
        ""locale"": {
          ""recordId"": ""en_US""
        },
        ""dateModified"": ""2018-11-13T15:21:22+0530"",
        ""links"": [
          {
            ""rel"": ""canonical"",
            ""href"": ""https://<IM_REST_API_HOST>/km/api/latest/content/27BA7D089309424D86657C14C4B637A6"",
            ""mediaType"": ""application/json, application/xml"",
            ""method"": ""GET""
          }
        ]
      },
      ""action"": ""Edited"",
      ""dateAdded"": ""2018-11-13T15:21:22+0530"",
      ""dateModified"": ""2018-11-13T15:21:22+0530"",
      ""userInformationId"": 2,
      ""userName"": ""Default Administrator"",
      ""recordId"": ""5676AEA24A1F49BFA6893384B38EB4D5"",
      ""links"": [
        {
          ""rel"": ""canonical"",
          ""href"": ""https://<IM_REST_API_HOST>/km/api/latest/content/27BA7D089309424D86657C14C4B637A6/history/5676AEA24A1F49BFA6893384B38EB4D5"",
          ""mediaType"": ""application/json, application/xml"",
          ""method"": ""GET""
        }
      ]
    },
    {
      ""content"": {
        ""recordId"": ""27BA7D089309424D86657C14C4B637A6"",
        ""versionId"": ""3B5049724B604F21A4F2235E142BA46F"",
        ""documentId"": ""FAQ1"",
        ""title"": ""Q query  Testing --update"",
        ""version"": ""2.0"",
        ""answerId"": 1000018,
        ""locale"": {
          ""recordId"": ""en_US""
        },
        ""dateModified"": ""2018-11-13T15:21:22+0530"",
        ""links"": [
          {
            ""rel"": ""canonical"",
            ""href"": ""https://<IM_REST_API_HOST>/km/api/latest/content/27BA7D089309424D86657C14C4B637A6"",
            ""mediaType"": ""application/json, application/xml"",
            ""method"": ""GET""
          }
        ]
      },
      ""action"": ""Published"",
      ""dateAdded"": ""2018-11-13T15:13:13+0530"",
      ""dateModified"": ""2018-11-13T15:13:13+0530"",
      ""userInformationId"": 2,
      ""userName"": ""Default Administrator"",
      ""recordId"": ""E33ABEFE25B24A7BAA01EC23AE4A1F45"",
      ""links"": [
        {
          ""rel"": ""canonical"",
          ""href"": ""https://<IM_REST_API_HOST>/km/api/latest/content/27BA7D089309424D86657C14C4B637A6/history/E33ABEFE25B24A7BAA01EC23AE4A1F45"",
          ""mediaType"": ""application/json, application/xml"",
          ""method"": ""GET""
        }
      ]
    },
}
  ],
  ""hasMore"": false,
  ""limit"": 20,
  ""offset"": 0,
  ""links"": [
    {
      ""rel"": ""canonical"",
      ""href"": ""https://<IM_REST_API_HOST>/km/api/latest/content/docId/FAQ1/history?limit=20&offset=0&_=1543215215508"",
      ""mediaType"": ""application/json, application/xml"",
      ""method"": ""GET""
    }
  ],
  ""count"": 2
}	
Back to Top