I'm playing with scribe library (https://github.com/fernandezpablo85/scribe-java), trying to get access to a Magento store products, but I'm facing some problems (it's probably Magento configuration).
I'm using the following code:
OAuthService service = new ServiceBuilder().provider(Magento17Api.class).apiKey(MAGENTO_API_KEY).apiSecret(MAGENTO_API_SECRET).build();
OAuthRequest request = new OAuthRequest(Verb.GET, MAGENTO_REST_API_URL
+ "/products");
service.signRequest(accessToken, request);
Response response = request.send();
System.out.println(response.getBody());
But I'm always receiving this response:
{"messages":{"error":[{"code":0,"message":"Admin role not found"}]}}
What am I missing?
I found the solution...
You should go to Magento Admin -> System -> Permissions -> Users -> Edit YOUR user and give it an "admin" permission in the "Rest Role" tab.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With