I am trying to upload images to Magento using the API. We have 5 images, one of which is a thumbnail, one is the base image, and one is a regular image. The problem is that when I upload the images, the order is not correct—the thumbnail image is not set correctly, and sometimes the base image is also incorrect. Additionally, the thumbnail image needs to be hidden, but that is not working as expected either. In the example I provided, I used only three images, but the logic remains the same.
I omitted base64 code, due to size.
Entries example:
{
“label”: “PHA410”,
“types”: [
“thumbnail”
],
“content”: {
“name”: “PHA410”,
“type”: “image/png”,
“base64_encoded_data”: “”
},
“disabled”: true,
“position”: 1,
“media_type”: “image”
},
{
“label”: “PHA410”,
“types”: [
“gallery”
],
“content”: {
“name”: “PHA410”,
“type”: “image/png”,
“base64_encoded_data”: “”
},
“disabled”: false,
“position”: 2,
“media_type”: “image”
},
{
“label”: “PHA410”,
“types”: [
“base”
],
“content”: {
“name”: “PHA410”,
“type”: “image/png”,
“base64_encoded_data”: “”
},
“disabled”: false,
“position”: 3,
“media_type”: “image”
}