REST API Access Token Issues












1















I am trying to use the Magento REST API for a client to get details of customers, and orders, etc. I have setup a REST Consumer and I am trying to obtain an oauth access token and having issues. I have found a API call http://clients_magento_shop/api/rest/integration/access/token in the documentation, passing the username and password in the body, however I am getting the following error "Request does not match any route" - its like the API resource doesn't exist.



The application I am building will be a background task, so having the user login to Magento to authorize the request token isn't an option. So I have tried to fake a login and authorization by GET and POST operations through C#. This works great on a standard Magento setup but because the client is using a hosting single signon provider, I cant get to the login page to obtain the Form-Key, which is part of the login POST. Therefore I am stuck.










share|improve this question
















bumped to the homepage by Community 15 mins ago


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




















    1















    I am trying to use the Magento REST API for a client to get details of customers, and orders, etc. I have setup a REST Consumer and I am trying to obtain an oauth access token and having issues. I have found a API call http://clients_magento_shop/api/rest/integration/access/token in the documentation, passing the username and password in the body, however I am getting the following error "Request does not match any route" - its like the API resource doesn't exist.



    The application I am building will be a background task, so having the user login to Magento to authorize the request token isn't an option. So I have tried to fake a login and authorization by GET and POST operations through C#. This works great on a standard Magento setup but because the client is using a hosting single signon provider, I cant get to the login page to obtain the Form-Key, which is part of the login POST. Therefore I am stuck.










    share|improve this question
















    bumped to the homepage by Community 15 mins ago


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


















      1












      1








      1








      I am trying to use the Magento REST API for a client to get details of customers, and orders, etc. I have setup a REST Consumer and I am trying to obtain an oauth access token and having issues. I have found a API call http://clients_magento_shop/api/rest/integration/access/token in the documentation, passing the username and password in the body, however I am getting the following error "Request does not match any route" - its like the API resource doesn't exist.



      The application I am building will be a background task, so having the user login to Magento to authorize the request token isn't an option. So I have tried to fake a login and authorization by GET and POST operations through C#. This works great on a standard Magento setup but because the client is using a hosting single signon provider, I cant get to the login page to obtain the Form-Key, which is part of the login POST. Therefore I am stuck.










      share|improve this question
















      I am trying to use the Magento REST API for a client to get details of customers, and orders, etc. I have setup a REST Consumer and I am trying to obtain an oauth access token and having issues. I have found a API call http://clients_magento_shop/api/rest/integration/access/token in the documentation, passing the username and password in the body, however I am getting the following error "Request does not match any route" - its like the API resource doesn't exist.



      The application I am building will be a background task, so having the user login to Magento to authorize the request token isn't an option. So I have tried to fake a login and authorization by GET and POST operations through C#. This works great on a standard Magento setup but because the client is using a hosting single signon provider, I cant get to the login page to obtain the Form-Key, which is part of the login POST. Therefore I am stuck.







      api rest access






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 11 '17 at 10:59









      Teja Bhagavan Kollepara

      2,94841847




      2,94841847










      asked Aug 11 '17 at 10:56









      WayneWayne

      111




      111





      bumped to the homepage by Community 15 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 15 mins ago


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
























          1 Answer
          1






          active

          oldest

          votes


















          0














          You have to pass url like,




          http://clients_magento_shop/rest/V1/integration/admin/token




          Pass body method like this,



          Post Method:



          Body:
          {
          "username":"admin",
          "password":"admin123"
          }





          share|improve this answer
























          • Thanks for the update Rakesh. There is something very weird here. I do have a access token provided by the client. If I use this do call customers or any other resource to format of the url is: clients_magento_shop/api/rest/resource however all the doc's and your example has clients_magento_shop/rest/V1/resource. If I use your format I get a 404 Note Found error :-(

            – Wayne
            Aug 11 '17 at 11:32













          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%2f188809%2frest-api-access-token-issues%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














          You have to pass url like,




          http://clients_magento_shop/rest/V1/integration/admin/token




          Pass body method like this,



          Post Method:



          Body:
          {
          "username":"admin",
          "password":"admin123"
          }





          share|improve this answer
























          • Thanks for the update Rakesh. There is something very weird here. I do have a access token provided by the client. If I use this do call customers or any other resource to format of the url is: clients_magento_shop/api/rest/resource however all the doc's and your example has clients_magento_shop/rest/V1/resource. If I use your format I get a 404 Note Found error :-(

            – Wayne
            Aug 11 '17 at 11:32


















          0














          You have to pass url like,




          http://clients_magento_shop/rest/V1/integration/admin/token




          Pass body method like this,



          Post Method:



          Body:
          {
          "username":"admin",
          "password":"admin123"
          }





          share|improve this answer
























          • Thanks for the update Rakesh. There is something very weird here. I do have a access token provided by the client. If I use this do call customers or any other resource to format of the url is: clients_magento_shop/api/rest/resource however all the doc's and your example has clients_magento_shop/rest/V1/resource. If I use your format I get a 404 Note Found error :-(

            – Wayne
            Aug 11 '17 at 11:32
















          0












          0








          0







          You have to pass url like,




          http://clients_magento_shop/rest/V1/integration/admin/token




          Pass body method like this,



          Post Method:



          Body:
          {
          "username":"admin",
          "password":"admin123"
          }





          share|improve this answer













          You have to pass url like,




          http://clients_magento_shop/rest/V1/integration/admin/token




          Pass body method like this,



          Post Method:



          Body:
          {
          "username":"admin",
          "password":"admin123"
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 11 '17 at 11:02









          Rakesh JesadiyaRakesh Jesadiya

          29.3k1573120




          29.3k1573120













          • Thanks for the update Rakesh. There is something very weird here. I do have a access token provided by the client. If I use this do call customers or any other resource to format of the url is: clients_magento_shop/api/rest/resource however all the doc's and your example has clients_magento_shop/rest/V1/resource. If I use your format I get a 404 Note Found error :-(

            – Wayne
            Aug 11 '17 at 11:32





















          • Thanks for the update Rakesh. There is something very weird here. I do have a access token provided by the client. If I use this do call customers or any other resource to format of the url is: clients_magento_shop/api/rest/resource however all the doc's and your example has clients_magento_shop/rest/V1/resource. If I use your format I get a 404 Note Found error :-(

            – Wayne
            Aug 11 '17 at 11:32



















          Thanks for the update Rakesh. There is something very weird here. I do have a access token provided by the client. If I use this do call customers or any other resource to format of the url is: clients_magento_shop/api/rest/resource however all the doc's and your example has clients_magento_shop/rest/V1/resource. If I use your format I get a 404 Note Found error :-(

          – Wayne
          Aug 11 '17 at 11:32







          Thanks for the update Rakesh. There is something very weird here. I do have a access token provided by the client. If I use this do call customers or any other resource to format of the url is: clients_magento_shop/api/rest/resource however all the doc's and your example has clients_magento_shop/rest/V1/resource. If I use your format I get a 404 Note Found error :-(

          – Wayne
          Aug 11 '17 at 11:32




















          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%2f188809%2frest-api-access-token-issues%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

          Alcázar de San Juan

          Griza ansero

          Heinkel He 51