Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

enter image description here I am new to magento and trying to get response from magento rest api but I can't.

Initially I get authorization key by passing username, password

Now I want to list all categories.

In Authorization I used Bearer Token, In Headers Content-Type:application/json but I got

"message": "\"%fieldName\" is required. Enter and try again.", "parameters": { "fieldName": "category"

I am trying to get category list. Is anything I should pass in body?

I added image. I don't know what to add in body content. Is anything I missed in this request? Sridhar G Nov 5, 2020 at 9:46 oh. I see.Sorry. I cant help. You shoud reseach for magento rest api and how to use postman to test api. Mai Truong Nov 5, 2020 at 9:50

First of all must have user and password of Magento Repository. For bring them, login in Magento Marketplace, Click your account name in the top-right of the page and select My Profile, click Access Keys in the Marketplace tab.

Click Create a New Access Key. Enter a specific name for the keys and click OK. Use the Public key as your username and the Private key as your password.

Now we can call our first root, insert in the url input the url below and as method select “POST”:

http://yourdomain.com/rest/V1/integration/admin/token?username=developer.beprime&password= )K!mMcq2rVW (autenticazione) ( no-auth ) From this call Magento answer wit a token, es: “e18te890ntzj0eww19mglsvhsremyny4”.

You must copy and paste this token in “Authorization” tab, by selecting in select box (TYPE) on left “Bearer Token”.

Now in the url input insert https://yourdomain.com/rest/V1/customers/1954 (last parameter is the user id for witch you want have API, you find it in Magento Admin under “customers” menu ), and as method select “GET”

Ince Magento answer with the customer json, you can download it ( by click on “download” button ), or you can save the call for future quick access ( button “save” ).

For show all Magento root: https://yourdomain.com/swagger

Thanks for contributing an answer to Stack Overflow!

  • 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 .