PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, August 23, 2022

[FIXED] How to get all categories using REST API without any login or token in magento 2?

 August 23, 2022     magento2     No comments   

Issue

Using Admin Token categories will comes in rest API but without token not working any solution on to how to get all categories without token in magento 2


Solution

By default, Magento 2 allows access without authentication for few endpoints, which are declared as anonymous resources. For example, V1/directory/currency and V1/directory/countries can be accessed without any authentication.

But, When Users need to access to non-anonymous endpoints. This option (Allow Anonymous Guest Access) must be enabled:

Stores > Settings > Configuration > Services > Magento Web API > Web API Security > Allow Anonymous Guest Access

Now, It is possible to get the categories without authentication by using this endpoint.

http://example.com/rest/V1/categories

Note: It is not recommended to use Magento 2 REST API without authentication.



Answered By - Milan Chandro
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing