Set default product image via REST APIHelp using the REST api and JavaGet multiple product images using REST APIMIME type not valid when uploading image using REST APImagento2 make image base via REST APImagento2, using REST api media uploadMagento 2 : Social Login via Rest ApiHow to attach an image for a product using magento2 REST API?Error on image upload with REST apiCreate Product with image using REST APIAuto Add Product Attribute Options when Creating a new Product by Rest API

Proof of work - lottery approach

Type int? vs type int

Where does the Z80 processor start executing from?

Valid Badminton Score?

What is the difference between "behavior" and "behaviour"?

Do sorcerers' subtle spells require a skill check to be unseen?

Pole-zeros of a real-valued causal FIR system

Increase performance creating Mandelbrot set in python

How easy is it to start Magic from scratch?

Is there a problem with hiding "forgot password" until it's needed?

Was Spock the First Vulcan in Starfleet?

Is HostGator storing my password in plaintext?

Is exact Kanji stroke length important?

What happens if you roll doubles 3 times then land on "Go to jail?"

What is the best translation for "slot" in the context of multiplayer video games?

How to Reset Passwords on Multiple Websites Easily?

Customer Requests (Sometimes) Drive Me Bonkers!

What's the purpose of "true" in bash "if sudo true; then"

Unexpected indention in bibliography items (beamer)

Is expanding the research of a group into machine learning as a PhD student risky?

Lay out the Carpet

How do I rename a Linux host without needing to reboot for the rename to take effect?

Sort a list by elements of another list

How to write papers efficiently when English isn't my first language?



Set default product image via REST API


Help using the REST api and JavaGet multiple product images using REST APIMIME type not valid when uploading image using REST APImagento2 make image base via REST APImagento2, using REST api media uploadMagento 2 : Social Login via Rest ApiHow to attach an image for a product using magento2 REST API?Error on image upload with REST apiCreate Product with image using REST APIAuto Add Product Attribute Options when Creating a new Product by Rest API













3















I'm using Magento REST API to create products and upload images. No problems so far, but i can't find a way to set an image as the default image to be displayed on the store using the API.



Is there a way to do so without modifying magento?



I'm using Magento CE 1.9.1.0



Thanks,










share|improve this question














bumped to the homepage by Community 16 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Have you tried setting its position to 0?

    – rlecaro2
    Sep 7 '15 at 13:44















3















I'm using Magento REST API to create products and upload images. No problems so far, but i can't find a way to set an image as the default image to be displayed on the store using the API.



Is there a way to do so without modifying magento?



I'm using Magento CE 1.9.1.0



Thanks,










share|improve this question














bumped to the homepage by Community 16 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Have you tried setting its position to 0?

    – rlecaro2
    Sep 7 '15 at 13:44













3












3








3








I'm using Magento REST API to create products and upload images. No problems so far, but i can't find a way to set an image as the default image to be displayed on the store using the API.



Is there a way to do so without modifying magento?



I'm using Magento CE 1.9.1.0



Thanks,










share|improve this question














I'm using Magento REST API to create products and upload images. No problems so far, but i can't find a way to set an image as the default image to be displayed on the store using the API.



Is there a way to do so without modifying magento?



I'm using Magento CE 1.9.1.0



Thanks,







api product-images rest






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 26 '15 at 15:46









jinavar1jinavar1

162




162





bumped to the homepage by Community 16 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 16 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • Have you tried setting its position to 0?

    – rlecaro2
    Sep 7 '15 at 13:44

















  • Have you tried setting its position to 0?

    – rlecaro2
    Sep 7 '15 at 13:44
















Have you tried setting its position to 0?

– rlecaro2
Sep 7 '15 at 13:44





Have you tried setting its position to 0?

– rlecaro2
Sep 7 '15 at 13:44










1 Answer
1






active

oldest

votes


















0














This is the correct way to set the image as "base", "small", "thumbnail" or "swatch".



"product" => 
"sku" => "test",
"name" => "Test Product",
"attribute_set_id" => 4,
"price" => 84,
"status" => 1,
"visibility" => 4,
"type_id" => "simple",
"mediaGalleryEntries"=> [
"mediaType"=> "image",
"label"=> "hassel",
"types" => ["base","small","thumbnail","swatch"],
"position"=> 0,
"disabled"=> false,
"file"=> "path/to/image.jpeg",
"content"=>
"base64EncodedData"=> "base64_encoded_image",
"type"=> "image/jpeg",
"name"=> "image_name"

]






share|improve this answer






















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f80002%2fset-default-product-image-via-rest-api%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    This is the correct way to set the image as "base", "small", "thumbnail" or "swatch".



    "product" => 
    "sku" => "test",
    "name" => "Test Product",
    "attribute_set_id" => 4,
    "price" => 84,
    "status" => 1,
    "visibility" => 4,
    "type_id" => "simple",
    "mediaGalleryEntries"=> [
    "mediaType"=> "image",
    "label"=> "hassel",
    "types" => ["base","small","thumbnail","swatch"],
    "position"=> 0,
    "disabled"=> false,
    "file"=> "path/to/image.jpeg",
    "content"=>
    "base64EncodedData"=> "base64_encoded_image",
    "type"=> "image/jpeg",
    "name"=> "image_name"

    ]






    share|improve this answer



























      0














      This is the correct way to set the image as "base", "small", "thumbnail" or "swatch".



      "product" => 
      "sku" => "test",
      "name" => "Test Product",
      "attribute_set_id" => 4,
      "price" => 84,
      "status" => 1,
      "visibility" => 4,
      "type_id" => "simple",
      "mediaGalleryEntries"=> [
      "mediaType"=> "image",
      "label"=> "hassel",
      "types" => ["base","small","thumbnail","swatch"],
      "position"=> 0,
      "disabled"=> false,
      "file"=> "path/to/image.jpeg",
      "content"=>
      "base64EncodedData"=> "base64_encoded_image",
      "type"=> "image/jpeg",
      "name"=> "image_name"

      ]






      share|improve this answer

























        0












        0








        0







        This is the correct way to set the image as "base", "small", "thumbnail" or "swatch".



        "product" => 
        "sku" => "test",
        "name" => "Test Product",
        "attribute_set_id" => 4,
        "price" => 84,
        "status" => 1,
        "visibility" => 4,
        "type_id" => "simple",
        "mediaGalleryEntries"=> [
        "mediaType"=> "image",
        "label"=> "hassel",
        "types" => ["base","small","thumbnail","swatch"],
        "position"=> 0,
        "disabled"=> false,
        "file"=> "path/to/image.jpeg",
        "content"=>
        "base64EncodedData"=> "base64_encoded_image",
        "type"=> "image/jpeg",
        "name"=> "image_name"

        ]






        share|improve this answer













        This is the correct way to set the image as "base", "small", "thumbnail" or "swatch".



        "product" => 
        "sku" => "test",
        "name" => "Test Product",
        "attribute_set_id" => 4,
        "price" => 84,
        "status" => 1,
        "visibility" => 4,
        "type_id" => "simple",
        "mediaGalleryEntries"=> [
        "mediaType"=> "image",
        "label"=> "hassel",
        "types" => ["base","small","thumbnail","swatch"],
        "position"=> 0,
        "disabled"=> false,
        "file"=> "path/to/image.jpeg",
        "content"=>
        "base64EncodedData"=> "base64_encoded_image",
        "type"=> "image/jpeg",
        "name"=> "image_name"

        ]







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 5 '18 at 14:31









        CharChar

        13917




        13917



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f80002%2fset-default-product-image-via-rest-api%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

            Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»

            Вунгтау (аеропорт) Загальні відомості | Див. також | Посилання | Навігаційне меню10°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.0833310°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.083337731608Vinh AirportVinh airport facelift improves serviceвиправивши або дописавши їївиправивши або дописавши їїр