Delete media

post

/km/api/v1/media/deleteMedia

This method deletes the list of files passed in.

If there are thumbnail images that are associated with the image that thumbnail image will also be deleted. Upon successful deletion the relative path to the image and the thumbnail image will be returned in the MediaItemBO.

Response Errors

The possible error responses for this method are as follows:

  • OK-GEN0031

    The error occurs when you don't provide a list of mediaItemBOs in the mediaImportBO

Request

Supported Media Types
Body ()
MediaImport contains list of MediaItems to be deleted
Root Schema : MediaImport
Type: object
Title: MediaImport
Show Source
  • mediaItems

    The views assigned to the content. The user who has the view assigned to the content or the content type in which the content is saved can only access the content.

Nested Schema : mediaItems
Type: array

The views assigned to the content. The user who has the view assigned to the content or the content type in which the content is saved can only access the content.

Show Source
Nested Schema : MediaItem
Type: object
Title: MediaItem
Show Source
Back to Top

Response

Supported Media Types

200 Response

OK.
Body ()
Root Schema : ResultList MediaItem
Type: object
Title: ResultList MediaItem
Match All
Show Source
Nested Schema : Collection Paging Resource
Title: Collection Paging Resource
Oracle base collection resource schema definition.
Match All
Show Source
Nested Schema : Base Collection Resource
Title: Base Collection Resource
Oracle base collection resource schema definition.
Match All
Show Source
Nested Schema : Singular Resource
Type: object
Title: Singular Resource
Oracle base singular resource schema definition.
Show Source
Nested Schema : Base Collection Resource-allOf[1]
Type: object
Show Source
Nested Schema : Collection Paging Resource-allOf[1]
Type: object
Show Source
Nested Schema : ResultList MediaItem-allOf[1]
Type: object
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : items
Type: object
Nested Schema : items
Type: array
Show Source
Nested Schema : MediaItem
Type: object
Title: MediaItem
Show Source
Back to Top

Examples

The following example shows how to delete a list of media files from the Oracle Knowledge repository by submitting a POST request on the REST resource using cURL.

cURL Command Example

curl -X "POST" "http://<IM_REST_API_HOST>/km/api/latest/media/deleteMedia

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"

Request Body Example

The following shows an example of the request body.

{
  "mediaItems" : [ {
    "fileName" : "FILENAME_VALUE",
    "relativePath" : "RELATIVEPATH_VALUE",
    "resourceURL" : "RESOURCEURL_VALUE",
    "thumbnailURL" : "THUMBNAILURL_VALUE",
    "errorMessage" : "ERRORMESSAGE_VALUE"
  } ]
}

Response Body Example

The following shows an example of the response body in JSON format.

{
  "items" : [ {
    "fileName" : "FILENAME_VALUE",
    "relativePath" : "RELATIVEPATH_VALUE",
    "resourceURL" : "RESOURCEURL_VALUE",
    "thumbnailURL" : "THUMBNAILURL_VALUE",
    "errorMessage" : "ERRORMESSAGE_VALUE"
  }, {
    "fileName" : "FILENAME_VALUE",
    "relativePath" : "RELATIVEPATH_VALUE",
    "resourceURL" : "RESOURCEURL_VALUE",
    "thumbnailURL" : "THUMBNAILURL_VALUE",
    "errorMessage" : "ERRORMESSAGE_VALUE"
  }, {
    "fileName" : "FILENAME_VALUE",
    "relativePath" : "RELATIVEPATH_VALUE",
    "resourceURL" : "RESOURCEURL_VALUE",
    "thumbnailURL" : "THUMBNAILURL_VALUE",
    "errorMessage" : "ERRORMESSAGE_VALUE"
  } ],
  "hasMore" : false,
  "limit" : 20,
  "offset" : 0,
  "count" : 3
}
Back to Top