Class ByProjectKeyVariantsByIDImagesPost

All Implemented Interfaces:
ClientRequestCommand<Variant>, CreateHttpRequestCommand, HttpRequestCommand<Variant>, RequestCommand<Variant>

public class ByProjectKeyVariantsByIDImagesPost extends TypeBodyApiMethod<ByProjectKeyVariantsByIDImagesPost,Variant,File>

Uploads a JPEG, PNG, or a GIF image file to a Variant identified by its ID. The maximum file size of the image is 10MB.

The response status code depends on the size of the original image. If the image is small, the API responds with 200 OK, and if the image is larger, it responds with 202 Accepted. The Variant returned with a 202 Accepted status code contains a warnings field with an ImageProcessingOngoing Warning.

Produces the VariantImageAdded Message.



   CompletableFuture<ApiHttpResponse<com.commercetools.api.models.variant.Variant>> result = apiRoot
            .withProjectKey("{projectKey}")
            .variants()
            .withId("{ID}")
            .images()
            .post(file)
            .execute()