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

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

                              Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                              Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?