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