I am trying to add an image to a product in Magento 2.1 via the REST API using the catalogProductAttributeMediaGalleryManagementV1 service. The request is a POST request to https://example.com/rest/V1/products/$000000000093/media where $000000000093 is the sku of the item I am trying to add the image to. The body of the request is
{
"entry":{
"types":[
"image",
"thumbnail",
"small_image"
],
"label":"Image",
"media_type":"image",
"disabled":false,
"content":[
{
"type":"image\/jpeg",
"name":"Test123.jpg",
"base64_encoded_data":"\/9j\/4AAQSkZJRgABAQAA..."
}
],
"position":1,
"file":"\/t\/e\/Test123.jpg"
}
}
This returns a 500 code and checking the Magento exception.log you get the following error:
main.CRITICAL: exception 'LogicException' with message 'Property "0" does not have corresponding setter in class "Magento\Framework\Api\Data\ImageContentInterface".'