Can please give example to access the magento 2 api by using oauth 2
Open the System > Extensions > Integrations
Add New Integration
Set the integration Name and other settings, then specify your Magento 2 back-end password in the Your Password field
Switch to the API sidebar tab and select the resources which will be available to OAuth clients:
Press the Save button. The integration will be saved and the Integrations list will be shown again. Press the Activate link in the integration row:
A confirmation screen will be shown. Press the Allow button
The credentials screen will be shown. Use them in your third-party software to access your Magento 2 as OAuth server.
You will see:
- Consumer Key
- Consumer Secret
- Access Token
- Access Token Secret
Copy it to somewhere, then press the Done button.