Update media for a product
put
/swm/rs/v1/spaces/{spaceId}/products/{contentId}/media/{mediaId}
Replaces a media file for a product content post in a space by creating a new media file and deleting the old one.
File type is limited to the jpg, jpeg, gif, and png formats.
The API user must be a member of the space and have created (own) the product content post.
File type is limited to the jpg, jpeg, gif, and png formats.
The API user must be a member of the space and have created (own) the product content post.
Request
Supported Media Types
- application/json
Path Parameters
-
contentId: string
The ID of the product post
-
mediaId: string
The ID of the media to replace
-
spaceId: string
The ID of the space resource
{
"file":"string", - Base64 encoded file content
"fileName":"string" - Name of the file
}
"file":"string", - Base64 encoded file content
"fileName":"string" - Name of the file
}
Root Schema : schema
Type:
stringResponse
Supported Media Types
- application/json; charset=UTF-8
200 Response
media resource replaced
403 Response
not product creator
404 Response
media resource not found
Examples
Sample Request:
{
"file":"encrypted_file_contents",
"fileName":"productImage.jpg"
}
Sample Response:
{"response":{"code":"200.1","developerMessage":"media resource updated"},
"mediaId":"Aex2YHW8qmBHX2gC61PU8VGu",
"mediaUrl":"/preview/media/product/AMA1iqn08Jz8QGqG/rpCcZTzUdDbVAmRjCy2BFCOO/Aex2YHW8qmBHX2gC61PU8VGu.jpg"}
Possible Error Codes:
{
"code":"404.0","developerMessage":"product resource not found",
"code":"403.1","developerMessage":"not space member",
"code":"403.2","developerMessage":"not content creator",
"code":"400.2","developerMessage":"media resource invalid type",
"code":"409.0","developerMessage":"media resource already exists"
}