Magento 2 - Customer/Token Rest API issue





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







2















Customer is signup through rest api in magento 2.3 successfully. after signup, I am unable to get customer's token through customer/token rest api.



Api returns following error:



enter image description here



Any help, experience and knowledge sharing would be appreciated.










share|improve this question























  • Hello @Muhammad, magefms is right 'all' shouldn't be there in URL and in devdocs devdocs.magento.com/guides/v2.3/get-started/authentication/… there is also the url without "all" key word

    – Aaditya
    yesterday






  • 1





    @Aaditya POST <host>/rest/<store_code>/V1/integration/customer/token. You can also this in devdocs in endpoint detail. Thanks for the comment

    – Muhammad Hasham
    yesterday













  • Yes totally agree /rest/english/V1/integration/customer/token I have Eglish store name which is working fine, Do you have store named "all" ?

    – Aaditya
    yesterday






  • 1





    and If you haven't configure then you can go with /rest/default/V1/integration/customer/token

    – Aaditya
    yesterday






  • 1





    @Aaditya that's the thing I am looking for. Nice point Yes It is for default. Now you got it

    – Muhammad Hasham
    yesterday




















2















Customer is signup through rest api in magento 2.3 successfully. after signup, I am unable to get customer's token through customer/token rest api.



Api returns following error:



enter image description here



Any help, experience and knowledge sharing would be appreciated.










share|improve this question























  • Hello @Muhammad, magefms is right 'all' shouldn't be there in URL and in devdocs devdocs.magento.com/guides/v2.3/get-started/authentication/… there is also the url without "all" key word

    – Aaditya
    yesterday






  • 1





    @Aaditya POST <host>/rest/<store_code>/V1/integration/customer/token. You can also this in devdocs in endpoint detail. Thanks for the comment

    – Muhammad Hasham
    yesterday













  • Yes totally agree /rest/english/V1/integration/customer/token I have Eglish store name which is working fine, Do you have store named "all" ?

    – Aaditya
    yesterday






  • 1





    and If you haven't configure then you can go with /rest/default/V1/integration/customer/token

    – Aaditya
    yesterday






  • 1





    @Aaditya that's the thing I am looking for. Nice point Yes It is for default. Now you got it

    – Muhammad Hasham
    yesterday
















2












2








2


1






Customer is signup through rest api in magento 2.3 successfully. after signup, I am unable to get customer's token through customer/token rest api.



Api returns following error:



enter image description here



Any help, experience and knowledge sharing would be appreciated.










share|improve this question














Customer is signup through rest api in magento 2.3 successfully. after signup, I am unable to get customer's token through customer/token rest api.



Api returns following error:



enter image description here



Any help, experience and knowledge sharing would be appreciated.







magento2 customer magento2.3 rest-api token






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked yesterday









Muhammad HashamMuhammad Hasham

2,9252931




2,9252931













  • Hello @Muhammad, magefms is right 'all' shouldn't be there in URL and in devdocs devdocs.magento.com/guides/v2.3/get-started/authentication/… there is also the url without "all" key word

    – Aaditya
    yesterday






  • 1





    @Aaditya POST <host>/rest/<store_code>/V1/integration/customer/token. You can also this in devdocs in endpoint detail. Thanks for the comment

    – Muhammad Hasham
    yesterday













  • Yes totally agree /rest/english/V1/integration/customer/token I have Eglish store name which is working fine, Do you have store named "all" ?

    – Aaditya
    yesterday






  • 1





    and If you haven't configure then you can go with /rest/default/V1/integration/customer/token

    – Aaditya
    yesterday






  • 1





    @Aaditya that's the thing I am looking for. Nice point Yes It is for default. Now you got it

    – Muhammad Hasham
    yesterday





















  • Hello @Muhammad, magefms is right 'all' shouldn't be there in URL and in devdocs devdocs.magento.com/guides/v2.3/get-started/authentication/… there is also the url without "all" key word

    – Aaditya
    yesterday






  • 1





    @Aaditya POST <host>/rest/<store_code>/V1/integration/customer/token. You can also this in devdocs in endpoint detail. Thanks for the comment

    – Muhammad Hasham
    yesterday













  • Yes totally agree /rest/english/V1/integration/customer/token I have Eglish store name which is working fine, Do you have store named "all" ?

    – Aaditya
    yesterday






  • 1





    and If you haven't configure then you can go with /rest/default/V1/integration/customer/token

    – Aaditya
    yesterday






  • 1





    @Aaditya that's the thing I am looking for. Nice point Yes It is for default. Now you got it

    – Muhammad Hasham
    yesterday



















Hello @Muhammad, magefms is right 'all' shouldn't be there in URL and in devdocs devdocs.magento.com/guides/v2.3/get-started/authentication/… there is also the url without "all" key word

– Aaditya
yesterday





Hello @Muhammad, magefms is right 'all' shouldn't be there in URL and in devdocs devdocs.magento.com/guides/v2.3/get-started/authentication/… there is also the url without "all" key word

– Aaditya
yesterday




1




1





@Aaditya POST <host>/rest/<store_code>/V1/integration/customer/token. You can also this in devdocs in endpoint detail. Thanks for the comment

– Muhammad Hasham
yesterday







@Aaditya POST <host>/rest/<store_code>/V1/integration/customer/token. You can also this in devdocs in endpoint detail. Thanks for the comment

– Muhammad Hasham
yesterday















Yes totally agree /rest/english/V1/integration/customer/token I have Eglish store name which is working fine, Do you have store named "all" ?

– Aaditya
yesterday





Yes totally agree /rest/english/V1/integration/customer/token I have Eglish store name which is working fine, Do you have store named "all" ?

– Aaditya
yesterday




1




1





and If you haven't configure then you can go with /rest/default/V1/integration/customer/token

– Aaditya
yesterday





and If you haven't configure then you can go with /rest/default/V1/integration/customer/token

– Aaditya
yesterday




1




1





@Aaditya that's the thing I am looking for. Nice point Yes It is for default. Now you got it

– Muhammad Hasham
yesterday







@Aaditya that's the thing I am looking for. Nice point Yes It is for default. Now you got it

– Muhammad Hasham
yesterday












2 Answers
2






active

oldest

votes


















1














For customer token if you want it store wise then you need to pass store_code in the API url



POST <host>/rest/<store_code>/V1/integration/customer/token


But if you haven't configure any stores then pass default



POST <host>/rest/default/V1/integration/customer/token


And to fetch all store data using API




storeStoreRepositoryV1






Group repository interface



http://magento.host/index.php/rest/V1/store/storeGroups



  • method : GET

  • Authorization : Bearer <admin token>


This will return website_id, root_category_id, default_store_id, name, code









share|improve this answer































    1














    Instead of using /rest/all/V1/integration/customer/token

    use this endpoint /rest/V1/integration/customer/token and you will get token.






    share|improve this answer
























    • It should be /rest/all/V1. check the endpoint detail in documentation. A combination of the server that fulfills the request, the web service, and the resource against which the request is being made. For example, in the POST <host>/rest/<store_code>/V1/integration/customer/token endpoint: The server is magento.host/index.php/, the web service is rest. and the resource is /V1/integration/customer/token.

      – Muhammad Hasham
      yesterday











    • okay just want to share what works as per my experience

      – magefms
      yesterday






    • 1





      Thanks for the answer. Really appreciated.

      – Muhammad Hasham
      yesterday












    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%2f270247%2fmagento-2-customer-token-rest-api-issue%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









    1














    For customer token if you want it store wise then you need to pass store_code in the API url



    POST <host>/rest/<store_code>/V1/integration/customer/token


    But if you haven't configure any stores then pass default



    POST <host>/rest/default/V1/integration/customer/token


    And to fetch all store data using API




    storeStoreRepositoryV1






    Group repository interface



    http://magento.host/index.php/rest/V1/store/storeGroups



    • method : GET

    • Authorization : Bearer <admin token>


    This will return website_id, root_category_id, default_store_id, name, code









    share|improve this answer




























      1














      For customer token if you want it store wise then you need to pass store_code in the API url



      POST <host>/rest/<store_code>/V1/integration/customer/token


      But if you haven't configure any stores then pass default



      POST <host>/rest/default/V1/integration/customer/token


      And to fetch all store data using API




      storeStoreRepositoryV1






      Group repository interface



      http://magento.host/index.php/rest/V1/store/storeGroups



      • method : GET

      • Authorization : Bearer <admin token>


      This will return website_id, root_category_id, default_store_id, name, code









      share|improve this answer


























        1












        1








        1







        For customer token if you want it store wise then you need to pass store_code in the API url



        POST <host>/rest/<store_code>/V1/integration/customer/token


        But if you haven't configure any stores then pass default



        POST <host>/rest/default/V1/integration/customer/token


        And to fetch all store data using API




        storeStoreRepositoryV1






        Group repository interface



        http://magento.host/index.php/rest/V1/store/storeGroups



        • method : GET

        • Authorization : Bearer <admin token>


        This will return website_id, root_category_id, default_store_id, name, code









        share|improve this answer













        For customer token if you want it store wise then you need to pass store_code in the API url



        POST <host>/rest/<store_code>/V1/integration/customer/token


        But if you haven't configure any stores then pass default



        POST <host>/rest/default/V1/integration/customer/token


        And to fetch all store data using API




        storeStoreRepositoryV1






        Group repository interface



        http://magento.host/index.php/rest/V1/store/storeGroups



        • method : GET

        • Authorization : Bearer <admin token>


        This will return website_id, root_category_id, default_store_id, name, code










        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        AadityaAaditya

        4,27121139




        4,27121139

























            1














            Instead of using /rest/all/V1/integration/customer/token

            use this endpoint /rest/V1/integration/customer/token and you will get token.






            share|improve this answer
























            • It should be /rest/all/V1. check the endpoint detail in documentation. A combination of the server that fulfills the request, the web service, and the resource against which the request is being made. For example, in the POST <host>/rest/<store_code>/V1/integration/customer/token endpoint: The server is magento.host/index.php/, the web service is rest. and the resource is /V1/integration/customer/token.

              – Muhammad Hasham
              yesterday











            • okay just want to share what works as per my experience

              – magefms
              yesterday






            • 1





              Thanks for the answer. Really appreciated.

              – Muhammad Hasham
              yesterday
















            1














            Instead of using /rest/all/V1/integration/customer/token

            use this endpoint /rest/V1/integration/customer/token and you will get token.






            share|improve this answer
























            • It should be /rest/all/V1. check the endpoint detail in documentation. A combination of the server that fulfills the request, the web service, and the resource against which the request is being made. For example, in the POST <host>/rest/<store_code>/V1/integration/customer/token endpoint: The server is magento.host/index.php/, the web service is rest. and the resource is /V1/integration/customer/token.

              – Muhammad Hasham
              yesterday











            • okay just want to share what works as per my experience

              – magefms
              yesterday






            • 1





              Thanks for the answer. Really appreciated.

              – Muhammad Hasham
              yesterday














            1












            1








            1







            Instead of using /rest/all/V1/integration/customer/token

            use this endpoint /rest/V1/integration/customer/token and you will get token.






            share|improve this answer













            Instead of using /rest/all/V1/integration/customer/token

            use this endpoint /rest/V1/integration/customer/token and you will get token.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered yesterday









            magefmsmagefms

            2,7252528




            2,7252528













            • It should be /rest/all/V1. check the endpoint detail in documentation. A combination of the server that fulfills the request, the web service, and the resource against which the request is being made. For example, in the POST <host>/rest/<store_code>/V1/integration/customer/token endpoint: The server is magento.host/index.php/, the web service is rest. and the resource is /V1/integration/customer/token.

              – Muhammad Hasham
              yesterday











            • okay just want to share what works as per my experience

              – magefms
              yesterday






            • 1





              Thanks for the answer. Really appreciated.

              – Muhammad Hasham
              yesterday



















            • It should be /rest/all/V1. check the endpoint detail in documentation. A combination of the server that fulfills the request, the web service, and the resource against which the request is being made. For example, in the POST <host>/rest/<store_code>/V1/integration/customer/token endpoint: The server is magento.host/index.php/, the web service is rest. and the resource is /V1/integration/customer/token.

              – Muhammad Hasham
              yesterday











            • okay just want to share what works as per my experience

              – magefms
              yesterday






            • 1





              Thanks for the answer. Really appreciated.

              – Muhammad Hasham
              yesterday

















            It should be /rest/all/V1. check the endpoint detail in documentation. A combination of the server that fulfills the request, the web service, and the resource against which the request is being made. For example, in the POST <host>/rest/<store_code>/V1/integration/customer/token endpoint: The server is magento.host/index.php/, the web service is rest. and the resource is /V1/integration/customer/token.

            – Muhammad Hasham
            yesterday





            It should be /rest/all/V1. check the endpoint detail in documentation. A combination of the server that fulfills the request, the web service, and the resource against which the request is being made. For example, in the POST <host>/rest/<store_code>/V1/integration/customer/token endpoint: The server is magento.host/index.php/, the web service is rest. and the resource is /V1/integration/customer/token.

            – Muhammad Hasham
            yesterday













            okay just want to share what works as per my experience

            – magefms
            yesterday





            okay just want to share what works as per my experience

            – magefms
            yesterday




            1




            1





            Thanks for the answer. Really appreciated.

            – Muhammad Hasham
            yesterday





            Thanks for the answer. Really appreciated.

            – Muhammad Hasham
            yesterday


















            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%2f270247%2fmagento-2-customer-token-rest-api-issue%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:香港粉麵

            List *all* the tuples!

            Channel [V]