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(optional): string
The asset language of the request
Root Schema : updateMediaItem_request
Type:
Show Source
object
-
destinationFileName:
string
New filename of media item.
-
metadata(optional):
object metadata
Seo meta info for product.
-
overwrite(optional):
boolean
If true, an existing file will be overwritten if it has the same name as the destination file.
-
sourcePath:
string
Path of media item to rename.
-
uploadType(optional):
string
An uploadtype which has an associating postprocessor, if renaming should trigger assignment.
Example:
{
"metadata":{
"altText":"altText",
"titleText":"titleText"
},
"destinationFileName":"prod10001.jpg",
"uploadType":"productImage",
"overwrite":true,
"sourcePath":"/products/prod123.jpg"
}
Nested Schema : metadata
Type:
object
Seo meta info for product.
Show Source
-
altText(optional):
string
The alt text for the media item.
-
titleText(optional):
string
The title text for the media item.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : updateMediaItem_response
Type:
Show Source
object
-
assignResult(optional):
object assignResult
The assignment result.
-
renameSuccess(optional):
boolean
True if the file was renamed successfully, false if not.
Nested Schema : assignResult
Type:
object
The assignment result.
Show Source
-
itemID(optional):
string
Item ID for assignment, based on naming convention
-
itemType(optional):
string
The type of item for assignment, based on the upload type.
-
statusCode(optional):
string
Status code of assignment. One of: ASSIGNED, ALREADY_ASSIGNED, ITEM_NOT_FOUND, TYPE_NOT_SUPPORTED, UPLOAD_FAILED, OTHER_ERROR
Example Response (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.|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code