0

I am using REST API for some product insertion process in my Controller File and i will used that Access Token to generate the token.

enter image description here

Is it good to use that on my Live Website Code If not then what is the correct way to insert product using REST API

As I have seen using this API to generate token http://127.0.0.1/magento/rest/default/V1/integration/admin/token but it requirs admin username and password so, i think it is not good to share that password in Code.

So i want just the correct approach to use REST API in my Live Website to generate token.

Any help is appriciated.

0

You can use the Integration tokens

Use the following steps to generate an access token:

  1. Log in to Admin and click System > Extensions > Integrations to display the Integrations page.

  2. Click Add New Integration to display the New Integration page.

  3. Enter a unique name for the integration in the Name field. Then enter your admin password in the Your Password field. Leave all other fields blank.

  4. Click the API tab. Select the Magento resources the integration can access. You can select all resources, or select a custom list.

  5. Click Save to save your changes and return to the Integrations page.

  6. Click the Activate link in the grid that corresponds to the newly-created integration.

  7. Click Allow.

You can store this access token value in the system configuration and fetch it in code.

Reference link

1
  • Thanks for your response I have added a screen shot in my question about Integration Details And i have used that Access Token in Magento 2 please tell me i am correct.
    – Prits
    Mar 23 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.