how to get rest URL in Magento2How to integrate Payment gateway with Magento 2 REST API?Magento2: How to update the product price programaticallySign Up With Avatar REST API Validation Error : Magento 2Magento 2: Plugin class does not existMagento Core doesnt work after transferMagento2 REST API get all customers detailsError Database Magento 2.3 migration from localhost to serverMagento2: how to develop rest API to get new products“Unable to save stock item” error when using /v1/products REST callMagento2 Sharing product link for WhatsApp Web with bitly link

Was Switzerland really impossible to invade during WW2?

Why did MS-DOS applications built using Turbo Pascal fail to start with a division by zero error on faster systems?

Can pay be witheld for hours cleaning up after closing time?

Brexit and backstop: would changes require unanimous approval by all EU countries? Does Ireland hold a veto?

Does an object count as "being moved" when placed in a Bag of Holding before its wielder moves, and then after moving they take the object out again?

How would a situation where rescue is impossible be handled by the crew?

Why don't we use Cavea-B

Check in to 2 hotels at same location

Avoiding racist tropes in fantasy

Why does The Ancient One think differently about Doctor Strange in Endgame than the film Doctor Strange?

Justifying the use of directed energy weapons

Is there a known non-euclidean geometry where two concentric circles of different radii can intersect? (as in the novel "The Universe Between")

LeetCode: Pascal's Triangle C#

Why aren't RCS openings an issue for spacecraft heat shields?

Verb form to finish someone else's sentence?

Fancy String Replace

How to persuade recruiters to send me the Job Description?

What to say to a student who has failed?

Why is Boris Johnson visiting only Paris & Berlin if every member of the EU needs to agree on a withdrawal deal?

IndexOptimize - Configuration

How should I face my manager if I make a mistake because a senior coworker explained something incorrectly to me?

How big would a Daddy Longlegs Spider need to be to kill an average Human?

Is “I am getting married with my sister” ambiguous?

Why we don't have vaccination against all diseases which are caused by microbes?



how to get rest URL in Magento2


How to integrate Payment gateway with Magento 2 REST API?Magento2: How to update the product price programaticallySign Up With Avatar REST API Validation Error : Magento 2Magento 2: Plugin class does not existMagento Core doesnt work after transferMagento2 REST API get all customers detailsError Database Magento 2.3 migration from localhost to serverMagento2: how to develop rest API to get new products“Unable to save stock item” error when using /v1/products REST callMagento2 Sharing product link for WhatsApp Web with bitly link






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I need to get a link of this kindhttp://localhost/Magento2/rest
I have a code by which I get base_url:



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$storeManager = $objectManager->get('MagentoStoreModelStoreManagerInterface');
$baseUrl = $storeManager->getStore()->getBaseUrl


So i get http://localhost/Magento2/,but i need http://localhost/Magento2/rest.Help find a solution, please










share|improve this question






























    0















    I need to get a link of this kindhttp://localhost/Magento2/rest
    I have a code by which I get base_url:



    $objectManager = MagentoFrameworkAppObjectManager::getInstance();
    $storeManager = $objectManager->get('MagentoStoreModelStoreManagerInterface');
    $baseUrl = $storeManager->getStore()->getBaseUrl


    So i get http://localhost/Magento2/,but i need http://localhost/Magento2/rest.Help find a solution, please










    share|improve this question


























      0












      0








      0








      I need to get a link of this kindhttp://localhost/Magento2/rest
      I have a code by which I get base_url:



      $objectManager = MagentoFrameworkAppObjectManager::getInstance();
      $storeManager = $objectManager->get('MagentoStoreModelStoreManagerInterface');
      $baseUrl = $storeManager->getStore()->getBaseUrl


      So i get http://localhost/Magento2/,but i need http://localhost/Magento2/rest.Help find a solution, please










      share|improve this question














      I need to get a link of this kindhttp://localhost/Magento2/rest
      I have a code by which I get base_url:



      $objectManager = MagentoFrameworkAppObjectManager::getInstance();
      $storeManager = $objectManager->get('MagentoStoreModelStoreManagerInterface');
      $baseUrl = $storeManager->getStore()->getBaseUrl


      So i get http://localhost/Magento2/,but i need http://localhost/Magento2/rest.Help find a solution, please







      magento2 url rest






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 9 at 14:54









      Anya MorozAnya Moroz

      81 bronze badge




      81 bronze badge























          2 Answers
          2






          active

          oldest

          votes


















          0













          I don't think this is available programmatically, but you can manually append 'index.php/rest/V1/' to the base URL as this should not ever change.






          share|improve this answer
































            0













            Try with Below solution:



            /**
            * @urlBuilder MagentoFrameworkUrlInterface
            */

            $urlBuilder->getUrl("rest/*/V1/");





            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%2f285014%2fhow-to-get-rest-url-in-magento2%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0













              I don't think this is available programmatically, but you can manually append 'index.php/rest/V1/' to the base URL as this should not ever change.






              share|improve this answer





























                0













                I don't think this is available programmatically, but you can manually append 'index.php/rest/V1/' to the base URL as this should not ever change.






                share|improve this answer



























                  0












                  0








                  0







                  I don't think this is available programmatically, but you can manually append 'index.php/rest/V1/' to the base URL as this should not ever change.






                  share|improve this answer













                  I don't think this is available programmatically, but you can manually append 'index.php/rest/V1/' to the base URL as this should not ever change.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 9 at 14:57









                  JamieJamie

                  1134 bronze badges




                  1134 bronze badges


























                      0













                      Try with Below solution:



                      /**
                      * @urlBuilder MagentoFrameworkUrlInterface
                      */

                      $urlBuilder->getUrl("rest/*/V1/");





                      share|improve this answer





























                        0













                        Try with Below solution:



                        /**
                        * @urlBuilder MagentoFrameworkUrlInterface
                        */

                        $urlBuilder->getUrl("rest/*/V1/");





                        share|improve this answer



























                          0












                          0








                          0







                          Try with Below solution:



                          /**
                          * @urlBuilder MagentoFrameworkUrlInterface
                          */

                          $urlBuilder->getUrl("rest/*/V1/");





                          share|improve this answer













                          Try with Below solution:



                          /**
                          * @urlBuilder MagentoFrameworkUrlInterface
                          */

                          $urlBuilder->getUrl("rest/*/V1/");






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Aug 9 at 15:05









                          Amit BeraAmit Bera

                          63.1k16 gold badges85 silver badges183 bronze badges




                          63.1k16 gold badges85 silver badges183 bronze badges






























                              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%2f285014%2fhow-to-get-rest-url-in-magento2%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

                              Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                              Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                              Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form