- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020
02:33 AM
04-22-2020
02:33 AM
Upload multiple product images in REST Api
Hello,
Magento Version : 2.3.0
I want to create product with multiple images using rest api, so please suggest me how can i implement ?
Magento2 - Rest API -- Issue With Multiple Images Upload
I am trying add multiple images of product through Magento2 Rest API but some only one image is getting added. I saw the documentation. Any help on this would be highly appreciated.
Thanks in advance
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2020
02:48 AM
04-22-2020
02:48 AM
Re: Upload multiple product images in REST Api
HI @psenthilpre6e4
You can try the below link.
https://devdocs.magento.com/swagger/index_23.html#/catalogProductRepositoryV1/catalogProductReposito...
In media gallery section you can set multiple images.
I hope it will help you!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2020
10:06 AM
04-25-2020
10:06 AM
Re: Upload multiple product images in REST Api
REST API POST /V1/products has media_gallery_entries which is an array.
You can provide multiple images, like the below example.
$request['media_gallery_entries'] = [ [ 'id' => 1, 'media_type' => 'image', 'label' => 'tiny1_new_label', 'position' => 1, 'disabled' => false, 'types' => [], 'file' => '/t/i/' . $filename1, ], [ 'id' => 2, 'media_type' => 'image', 'label' => 'tiny1_new_label2', 'position' => 2, 'disabled' => false, 'types' => [], 'file' => '/t/i/' . $filename2, ], ];
API reference
Suman Kar(suman.jis@gmail.com) Magento Certified Developer Plus Skype: sumanphptech Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.