POST v3/products/:id/image
POST/v3/products/:id/image
Add or replace the commercial image of a product.
Allows the user to add or update the commercial image of a single products. The commercial image is used as reference image in when searching products in Maya and has no functional implications. Internally different images of the product are used for recognition and processing, however the commercial image may be relevant when dealing with consumer related issues about the product.
Limitations of POST /v3/propducts/:id/image
- Each product can have only one commercially assigned image
- The size of the file must be less than 10MiB
- Only the following file types are supported:
image/pngimage/x-pngimage/apngimage/jpgimage/jpegimage/pjpegimage/gif(not recommended)image/bmp(not recommended)image/webp(partially, may cause issues)application/x-photoshop(can't be rendered properly, but is accepted)
Request
Responses
- 200
- 400
- 401
- 403
- 406
- 415
Upon successful submission of the productImage a success message is returned, containing the product details, but not the image itself.
When the image is too large or of an invalid format the following error is returned.
401 Unauthorized
A 401 Unauthorized response occurs when attempting to access a resource or perform an action that requires authentication, but no valid credentials have been provided. It indicates that the requester is unauthorized to access the requested resource.
The following are common scenarios that may lead to a 401 Unauthorized response:
- Attempting to access a protected API endpoint without providing authentication credentials.
- Providing an invalid or expired authentication token.
- Providing valid authentication credentials, but lacking sufficient privileges to access the requested resource.
- Providing authentication credentials that are valid for a different resource or API endpoint than the one being requested.
403 Forbidden
The HTTP 403 Forbidden client error response status code indicates that the server understood the request but refused to process it. This status is similar to 401 Unauthorized, except that for 403 Forbidden responses, authenticating or re-authenticating makes no difference. The request failure is tied to application logic, such as insufficient permissions to a resource or action.
406 Not Acceptable
A 406 Not Acceptable response occurs when the server cannot provide a response that matches the client's requested format or content language for the requested resource. For instance, if a client sends an Accept header of text/html to an API endpoint that only supports application/json responses, the server would respond with a 406 Not Acceptable status code. This type of response is a required response for JSON:API compatible endpoints.
415 Unsupported Media Type
A 415 Unsupported Media Type response occurs when the server cannot process the request because the media type specified in the request is not supported for the requested resource. For example, if a client sends a request with a Content-Type header of application/pdf to an API endpoint that only supports application/json (the only valid media type for JSON:API), the server would respond with a 415 Unsupported Media Type status code. This type of error-response is a required for JSON:API compatible endpoints.