updateMediaItem

put

/ccadmin/v1/files/mediaContents

Update Media Item. Rename a media item. Optionally takes the x-ccasset-language header to get translated content in another language.

Request

Supported Media Types
  • application/json
Header Parameters
X-CCAsset-Language
Type: string
The asset language of the request
Body Parameter
Root Schema : updateMediaItem_request
Nested Schema : metadata
Type: object
Seo meta info for product.

Response

Supported Media Types
  • application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : updateMediaItem_response
Nested Schema : assignResult
Type: object
The assignment result.
Example application/json

{
    "assignResult":{
        "itemID":"prod10001",
        "itemType":"product",
        "statusCode":"ASSIGNED"
    },
    "renameSuccess":true
}
Default Response
The error response. The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud: |Error Code|Description| |------------------|------------------| |33130|The destination filename must contain a base name.| |33120|The destination file name cannot contain a path.| |33131|The file to update metadata does not exist.| |33117|The file to rename does not exist.| |33128|The file extension was not allowed for upload, or did not match the file contents.| |33125|The sourcePath parameter is required.| |33123|The filename must be 254 characters or less, and the following characters are not allowed in the filename: \ : " * < > ? | Please enter a different name.| |33124|The file cannot be renamed because the source file and the destination file are the same.| |33121|A file with this name exists in the folder. Please enter a different name.| |33132|The file to update metadata is not a file.| |33122|The destinationFileName param is required.| |33133|The file to update metadata is not a media file.| |33118|The file to rename is not a file.| |33129|There was an error while validating the file extension.| |33119|The file to rename is not a media file.|
Body
Root Schema : errorModel
Type: object
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Nested Schema : items
Type: object

Examples

Sample Request:

{
  "metadata": {
    "altText": "altText",
    "titleText": "titleText"
  },
  "destinationFileName": "prod10001.jpg",
  "uploadType": "productImage",
  "overwrite": true,
  "sourcePath": "/products/prod123.jpg"
}

Sample Response Payload returned by endpoint:

{
  "assignResult": {
    "itemID": "prod10001",
    "itemType": "product",
    "statusCode": "ASSIGNED"
  },
  "renameSuccess": true
}