I tried to use Magento rest api using oauth signature or token-based, but it's a nightmare.
I followed this guide: http://devdocs.magento.com/guides/v2.2/get-started/authentication/gs-authentication-oauth.html
This other one: http://devdocs.magento.com/guides/v2.2/get-started/authentication/gs-authentication-token.html
But, I can retrieve is this message
{
message: "Client is not authorized to access resources",
parameters: "Magento_Catalog::products"
}
Even if I have admin access.
I tried to activate an integration with callback and identity link but it always says: "Failed to send the necessary data due to an unexpected error"
I' m using a node.js app and I'm trying to retrieve products, but nothing seems to work, I actually don't have an identity link, what does it mean " application login's page " ? I don't have an application login page.
Any help would be appreciated.
1 Answer 1
I had the same problem, as you said is a nightmare. But I found a great application who helped me to fix this problem. The name is POSTMAN. With this app I just create this lines of code that I hope will help you.
var request = require("request");
var options = { method: 'GET',
url: 'http://www.yourlink.com/index.php/rest/V1/modules',
headers:
{ 'Postman-Token': 'YOUR TOKEN',
'Cache-Control': 'no-cache',
'User-Agent': 'Mozilla/4.0 (compatible)',
'Content-Type': 'application/json' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});