Working on Magento version - 2.1.5.
Hello Techies
I am working on magento 2 project and learning rest api .
I am trying to upload product image via rest api .
Url of rest api = http://127.0.0.1/megento2/index.php/rest/V1/products/{sku}/media.
Method i used POST as mention in magento 2 dev docs.
Below are the parameters :
[
{
"id": 0,
"media_type": "test",
"label": "test",
"position": 0,
"disabled": true,
"types": [
"thumbnail"
],
"file": "test.png",
"content": {
"base64_encoded_data": "Here i have passed base64_encoded data of image",
"type": "file/png",
"name": "test.png"
},
}
}
]
Not sure why but getting 400 Error and error message is like below :
Product could not be saved
Your help will be appreciated .