0

I'm able to POST images up to the media gallery of products on my Magento 2 installation using the /products/{sku}/media/ endpoint. I'm of the understanding that I should be able to overwrite an existing image with a PUT call to the /products/{sku}/media/{entryId} endpoint, however whenever I try the call results in a 503 error with the content of the 'Maintenance' page.

No errors are returned - while, if I'm POSTing a new image and there's an issue such as the image not being able to be saved, the error is handled and returned to me via the API.

Is there any way to debug this issue, or make the API return an error that is a little more helpful?

This is basically what's being sent:

{    
"SKU":"000-004-045",
    "ENTRYID":64822,
    "ENTRY":{        
    "CONTENT":{
            "BASE64_ENCODED_DATA":"---A bunch of data is here ---",
            "NAME":"000004045_1.jpg",
            "TYPE":"image/jpeg"
        },
    "POSITION":"1",
    "MEDIA_TYPE":"image",
    "DISABLED":"false",
    "TYPES":[
            "image",
            "small_image",
            "thumbnail"
        ],
    "ID":64822,
    "LABEL":"Product Image"
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.