Publicator REST API - Product Image

The product image service provides access to the information in the product image database. This service is only available to CommercePro customers.

The following endpoints are available:

Import

RESTful POST service to import a product image file with metadata to the product database. The request has to be done in multipart/form-data type.

Parameters

The service requires the following GET parameters to be present in the request:

Name Required Description
key Yes The API key. Required for all API requests. Obtain the API key by clicking the "How to upload product files using REST" link on the Products page in the Publicator.

The service accepts the following POST parameters in multipart/form-data type:

Name Required Description
token No A unique token describing this request. Limited to 128 characters.
product_id Yes A product id, to which the image should belong. Limited to 255 characters.
index Yes Imported image index. It determines the order of images. It has to be a positive integer. Specify an existing index to update an image.
tags No Imported image comma-separated tags. Limited to 1K characters. Should be encoded in UTF-8.
<any> Yes A product image file. Exactly one image file is required. Accepted file types are JPEG and PNG.

Exactly one of the form data parts must be the product image file. Requests made with more than one product image file are considered syntactically incorrect.

The token may be used to uniquely describe an import. This allows the same request to be sent multiple times without resulting in it being processed multiple times. This may be useful for retry and error handling logic.

If a product image with provided index already exists in the product database, the existing image will be replaced with the new one.

The maximum size of the product image file is 1 MB.

Response codes

The service responds with the following status codes:

Code Meaning
202 (Accepted) The product image file and its metadata were received and have been scheduled for import.
400 (Bad Request) The request was syntactically incorrect. One or more parameters are incorrectly defined. For example, the key or file attachment are missing, the token is too long, or the request is too large.
403 (Forbidden) The user does not have access to the product database. The product database is only available to CommercePro customers.
404 (Not Found) No user could be found for the key specified in the request.
405 (Method Not Allowed) The request was made with a different method than POST.
503 (Service Unavailable) The server is unable to process the request. This could be caused by the server processing another REST API request from this user.

When a request is accepted, the progress and result of the import can be monitored through the Publicator. Email notifications can be configured on the Account Settings page.