Update content by version ID

patch

/km/api/v1/content/{versionId}

This method will update values of for specified content version without incrementing version.

The example URIs for this method are as follows:

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

    The request returns updated ContentBO.

  • NOTE:Currently, this service supports HTTP PATCH through HTTP header parameter X-HTTP-Method-Override.

    Client will have call POST with header X-HTTP-Method-Override value PATCH.

Client may send one or multiple values from following to update in request.

  • ContentUpdateBO.owner - For assigning new owner to Content version.

  • ContentUpdateBO.articleStatus - For assigning articleStatus for Content version.

Response Errors

The possible error responses for this method are as follows:

  • OKDOM-GEN0001

    The error occurs in any of the following cases:

    • No data found for new values.
    • No content is found by the specified Version ID.
  • $ERROR.Content.INACTIVE_ARTICLE_STATUS_ASSIGNED$

    The error occurs when the ContentUpdateBO.articleStatus specified with the request is inactive.

  • $ERROR.Content.ARTICLE_STATUS_FEATURE_NOT_AVAILABLE$

    The error occurs when a ContentUpdateBO.articleStatus is specified with the request and the article status feature is not available.

Request

Supported Media Types
Path Parameters
Body ()
The new value object.
Root Schema : ContentUpdate
Type: object
Title: ContentUpdate
Show Source
Nested Schema : ArticleStatusKey
Type: object
Title: ArticleStatusKey
Show Source
Nested Schema : UserKey
Type: object
Title: UserKey
Show Source
Back to Top

Response

Supported Media Types

200 Response

OK.
Body ()
Root 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 update values of a specified content version without incrementing the version:

curl -X PATCH "https://<IM_REST_API_HOST>/km/api/latest/content/{versionId}" -u "<username:password>" -H "Accept: application/json" -H "Content-Type: application/json" -d "@<FilePath/RequestBody.json>"

Example of Request Body

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

{
  "owner" : {
    "recordId" : "RECORDID_VALUE"
  },
  "articleStatus" : {
    "referenceKey" : "REFERENCEKEY_VALUE"
}
}

Example of Response Body

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

{
  "recordId": "27BA7D089309424D86657C14C4B637A6",
  "versionId": "3B5049724B604F21A4F2235E142BA46F",
  "documentId": "FAQ1",
  "title": "Q query  Testing --update",
  "version": "2.0",
  "answerId": 1000018,
  "locale": {
    "recordId": "en_US"
  },
  "dateModified": "2018-11-26T12:46:11+0530",
  "links": [
    {
      "rel": "canonical",
      "href": "https://<IM_REST_API_HOST>/km/api/latest/content/27BA7D089309424D86657C14C4B637A6",
      "mediaType": "application/json, application/xml",
      "method": "GET"
    },
    {
      "rel": "collection",
      "href": "https://<IM_REST_API_HOST>/km/api/latest/content",
      "mediaType": "application/json, application/xml",
      "method": "GET",
      "profile": "https://<IM_REST_API_HOST>/km/api/latest/metadata-catalog/content"
    }
  ]
}
Back to Top