Find by ID

get

/km/api/v1/replacementTokens/{id}

This method returns the ReplacementToken object with the specified unique identifier parameter. Unique identifiers of ReplacmentToken objects include the recordId and tokenName.

The replacement text value displays the token's replacement text translation for the specified Locale object. If the token does not have a translation for the specified Locale, then the method displays the token's name as the replacement text to indicate to the user that the token exists, but that there is no translation for the specified Locale.

You can specify the Locale by setting the localeId parameter of the kmauthtoken header when making requests to the Oracle Knowledge REST API. Alternatively, if no localeId parameter value is supplied, then the method will interpret the specified Locale as the default Locale object assigned to the logged in user. In both cases, the specified Locale will be referred to as the session's Locale. The logged in user is the user for which the userToken attribute on the kmauthtoken header is created. Additionally, the Locale can be specified by the Accept-Language header value or by the langpref request parameter. In both cases, we refer to specified Locale as the request's Locale. If both the Accept-Language header and the langpref request parameter are present, the Accept-Language header will be used as the specified Locale.

Example URIs

The example URIs for this method are as follows:

  • http://<IM_REST_API_HOST>/km/api/latest/replacementTokens/{id}

    The request returns a ReplacementToken object with the specified recordId parameter in FULL mode, with the replacement text displayed for the session's Locale.

  • http://<IM_REST_API_HOST>/km/api/latest/replacementTokens/{id}?langpref=it_IT

    The request returns a ReplacementToken object with the specified recordId parameter in FULL mode, with the replacement text displayed for the request's Locale, which was specified as Italian.

  • http://<IM_REST_API_HOST>/km/api/latest/replacementTokens/{id}?mode=KEY, with Accept-Language header value 'es-ES'

    The request returns a ReplacementToken object with the specified recordId parameter in KEY mode, with the replacement text displayed for the request's Locale, which was specified as Spanish.

  • http://<IM_REST_API_HOST>/km/api/latest/replacementTokens/{tokenName}

    The request returns a ReplacementToken object having the specified tokenName parameter in FULL mode, with the replacement text displayed for the session's Locale.

  • http://<IM_REST_API_HOST>/km/api/latest/replacementTokens/{tokenName}?langpref=es_ES

    The request returns a ReplacementToken object having the specified tokenName parameter in FULL mode, with the replacement text displayed for the request's Locale, which was specified as Spanish.

  • http://<IM_REST_API_HOST>/km/api/latest/replacementTokens/{tokenName}?mode=KEY, with Accept-Language header value 'es-ES'

    The request returns a ReplacementToken object having the specified tokenName parameter in KEY mode, with the replacement text displayed for the request's Locale, which was specified as Spanish.

Request

Path Parameters
  • The unique identifier of the object to be retrieved.
Back to Top

Response

Supported Media Types

200 Response

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

Examples

The following example shows how to find the Replacement Token object with the specified ID parameter by submitting a get request on the REST resource using cURL.

cURL Command

curl -X "GET" "http://<IM_REST_API_HOST>/km/api/latest/replacementTokens/{id}"

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.

{
  "dateAdded" : "2013-04-30T21:35:18EDT",
  "dateModified" : "2013-04-30T21:35:18EDT",
  "replacementText" : "\n    \t<p><a href=\"http://www.oracle.com/us/products/applications/knowledge-management/index.html\">Oracle Knowledge</a></p>\n\t\t<p> </p>\n\t",
  "replacementTextNonFormatted" : "Oracle Knowledge",
  "tokenType" : "RICH_TEXT",
  "recordId" : "0121040772e9a860142e278b51501243",
  "tokenName" : "ORACLE_KNOWLEDGE",
  "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