Link
/km/api/v1/incidents/link
This method links an Incident object to one or more Content objects. This method returns details about the Incident object.
The request payload as a DocumentIncidentLink object must be provided with the POST method.
A new or existing Incident object can be specified in the DocumentIncidentLink object of the payload. If the Incident object is new, specify only the incidentId parameter value to identify the object. If the incident already exists, you can specify the incidentId parameter value alone, or the incidentId and recordId parameters together to identify the Incident object. You must always provide the description about the Incident object and it can contain updates if the specified Incident object is an existing Incident object.
A list of one or more Content objects (in the KEY mode) must be provided on the DocumentIncidentLink object to perform the link request. Each Content object provided must be an existing object. You can use parameter such as recordId, versionId, answerId, or documentId to identify the Content object. The attribute used to identify the first Content object determines how the other objects are identified.
For example:
- If you identify the first Content object in the list by its versionId parameter value, then all the Content objects are identified by their versionId parameter values only.
- If you identify the first Content in the list by its answerId parameter value, then all the Content objects are identified by their answerId parameter values only.
- If you identify the first Content in the list by its recordId parameter value, then all the Content objects are identified by their recordId parameter values only.
- If you identify the first Content in the list by its documentId parameter value, then all the Content objects are identified by their documentId parameter values only.
In any of these cases, each Content object specified is validated against the Content object found by the specified identifier. For example, if a versionId parameter is provided, then the Content object found by the specified versionId parameter is validated to ensure that the parameters such as recordId, answerId, and documentId provided with the payload match with those in the Oracle Knowledge Repository.
Request
- application/json
- application/xml
object
DocumentIncidentLink
-
documents(optional):
array documents
To Many Relationship to View
-
incident(optional):
Incident
-
object
Singular Resource
Title:
Singular Resource
Oracle base singular resource schema definition. -
object
ContentKey-allOf[1]
object
Singular Resource
object
-
allTranslations(optional):
array allTranslations
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.
-
answerId(optional):
integer
The unique identifier that enables mapping between an answer and the content.
-
dateModified(optional):
string(date-time)
The date when the content was last modified in the Oracle Knowledge Repository.
-
documentId(optional):
string
The unique identifier of a document that indicates the content type in which the content is saved.
-
locale(optional):
LocaleKey
-
recordId(optional):
string
The unique identifier of the document. This ID is same in all versions in all locales of the document.
-
title(optional):
string
The tittle of the document.
-
version(optional):
string
Version of the Content object
-
versionId(optional):
string
The unique identifier of the specific version of a document in a specific locale. You cannot use this field in queries made using q query parameter.
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.
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.
-
object
Singular Resource
Title:
Singular Resource
Oracle base singular resource schema definition. -
object
LocaleKey-allOf[1]
object
-
recordId(optional):
string
The unique identifier of the Locale object.
-
object
Singular Resource
Title:
Singular Resource
Oracle base singular resource schema definition. -
object
IncidentKey-allOf[1]
object
-
incidentId(optional):
string
The identifier of the Incident. This is also referred to as the case number.
-
recordId(optional):
string
The record Id of the Incident object.
object
-
dateAdded(optional):
string(date-time)
The date when the Incident object was created.
-
dateModified(optional):
string(date-time)
The date when the Incident object was last modified.
-
description(optional):
string
The description of the Incident.
Response
- application/json
- application/xml
200 Response
-
object
Singular Resource
Title:
Singular Resource
Oracle base singular resource schema definition. -
object
IncidentKey-allOf[1]
object
Singular Resource
object
-
incidentId(optional):
string
The identifier of the Incident. This is also referred to as the case number.
-
recordId(optional):
string
The record Id of the Incident object.
object
-
dateAdded(optional):
string(date-time)
The date when the Incident object was created.
-
dateModified(optional):
string(date-time)
The date when the Incident object was last modified.
-
description(optional):
string
The description of the Incident.
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 create a link from an Incident Object to one or more content objects by submitting a post request on the REST resource using cURL.
cURL Command
Command: curl -X "GET" "http://<IM_REST_API_HOST>/km/api/latest/incidents/link"
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.
{ "incident" : { "description" : "There is a problem identifying the meaning of key words for Oracle Knowledge", "incidentId" : "140005-14895892" }, "documents" : [ { "recordId" : "10834GALKGJ0187394813N401347981324", "versionId" : "1324IUH12934701324NL340987134KJN1341", "documentId" : "RE123", "title" : "Reference Document for Oracle Knowledge", "version" : "4.0", "answerId" : 0 }, { "recordId" : "AF21423423454FDSFKGJASDFAF48135465", "versionId" : "D4SAF654FA9D8F9837498425314462874653", "documentId" : "RE125", "title" : "Glossary of terms for Oracle Knowledge", "version" : "7.0", "answerId" : 0 } ] }
Example of Response Body
The following shows an example of the response body in JSON format.
{ "dateAdded" : "2013-11-05T13:48:51EST", "dateModified" : "2013-11-05T13:48:51EST", "description" : "There is a problem identifying the meaning of key words for Oracle Knowledge", "recordId" : "2LKAJDFO8234OIJ3O24P18439837409819", "incidentId" : "140005-14895892", "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}" } ] }