Add aqi

post

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

This method adds the Article Quality Index (AQI) score to a given content version.

This API needs both the userToken and the integrationUserToken in kmauthtoken. The API user must have the required permissions to access the API. The account user (agent) must have the 'Add Aqi' privilege for the Content Type of the document in the console role. Web users can't access this API.

In the request body, the AQI score must be between -128 and 127. Providing a comment is optional and it is limited to 4000 characters.

Response Errors

The possible error responses for this method are as follows:

  • OKDOM-GEN0001

    The error occurs when the specified versionId parameter is invalid.

  • OK-SEC0001

    The error occurs when:

    • The user(coach) does not have the view privileges for the article.
    • The user(coach) is not an Account user.

  • OK-GEN0036

    The error occurs when the aqi score in the request body is either null or out of range of the allowed integer values from -128 to 127.

  • OK-GEN0007

    The error occurs when the comments in the request body exceed permitted 4000 characters.

  • OK-GEN0026

    This error occurs when API user does not have permission to access the requested API.

Example URIs

The example URIs for this method are as follows:

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

    The request returns the added ArticleQualityIndex object to the specified content version.

Request

Supported Media Types
Path Parameters
Body ()
The new content aqi
Root Schema : ArticleQualityIndexKey
Type: object
Title: ArticleQualityIndexKey
Show Source
Nested Schema : UserKey
Match All
Show Source
Nested Schema : Singular Resource
Type: object
Title: Singular Resource
Oracle base singular resource schema definition.
Show Source
Nested Schema : UserKey-allOf[1]
Type: object
Show Source
Back to Top

Response

Supported Media Types

201 Response

Created.
Body ()
Root Schema : ArticleQualityIndexKey
Type: object
Title: ArticleQualityIndexKey
Show Source
Nested Schema : UserKey
Match All
Show Source
Nested Schema : Singular Resource
Type: object
Title: Singular Resource
Oracle base singular resource schema definition.
Show Source
Nested Schema : UserKey-allOf[1]
Type: object
Show Source
Back to Top

Examples

The following example shows how to add the AQI score to a given content version by submitting a post request on the REST resource using cURL.

cURL Command

Command: curl -X "POST" "http://<IM_REST_API_HOST>/km/api/latest/content/versions/{versionId}/aqi"

Example of Request Header

The following shows an example of the request header.

-H "kmauthtoken: {\"siteName\":\"ORACLE_KNOWLEDGE\",\"integrationUserToken\":\"\"+eCJYkxKwj5HUaIiJYun0/TpatwT1LmtcsF05W33xnEojifV/AsLDj9RpN0lKuorTMNKeSE1tgC7svVL+BzntqDON4KiM1HFlpxvXEUCB0P2w0Xrs75McygqxdVaDSE9",\"userToken\":\"UoyWTKRG4RpyJCH4Wqjzht2iYUrsDdk5ir+3IpwEkxcwajJkGR9OGSQBTANQVGW0iVT9MFeDzqL+RYdgfzGSK+h5QzDFIDM+rDLgdKeEE19ljWFm3zMCF+kgYp/dJ/Yq5V7Re+aDXqHg6YkHfvprFA==\"}" \
-H "Accept: application/json"

Example of Request Body

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

{
  "aqi" : "55",
  "comments" : "COMMENTS_VALUE"
}

Example of Response Body

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

{
  "recordId" : "RECORDID_VALUE",
  "aqi" : "55",
  "comments" : "COMMENTS_VALUE",
  "dateAdded" : "149250275-05-03T01:32:10-0600",
  "coach" : {
    "recordId" : "RECORDID_VALUE",
    "name" : "NAME_VALUE",
    "email" : "EMAIL_VALUE",
    "externalId" : 1587554420000,
    "externalType" : "EXTERNALTYPE_VALUE",
    "links" : [ {
      "rel" : "canonical",
      "href" : "http://<IM_REST_API_HOST>/km/api/{version}/{resourceURI}",
      "mediaType" : "application/json, application/xml",
      "templated" : true,
      "method" : "GET",
      "profile" : "http://<IM_REST_API_HOST>/km/api/{version}/metadata-catalog/{resourceName}"
    } ]
  }
}
Back to Top