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.

Muhammad Anas
1,4673 gold badges13 silver badges33 bronze badges
asked Apr 16, 2019 at 6:46
7
  • 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 Commented Apr 16, 2019 at 7:30
  • 6
    @Aaditya POST <host>/rest/<store_code>/V1/integration/customer/token. You can also this in devdocs in endpoint detail. Thanks for the comment Commented Apr 16, 2019 at 7:32
  • 1
    Yes totally agree /rest/english/V1/integration/customer/token I have Eglish store name which is working fine, Do you have store named "all" ? Commented Apr 16, 2019 at 7:34
  • 2
    and If you haven't configure then you can go with /rest/default/V1/integration/customer/token Commented Apr 16, 2019 at 7:35
  • 2
    @Aaditya that's the thing I am looking for. Nice point Yes It is for default. Now you got it Commented Apr 16, 2019 at 7:53

2 Answers 2

2

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


answered Apr 16, 2019 at 7:59
1

Instead of using /rest/all/V1/integration/customer/token
use this endpoint /rest/V1/integration/customer/token and you will get token.

answered Apr 16, 2019 at 7:01
2
  • 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. Commented Apr 16, 2019 at 7:08
  • okay just want to share what works as per my experience Commented Apr 16, 2019 at 7:14

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.