put https://app.ecwid.com/api/v3//products//media
Update product main & gallery images/videos in bulk
To update product gallery use secret token. The
update_catalog
access scope is required. Reach out to us at [email protected] to add the scope.
Headers
Name | Type | Description |
---|---|---|
Authorization | string | oAuth token with mandatory Bearer before it. Example: Bearer e***s0 , where e***s0 should be replaced with your oAuth token. |
Request
A JSON object with the following fields:
Field | Type | Description |
---|---|---|
mainMedia | Main image URL & Main video URL. If empty or null — no changes.If the list is empty — the gallery will be erased. | |
galleryMedia | array | Gallery image & video URLs If both array fields are missing - the error will appear in the response. If empty or null — no changes.If the list is empty — the gallery will be erased. |
MediaItemData
Field | Type | Description |
---|---|---|
videoUrl | string | Main video URL that replaces the value. If the field is missing — the main product video will be deleted. |
imageUrl | string | Main video URL that replaces the value. If the field is missing — the main product image will be deleted. |
GalleryMedia
Field | Type | Description |
---|---|---|
videoUrl | string | Gallery video URL. If the field is missing — the main product video will be deleted. |
imageUrl | string | Gallery video URL that replaces the value. If the field is missing — the main product image will be deleted. |
Response
A JSON object with the following fields:
Field | Type | Description |
---|---|---|
mainMedia | Related to the main product image or/and main product video | |
galleryMedia | array | Gallery video URL that replaces the value. If the field is missing — the main product image will be deleted. |
MediaItemResult
Field | Type | Description |
---|---|---|
success | boolean | Result of uploading. true or false |
id | string | Identification number of uploaded product/video. For Main image = 0. For Gallery = 1, 2, 3, etc. Shows up when "success" = true |
errorCode | string | Possible values:DOWNLOAD_IMAGE_FAILED DOWNLOAD_VIDEO_FAILED Shows up when "success" = false |
errorMessage | string | Error message text. Shows up when "success" = false |