0

I am trying to add thumbnail images to SKUs via REST API. However, the image is added but does not show as a thumbnail. Please see my POST request below

https://url.co.uk/rest/V1/products/231877/media

  "entry": {
    "media_type": "image",
    "label": "test",
    "position": 0,
    "disabled": false,
    "types": [
       "thumbnail","small_image"
    ],
    "content": {
      "base64_encoded_data": "myencodeddata",
   "type": "image/jpeg",
      "name": "test"
    },
    "extension_attributes": {
    }
  }
}

Thanks in advance!
3
  • Are you uploading image of type jpeg? Apr 13, 2021 at 11:47
  • Hi @RahulBarot yes it is a jpeg image. It adds the image to the product detail page in Magento admin but not as a thumbnail Apr 13, 2021 at 12:23
  • I then need to go into the product and assign the image role as thumbnail. Can I not assign this role straight away in the API? Apr 13, 2021 at 12:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.