API - Images

Manage the products images


Routes

Method name Route Parameters OK return code Return
GET /api/products/{entityId}/images entityId: The product id 200 Results of the 'image' loop
GET /api/products/{entityId}/images/{imageId} entityId: The product id
imageId: The product image id
200 Results of the 'image' loop for entityId
POST /api/products/{entityId}/images entityId: The product id 201 Results of the 'image' loop for for entityId
PUT /api/products/{entityId}/images/{imageId} entityId: The product id
imageId: The product image id
201 Results of the 'image' loop for for entityId
DELETE /api/products/{entityId}/images/{imageId} entityId: The product id
imageId: The product image id
204 Nothing

Creation

When you post data to /api/products/{entityId}/images, only files are treated.

Images only are supported.

Update

When you put data to /api/products/{entityId}/images/{imageId}, there must be 0 or 1 file. Sending more than 1 file will result in an error.

You can update image’s data by sending those fields:

  • i18n : a collection of descriptive fields:
    • locale : The lang locale. Example: en_US
    • title : The image title
    • chapo : The image short description
    • description : The image description
    • postscriptum : The image conclusion

Example

{
    "i18n": [
        {
            "locale": "en_US",
            "title": "My image title"
        },
        {
            "locale": "fr_FR",
            "title": "Ma super image" 
        }
    ]
}