Get an image
get
/ccstore/v1/images
Retrieves an image from a given source URL. Optionally, it can resize and convert the image to a different image format, .jpeg, .png, or gif.
To resize an image, both the width and the height parameters must be specified.
The maximum height and width allowed is 5000 pixels.
If either of these parameters, width or height, is excluded from the endpoint call, the source image is returned without transformation.
Note: Resizing and conversion are not supported for source GIF images.
The endpoint responds with a content type of 'application/json' in error conditions or one of 'image/jpeg', 'image/png', or 'image/gif' depending on the source image and specified parameters.
Request
Supported Media Types
- application/json
Query Parameters
-
alphaChannelColor(optional): string
The hex color code used to replace the transparency layer when converting images to JPEG. Default is FFFFFF.
-
height(optional): integer
The maximum height of the resized image. Required along with the 'width' parameter for the image to be resized.
-
outputFormat(optional): string
Output format of the converted image. JPEG is the only supported output format. When specified, the source image is converted to a JPEG except for GIF images which are not converted.
-
quality(optional): number
Quality of the image transformation: 0.0 (worst/fast) - 1.0 (best/slow). Default is 1.0.
-
source: string
The source location of the original image.
-
width(optional): integer
The maximum width of the resized image. Required along with the 'height' parameter for the image to be resized.
Response
Supported Media Types
- image/jpeg
- image/png
- image/gif
200 Response
Returned when the operation succeeds.
401 Response
Returned when running in preview mode and the user is not authenticated.
Root Schema : getImages_401_response
Type:
Show Source
object
-
errorCode(optional):
string
00001000
-
message(optional):
string
The user is not authenticated.
-
status(optional):
string
401
404 Response
Source image is not found
Root Schema : getImages_404_response
Type:
Show Source
object
-
message(optional):
string
HTTP 404 Not Found
-
status(optional):
string
404
429 Response
There is currently not enough processing capacity when trying to resize an image. Try again later or reduce the size of the image
Root Schema : getImages_429_response
Type:
Show Source
object
-
message(optional):
string
Explanation message stating processing capacity exceeded.
-
status(optional):
string
The HTTP status code.
Default Response
The following internal error codes are thrown by this API when the request fails in Commerce:
The error response:
Error Code | Description | Possible Fix |
---|---|---|
26200 | Failure resizing image. | See error messages for more information. |
The error response:
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