2

I have generated Consumer Key,Consumer Secret,Access Token & Access Token Secret. I'm not going to use OAuth. How can I integrate with PHP so that I can view products or insert product in Magento. I have latest version of Magento 2.x.

Thank You!

1
  • I'm not sure about Magento 2, but I'm pretty sure you have to use OAuth if you're using the REST API Commented Jul 25, 2016 at 1:11

1 Answer 1

1

You need to create Integrations for that

Admin => System => Extensions :: Integrations => Add New Integration

assign Resource Access as per your needs and save

on save the integration you will have followings

  • Consumer Key
  • Consumer Secret
  • Access Token
  • Access Token Secret

you can use Access Token for REST API Calls in header

Authorization : Bearer nptblbtpbh5oj2aag1sdjvvwsm******

REST API Calls URL : http://yourMagento2.store/index.php/rest/

Magento2 Rest API Reference : http://devdocs.magento.com/swagger/index.html#/

you need to prefix all calls with the method you want to use

for ex: Admin Token URL :

http://yourMagento2.store/index.php/rest/V1/categories

Method : GET

Header

Authorization: Bearer nptblbtpbh5oj2aag1sdjvvwsm******

it will return JSON containing Category TREE

Sign up to request clarification or add additional context in comments.

3 Comments

I have already generating API part. Where can I find docs ? and what the URL should be ? Can you please elaborate ?
I tried using this : devdocs.magento.com/guides/m1x/api/rest/… but not working :( It is working fine for magento 1.9 but not for 2.x. Any official docs for 2.x ?
for the full API reference you can refer to devdocs.magento.com/swagger/index.html

Your Answer

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.