Get all views
/km/api/v1/views
This method returns a list of View objects from the Oracle Knowledge Repository.
This resource supports the orderBy request parameter. You can use this parameter along with the HTTP service request to sort the returned list.
You must get the schema and catalog of the resource for additional values that you can use with the orderBy parameter. To get the schema and catalog of the resource, you must use the 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/views
Find by query
Supported Media Types: 'application/json', 'application/xml'
This method returns a list of View objects that match the specified criteria.
This resource supports the orderBy request parameter. You can use this parameter along with the HTTP service request to sort the returned list.
You must get the schema and catalog of the resource for additional values that you can use with the orderBy parameter. To get the schema and catalog of the resource, you must use the 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/views
The following table describes the query parameters for this resource.
Parameter | Queryable | Sortable | Type | Description |
---|---|---|---|---|
recordId | Y | Y | 'type' : 'string' | GUID of the SITE table containing the view definition |
referenceKey | Y | Y | 'type' : 'string' | Non localized reference key for the view |
name | N | Y | 'type' : 'string' | Localized name of the view |
stripeCD | N | Y | 'type' : 'string' | Stripe of a view |
dateAdded | Y | Y | 'type' : 'string', 'format' : 'date-time' | Timestamp when the view was created |
dateModified | Y | Y | 'type' : 'string', 'format' : 'date-time' | Timestamp when the view was last modified |
parent | Y | N | '$ref' : '#/definitions/ViewKey' | Reference to the parent of the current view |
categories | Y | N | '$ref' : '#/definitions/ListCategoryKey' | List of categories assigned to the view |
userGroups | Y | N | '$ref' : '#/definitions/ListUserGroupKey' | List of user groups assigned to this view |
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 ViewData
-
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 instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
object
ViewData
-
dateAdded(optional):
string(date-time)
Timestamp when the view was created
-
dateModified(optional):
string(date-time)
Timestamp when the view was last modified
-
links(optional):
array links
-
name(optional):
string
Localized name of the view
-
objectId(optional):
string
String representing the hierarchy of the view
-
recordId(optional):
string
GUID of the SITE table containing the view definition
-
referenceKey(optional):
string
Non localized reference key for the view
-
stripeCD(optional):
string
Stripe of a view
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 a list of View 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/views" -u "<username:password>" -H "Accept: application/json" -H "Content-Type: application/json" -d "@<FilePath/RequestBody.json>"
Example of Response Body
The following example shows the contents of the response body in JSON format:
{ "items": [ { "dateAdded": "1970-01-01T23:11:11-0800", "dateModified": "2017-04-24T17:41:32-0700", "objectId": "001.001", "recordId": "BBA181DFB52148779A416184A191B2AF", "referenceKey": "SERVICE", "name": "Service", "links": [ { "rel": "parent", "href": "http://IM_REST_API_HOST/km/api/latest/views/FBA17E28CAAB4A7387A44BEE77240E33", "mediaType": "application/json, application/xml", "method": "GET" }, { "rel": "canonical", "href": "http://IM_REST_API_HOST/km/api/latest/views/BBA181DFB52148779A416184A191B2AF", "mediaType": "application/json, application/xml", "method": "GET" }, { "rel": "collection", "href": "http://IM_REST_API_HOST/km/api/latest/views", "mediaType": "application/json, application/xml", "method": "GET", "profile": "http://IM_REST_API_HOST/km/api/latest/metadata-catalog/views" } ] }, { "dateAdded": "1970-01-01T23:11:11-0800", "dateModified": "2017-04-13T05:30:07-0700", "objectId": "001.002", "recordId": "B6AD9BA886A743D2B5CB9A1DE2CE7D00", "referenceKey": "HCM", "name": "HCM", "links": [ { "rel": "parent", "href": "http://IM_REST_API_HOST/km/api/latest/views/FBA17E28CAAB4A7387A44BEE77240E33", "mediaType": "application/json, application/xml", "method": "GET" }, { "rel": "canonical", "href": "http://IM_REST_API_HOST/km/api/latest/views/B6AD9BA886A743D2B5CB9A1DE2CE7D00", "mediaType": "application/json, application/xml", "method": "GET" }, { "rel": "collection", "href": "http://IM_REST_API_HOST/km/api/latest/views", "mediaType": "application/json, application/xml", "method": "GET", "profile": "http://IM_REST_API_HOST/km/api/latest/metadata-catalog/views" } ] }, ], "hasMore": false, "limit": 20, "offset": 0, "links": [ { "rel": "canonical", "href": "http://IM_REST_API_HOST/km/api/latest/views?limit=20&offset=0", "mediaType": "application/json, application/xml", "method": "GET" } ], "count": 2 }