Get all content types
/km/api/v1/contentTypes
This method returns a list of ContentType objects from the Oracle Knowledge repository.
This resource supports the orderBy request parameter, which allows you to sort the returned list of ContentType 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/contentTypes
Example URIs
The example URIs for this method are as follows:
http://<IM_REST_API_HOST>/km/api/contentTypes
The request returns a paginated list of ContentType objects in the DATA mode. By default, ContentType objects are sorted according to the referenceKey value in ascending order.
http://<IM_REST_API_HOST>/km/api/contentTypes?mode=KEY
The request returns a paginated list of ContentType objects in the KEY mode.
http://<IM_REST_API_HOST>/km/api/contentTypes?orderBy=name:asc
The request returns a paginated list of ContentType objects in the DATA mode. Objects in the list are sorted according to the names of the ContentType objects.
Find by query
Supported Media Types: 'application/json', 'application/xml'
This method returns a list of ContentType objects that match the specified criteria.
This resource supports the orderBy request parameter, which allows you to sort the returned list of ContentType 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/contentTypes
Example URIs
The example URIs for this method are as follows:
http://<IM_REST_API_HOST>/km/api/contentTypes?q=referenceKey eq 'FAQ'
The request returns a paginated list of ContentType objects in the DATA mode, having FAQ as the reference Key value.
http://<IM_REST_API_HOST>/km/api/contentTypes?q=translationRequestLocales.id in ('en_US', 'es_ES', 'iT_IT')&mode=FULL
The request returns a paginated list of ContentType objects, which are configured to generate automatic translation request while content authoring. The request is generated for specified languages such as: English United States, Peninsular Spanish, and Italian.
-
NOTE : The criteria object only supports category related queries for Out Of The box ContentType objects. User defined ContentType objects will not be returned by the query.
Response Errors
The possible error responses for this method are as follows:
- OKDOM-CRIT0025
The error occurs when an invalid criteria field is specified in the request.
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 ContentType object. |
referenceKey | Y | Y | 'type' : 'string' | The reference key for the ContentType object. ContentType objects support multiple languages. This field can be used to identify the associated objects for all languages. |
name | N | Y | 'type' : 'string' | The name for the ContentType object. The name field can only be used for sorting. Content Types support multiple languages. This field identifies the object associated with the language specified by the user. |
description | Y | Y | 'type' : 'string' | The description for the ContentType object. Content Types support multiple languages. This field identifies the object associated with the language specified by the user. |
stripeCd | Y | Y | 'type' : 'string' | Lookup code that indicates the stripe code. |
allowCheckOut | Y | Y | 'type' : 'boolean' | The flag indicates whether the ContentType object allows the content to be checkoutedout, to prevent other authors from editing the same content. |
allowRecommendations | Y | Y | 'type' : 'boolean' | The flag indicates whether the content type allows end users to create recommendations for its contents. This also indicates whether you can associate the recommended content with a content type. |
counterPrefix | Y | Y | 'type' : 'string' | The prefix used with all document IDs in a content type. For example, FA is the contentPrefix of the content type FAQ. All document IDs in the content type FAQ begins with the affix FA. |
dateAdded | Y | Y | 'type' : 'string', 'format' : 'date-time' | The date when the content type was created. |
dateModified | Y | Y | 'type' : 'string', 'format' : 'date-time' | The date when the content type was last modified. |
defaultLifespan | Y | Y | 'type' : 'integer' | The total number of days that the content is available to the end user. It indicates that the content will be available to end users for the specified number of days, starting from the day when the content was created. |
enableUserActivityLogging | Y | Y | 'type' : 'boolean' | The flag indicates whether the system tracks the user interactions with the content. |
hasPriority | Y | Y | 'type' : 'boolean' | The flag indicates whether you can assign priority level to the content in the content type. Valid priority values are numbers from one to twenty and none. |
hasRelatedContent | Y | Y | 'type' : 'boolean' | The flag indicates whether the content type allows related documents to be specified while content authoring. |
hasTalkBack | Y | Y | 'type' : 'boolean' | The flag indicates whether you can open discussions for contents in the content type. |
isEvent | Y | Y | 'type' : 'boolean' | The flag indicates whether the content type supports different event dates. |
isModerated | Y | Y | 'type' : 'boolean' | The flag indicates whether the content needs moderation, for its open discussions, before the discussions are made public. |
notifyOnWorkflowApproval | Y | Y | 'type' : 'boolean' | The flag indicates whether the appropriate content author should be notified when a workflow approval step is completed. |
notifyOnWorkflowRejection | Y | Y | 'type' : 'boolean' | The flag indicates whether the appropriate content author should be notified when the document is rejected. |
notifyGroupOnWorkflowRejection | Y | Y | 'type' : 'boolean' | The flag indicates whether notifications should be sent to content authors when the document is rejected. |
removeVersions | Y | Y | 'type' : 'boolean' | The flag indicates whether to remove the minor versions of the content after publication. |
reviewDate | Y | Y | 'type' : 'integer' | The date on which the document requires review. When the date approaches, the system generates a task for the appropriate author to review the content. |
extendReviewDate | Y | Y | 'type' : 'boolean' | The flag indicates whether the review date should be extended once content has been reviewed for the content type. |
validateHtml | Y | Y | 'type' : 'boolean' | The flag indicates whether the content should be validated to adhere to HTML standards while content authoring. |
enableIndexing | Y | Y | 'type' : 'boolean' | The flag indicates whether the Oracle Knowledge Search Indexing is enabled for the content type. |
indexStatus | Y | Y | 'enum' : ['LIVE', 'LATEST_VALID_DRAFT', 'LIVE_AND_LATEST_VALID_DRAFT', 'NONE'] | The status of the documents assigned to have Oracle Knowledge Search indexing. The valid values are:
|
rating | Y | N | '$ref' : '#/definitions/RatingKey' | The rating system assigned to the content type. |
userGroups | Y | N | '$ref' : '#/definitions/ListUserGroupKey' | The UserGroup objects associated with the content type. Content authors assign a user Group to the content, so that users with a certain level of access will have access to the content. |
customMetrics | Y | N | '$ref' : '#/definitions/ListCustomMetricKey' | The unit of measurement used to track the activities on the content in a content type. |
requiredCategories | Y | N | '$ref' : '#/definitions/ListCategoryKey' | The Category objects that the content type requires for all its contents. The content authors must assign these categories to the content while content authoring. Authors are not allowed to save the content if they do not assign the categories. |
categories | Y | N | '$ref' : '#/definitions/ListCategoryKey' | The list of Category objects configured in the content type, which are available to the content authors to assign to the content. The Category objects are used to tag or label the content to improve searchability. |
translationRequestLocales | Y | N | '$ref' : '#/definitions/ListLocaleKey' | The list of Locale objects for which the automatic translation request is enabled in the content type. The content type sends translation requests to content translators of specific set of languages, each time the content is ready for publication. |
workflow | Y | N | '$ref' : '#/definitions/WorkflowKey' | The workflow definition that the author can use while content authoring in a content type. |
Request
-
limit(optional): 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(optional): string
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(optional): 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(optional): 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(optional): 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 ContentTypeData
-
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.
-
items(optional):
array items
-
limit(optional):
integer
Actual paging size used by the server.
-
links(optional):
array links
-
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 ContentTypeData
Title:
ContentTypeData
array
-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
object
ContentTypeData
-
allowCheckOut(optional):
boolean
The flag indicates whether the ContentType object allows the content to be checkoutedout, to prevent other authors from editing the same content.
-
allowRecommendations(optional):
boolean
The flag indicates whether the content type allows end users to create recommendations for its contents. This also indicates whether you can associate the recommended content with a content type.
-
categoriesRequireWorkflowApproval(optional):
boolean
Categories requires workflow approval if workflow is enabled @since 8.3
-
counterPrefix(optional):
string
The prefix used with all document IDs in a content type. For example, FA is the contentPrefix of the content type FAQ. All document IDs in the content type FAQ begins with the affix FA.
-
dateAdded(optional):
string(date-time)
The date when the content type was created.
-
dateModified(optional):
string(date-time)
The date when the content type was last modified.
-
defaultLifespan(optional):
integer
The total number of days that the content is available to the end user. It indicates that the content will be available to end users for the specified number of days, starting from the day when the content was created.
-
description(optional):
string
The description for the ContentType object. Content Types support multiple languages.
This field identifies the object associated with the language specified by the user.
-
displayDatesRequireWorkflowApproval(optional):
boolean
Display dates requires workflow approval if workflow is enabled @since 8.3
-
enableIndexing(optional):
boolean
The flag indicates whether the Oracle Knowledge Search Indexing is enabled for the content type.
-
enableUserActivityLogging(optional):
boolean
The flag indicates whether the system tracks the user interactions with the content.
-
eventDatesRequireWorkflowApproval(optional):
boolean
Event dates requires workflow approval if workflow is enabled @since 8.3
-
extendReviewDate(optional):
boolean
The flag indicates whether the review date should be extended once content has been reviewed for the content type.
-
hasPriority(optional):
boolean
The flag indicates whether you can assign priority level to the content in the content type. Valid priority values are numbers from one to twenty and none.
-
hasRelatedContent(optional):
boolean
The flag indicates whether the content type allows related documents to be specified while content authoring.
-
hasTalkBack(optional):
boolean
The flag indicates whether you can open discussions for contents in the content type.
-
indexStatus(optional):
Allowed Values:
[ "LIVE", "LATEST_VALID_DRAFT", "LIVE_AND_LATEST_VALID_DRAFT", "NONE" ]
The status of the documents assigned to have Oracle Knowledge Search indexing.
The valid values are:
- LIVE
- LATEST_VALID_DRAFT
- LIVE_AND_LATEST_VALID_DRAFT
- NONE
-
isEvent(optional):
boolean
The flag indicates whether the content type supports different event dates.
-
isModerated(optional):
boolean
The flag indicates whether the content needs moderation, for its open discussions, before the discussions are made public.
-
links(optional):
array links
-
name(optional):
string
The name for the ContentType object. The name field can only be used for sorting.
Content Types support multiple languages. This field identifies the object associated with the language specified by the user.
-
notifyGroupOnWorkflowRejection(optional):
boolean
The flag indicates whether notifications should be sent to content authors when the document is rejected.
-
notifyOnWorkflowApproval(optional):
boolean
The flag indicates whether the appropriate content author should be notified when a workflow approval step is completed.
-
notifyOnWorkflowRejection(optional):
boolean
The flag indicates whether the appropriate content author should be notified when the document is rejected.
-
recordId(optional):
string
The unique identifier of the ContentType object.
-
referenceKey(optional):
string
The reference key for the ContentType object.
ContentType objects support multiple languages. This field can be used to identify the associated objects for all languages.
-
removeVersions(optional):
boolean
The flag indicates whether to remove the minor versions of the content after publication.
-
requireAtLeastOneCategory(optional):
boolean
Require authors to select at least one category in addition to the categories marked as 'required' @since 8.3
-
requireAtLeastOneProduct(optional):
boolean
Require authors to select at least one product in addition to the products marked as 'required' @since 8.3
-
requireAtLeastOneUserGroup(optional):
boolean
Require at least one user group to be selected @since 8.3
-
restrictAuthoringToWorkflowUser(optional):
boolean
Restrict content editing to users that can perform the workflow step @since 8.3
-
restrictToOneUserGroupSelection(optional):
boolean
Restrict User Group selection to one group only @since 8.3
-
reviewDate(optional):
integer
The date on which the document requires review.
When the date approaches, the system generates a task for the appropriate author to review the content.
-
stripeCd(optional):
string
Lookup code that indicates the stripe code.
-
userGroupRequireWorkflowApproval(optional):
boolean
User Groups requires workflow approval if workflow is enabled @since 8.3
-
validateHtml(optional):
boolean
The flag indicates whether the content should be validated to adhere to HTML standards while content authoring.
-
viewsRequireWorkflowApproval(optional):
boolean
Views requires workflow approval if workflow is enabled @since 8.3
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.
Examples
The following example shows how to find all Content Type objects from Oracle Knowledge repository by submitting a get request on the REST resource using cURL.
curl -X GET "https://<IM_REST_API_HOST>/km/api/latest/contentTypes" -u "<username:password>" -H "Accept: application/json" -H "Content-Type: application/json"
Example of Response Body
The following example shows the contents of the response body in JSON format:
{ "items": [ { "allowCheckOut": false, "allowRecommendations": false, "counterPrefix": "SOL", "dateAdded": "2016-09-16T12:55:09-0600", "dateModified": "2017-01-07T00:06:31-0700", "defaultLifespan": -1, "enableUserActivityLogging": false, "hasPriority": false, "hasRelatedContent": false, "hasTalkBack": false, "isEvent": false, "isModerated": false, "requireAtLeastOneCategory": false, "requireAtLeastOneUserGroup": false, "restrictToOneUserGroupSelection": false, "categoriesRequireWorkflowApproval": true, "userGroupRequireWorkflowApproval": true, "viewsRequireWorkflowApproval": true, "displayDatesRequireWorkflowApproval": true, "eventDatesRequireWorkflowApproval": true, "restrictAuthoringToWorkflowUser": true, "notifyOnWorkflowApproval": false, "notifyOnWorkflowRejection": false, "notifyGroupOnWorkflowRejection": false, "removeVersions": false, "reviewDate": -1, "validateHtml": false, "enableIndexing": true, "indexStatus": "LIVE", "recordId": "BC015169991F49738196682D57E7C5E3", "referenceKey": "SOLUTION", "name": "Solution", "links": [ { "rel": "canonical", "href": "https://IM_REST_API_HOST/km/api/latest/contentTypes/BC015169991F49738196682D57E7C5E3", "mediaType": "application/json, application/xml", "method": "GET" }, { "rel": "collection", "href": "https://IM_REST_API_HOST/km/api/latest/contentTypes", "mediaType": "application/json, application/xml", "method": "GET", "profile": "https://IM_REST_API_HOST/km/api/latest/metadata-catalog/contentTypes" } ] } ], "hasMore": false, "limit": 20, "offset": 0, "links": [ { "rel": "canonical", "href": "https://IM_REST_API_HOST/km/api/latest/contentTypes?limit=20&offset=0", "mediaType": "application/json, application/xml", "method": "GET" } ], "count": 1 }