Find all
/km/api/v1/contentRecommendations
This method returns a list of ContentRecommendation objects from the Oracle Knowledge Repository.
Only those ContentRecommendations which active user can view will be returned.
For account users the list will only include ContentRecommendations that contains at least one view assigned to the user.
This resource supports the orderBy request parameter, which allows you to sort the returned list of ContentRecommendation objects.
You can find different values to use with the orderBy parameter in the schema and catalog information of the resource. To get the schema and catalog information, use GET method with the mediaType value as 'application/schema+json'
in the HTTP request.
The example URI to get schema and catalog of the resource is as follows:
http://<IM_REST_API_HOST>/km/api/latest/metadata-catalog/contentRecommendations
Example URIs
The example URIs for this method are as follows:
http://<IM_REST_API_HOST>/km/api/latest/contentRecommendations
The request returns a paginated list of ContentRecommendation objects from the Oracle Knowledge Repository.
http://<IM_REST_API_HOST>/km/api/latest/contentRecommendations?mode=FULL
The request returns a paginated list of ContentRecommendation objects in the FULL mode. By default, the Content objects in the KEY mode for the published version of the content appear nested with the response.
http://<IM_REST_API_HOST>/km/api/latest/contentRecommendations?mode=FULL&contentState=LATESTVALID
The request returns a paginated list of ContentRecommendation objects in the FULL mode. The contentKey objects for the latest valid version of the content appear nested in the ContentRecommendation objects.
Valid values for contentState parameter are PUBLISHED and LATESTVALID.
Response Errors
The possible error responses for this method are as follows:
- OKDOM-GEN0006
The error is displayed when you specify any invalid value as contentState parameter with the HTTP service request.
The valid values for contentState parameter are: PUBLISHED, LATEST, and LATESTVALID.
- OKDOM-CONT0121
The error is displayed when you specify LATEST as the contentState value along with the HTTP Service request.
The contentRecommendations resource does not allow the LATEST as contentState parameter value.
Find by query
Supported Media Types: 'application/json', 'application/xml'
This method returns a list of ContentRecommendation objects that match the specified criteria.
Only those ContentRecommendations which active user can view will be returned.
For account users the list will only include ContentRecommendations that contains at least one view assigned to the user.
This resource supports the orderBy request parameter, which allows you to sort the returned list of ContentRecommendation objects.
You can find different values to use with the orderBy parameter in the schema and catalog information of the resource. To get the schema and catalog information, use GET method with the mediaType value as 'application/schema+json'
in the HTTP request.
The example URI to get schema and catalog of the resource is as follows:
http://<IM_REST_API_HOST>/km/api/latest/metadata-catalog/contentRecommendations
Example URIs
The example URIs for this method are as follows:
http://<IM_REST_API_HOST>/km/api/contentRecommendations?q=dateAdded after {input date}&mode=FULL
The request returns a list of ContentRecommendation objects in FULL mode. The list contains the objects created after the input date mentioned with the request.
http://<IM_REST_API_HOST>/km/api/contentRecommendations?q=content.documentId eq 'FAQ34'&mode=FULL
The request returns a list of ContentRecommendation objects in FULL mode. The list contains ContentRecommendation objects that are related to the Content object having the specified document ID.
http://<IM_REST_API_HOST>/km/api/contentRecommendations?q=filterMode.contentState eq 'PUBLISHED'
The contentState parameter can not be used in a criteria query, use filterMode.contentState parameter instead. Valid values are PUBLISHED and LATESTVALID.
Response Errors
The possible error responses for this method are as follows:
- OKDOM-GEN0006
This error is displayed when you specify any invalid value as contentState parameter with the HTTP service request. The valid values are: PUBLISHED, LATEST, and LATESTVALID.
- OKDOM-CONT0121
This error is displayed when you specify LATEST as the contentState value along with the HTTP Service request.
The contentRecommendations resource does not allow the LATEST as contentState parameter value.
The following table describes the query parameters for this resource.
Parameter | Queryable | Sortable | Type | Description |
---|---|---|---|---|
recordId | Y | Y | 'type' : 'string' | The unique identifier of the contentRecommendation object. |
caseNumber | Y | Y | 'type' : 'string' | The incidentId to locate contentRecommendation object associated with a specific incident. |
comments | Y | Y | 'type' : 'string' | The comment from the user who recommended the content. |
completedByUserId | Y | Y | 'type' : 'string' | The userId associated with the completed content recommendations. To have a completedByUserId, the ContentRecommendation object must have status values as follows:
|
completedByUserName | Y | Y | 'type' : 'string' | The unique identifier of the user who added content recommendation. |
dateAdded | Y | Y | 'type' : 'string', 'format' : 'date-time' | The date when the ContentRecommendation object was added. |
dateModified | Y | Y | 'type' : 'string', 'format' : 'date-time' | The date when the ContentRecommendation object was last modified. |
priority | Y | Y | 'enum' : ['LOW', 'MEDIUM', 'HIGH'] | The optional priority for the recommendation. The valid values are: LOW, MEDIUM, and HIGH. |
requestedByUserId | Y | Y | 'type' : 'string' | The unique identifier of the user who recommended the content. |
requestedByUserName | Y | Y | 'type' : 'string' | The name of user who requested the content. |
status | Y | Y | 'enum' : ['NEW', 'UNDER_REVIEW', 'REJECTED_DUPLICATE', 'REJECTED_NOT_ENOUGH_INFO', 'REJECTED_UNSUITABLE', 'REJECTED_OTHER', 'CONTENT_CREATED', 'CONTENT_MODIFIED'] | The status of the recommendation. The valid status values are the following:
|
statusComments | Y | Y | 'type' : 'string' | The comment added by author about the status of the ContentRecommendation object. |
title | Y | Y | 'type' : 'string' | The title assigned to the recommendation by the user. |
contentType | Y | N | '$ref' : '#/definitions/ContentTypeKey' | The content type to which a recommendation is added. |
content | Y | N | '$ref' : '#/definitions/ContentKey' | The content in the Oracle Knowledge Repository to which the user recommends modification. |
locale | Y | N | '$ref' : '#/definitions/LocaleKey' | The locale code of the content. For example, en_US is the locale for English (United States). |
views | Y | N | '$ref' : '#/definitions/ListViewKey' | The list of views to which the recommendation is associated. |
categories | Y | N | '$ref' : '#/definitions/ListCategoryKey' | The list of content categories to which the recommendation is associated. |
Request
-
limit: integer
This parameter restricts the number of resources returned inside the resource collection. If the limit exceeds the resource count then the framework will only return the available resources.
-
mode:
This parameter defines amount of information to be included in the returned resources - KEY is the one that has least information (and hence performs better) and FULL is the one that has most information.Allowed Values:
[ "KEY", "DATA", "EXTENDED", "FULL" ]
-
offset: integer
Used to define the starting position of the resource collection. If offset exceeds the resource count then no resources are returned. Default value is 0.
-
orderBy: string
This parameter orders a resource collection based on the specified attributes. The parameter value is a comma-separated string of attribute names, each optionally followed by a colon and 'asc' or 'desc'. Specify 'asc' for ascending and 'desc' for descending. The default value is 'asc'. For example, ?orderBy=field1:asc,field2:desc.
-
q: string
Value for this parameter should be Oracle Knowledge Q query - see the 'Getting Started' documentation ('Querying' page) of this operation and documentation for Q query.
Response
- application/json
- application/xml
200 Response
object
ResultList ContentRecommendationData
-
allOf
Collection Paging Resource
Title:
Collection Paging Resource
Oracle base collection resource schema definition. -
object
ResultList ContentRecommendationData-allOf[1]
Collection Paging Resource
-
allOf
Base Collection Resource
Title:
Base Collection Resource
Oracle base collection resource schema definition. -
object
Collection Paging Resource-allOf[1]
Base Collection Resource
-
object
Singular Resource
Title:
Singular Resource
Oracle base singular resource schema definition. -
object
Base Collection Resource-allOf[1]
object
Singular Resource
object
-
count(optional):
integer
Number of resource instances returned in the current range.
-
hasMore(optional):
boolean
Boolean value that is set to true if more resources are available on the server than the subset returned in current page.
-
limit(optional):
integer
Actual paging size used by the server.
-
offset(optional):
integer
Offset value used in the current page.
-
totalResults(optional):
integer
Total count of the resource instances, including both the instances in the current range and the instances on the server that satisfy the request.
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
object
-
href:
string
URI [RFC3986] or URI Template [RFC6570]. If the value is set to URI Template, then the "templated" property must be set to true.
-
mediaType(optional):
string
Media type, as defined by RFC 2046, describing the link target.
-
method(optional):
string
HTTP method for requesting the target of the link.
-
profile(optional):
string
Link to the metadata of the resource, such as JSON-schema, that describes the resource expected when dereferencing the target resource..
-
rel:
string
Name of the link relation that, in addition to the type property, can be used to retrieve link details. For example, href or profile.
-
templated(optional):
boolean
Boolean flag that specifies that "href" property is a URI or URI Template. If the property is a URI template, set this value to true. By default, this value is false.
object
-
object
Singular Resource
Title:
Singular Resource
Oracle base singular resource schema definition. -
object
ContentRecommendationKey-allOf[1]
object
-
recordId(optional):
string
The unique identifier of the contentRecommendation object.
object
-
caseNumber(optional):
string
The incidentId to locate contentRecommendation object associated with a specific incident.
-
comments(optional):
string
The comment from the user who recommended the content.
-
completedByUserId(optional):
string
The userId associated with the completed content recommendations.
To have a completedByUserId, the ContentRecommendation object must have status values as follows:
- CONTENT_CREATED
- CONTENT_MODIFIED
- REJECTED_DUPLICATE
- REJECTED_NOT_ENOUGH_INFO
- REJECTED_UNSUITABLE
- REJECTED_OTHER
-
completedByUserName(optional):
string
The unique identifier of the user who added content recommendation.
-
dateAdded(optional):
string(date-time)
The date when the ContentRecommendation object was added.
-
dateModified(optional):
string(date-time)
The date when the ContentRecommendation object was last modified.
-
localizedPriority(optional):
string
The localized priority for the recommendation.
-
localizedStatus(optional):
string
The localized status of the recommendation.
-
priority(optional):
Allowed Values:
[ "LOW", "MEDIUM", "HIGH" ]
The optional priority for the recommendation. The valid values are: LOW, MEDIUM, and HIGH.
-
requestedByUserId(optional):
string
The unique identifier of the user who recommended the content.
-
requestedByUserName(optional):
string
The name of user who requested the content.
-
status(optional):
Allowed Values:
[ "NEW", "UNDER_REVIEW", "REJECTED_DUPLICATE", "REJECTED_NOT_ENOUGH_INFO", "REJECTED_UNSUITABLE", "REJECTED_OTHER", "CONTENT_CREATED", "CONTENT_MODIFIED" ]
The status of the recommendation.
The valid status values are the following:
- NEW
- CONTENT_CREATED
- CONTENT_MODIFIED
- REJECTED_DUPLICATE
- REJECTED_NOT_ENOUGH_INFO
- REJECTED_UNSUITABLE
- REJECTED_OTHER
-
statusComments(optional):
string
The comment added by author about the status of the ContentRecommendation object.
-
title(optional):
string
The title assigned to the recommendation by the user.
Examples
The following example shows how to find all Content Recommendation objects from Oracle Knowledge repository by submitting a get request on the REST resource using cURL.
cURL Command
Command: curl -X "GET" "http://<IM_REST_API_HOST>/km/api/latest/contentRecommendations"
Example of Request Header
The following shows an example of the request header.
-H "kmauthtoken: {\"siteName\":\"ORACLE_KNOWLEDGE\",\"integrationUserToken\":\"\"+eCJYkxKwj5HUaIiJYun0/TpatwT1LmtcsF05W33xnEojifV/AsLDj9RpN0lKuorTMNKeSE1tgC7svVL+BzntqDON4KiM1HFlpxvXEUCB0P2w0Xrs75McygqxdVaDSE9"}" \ -H "Accept: application/json"
Example of Response Body
The following shows an example of the response body in JSON format.
{ "items" : [ { "caseNumber" : "CASENUMBER_VALUE", "comments" : "COMMENTS_VALUE", "completedByUserName" : "COMPLETEDBYUSERNAME_VALUE", "dateAdded" : "2013-04-23T23:29:24EDT", "dateModified" : "2013-04-23T23:29:24EDT", "priority" : "HIGH", "requestedByUserName" : "REQUESTEDBYUSERNAME_VALUE", "status" : "NEW", "statusComments" : "STATUSCOMMENTS_VALUE", "title" : "TITLE_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}" } ], "hasMore" : false, "limit" : 20, "offset" : 0, "links" : [ { "rel" : "canonical", "href" : "http://<IM_REST_API_HOST>/km/api/{version}/contentRecommendations?limit=20&offset=0", "mediaType" : "application/json, application/xml", "method" : "GET" } ], "count" : 1 }