Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento Rest "Admin role not found" error

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?

like image 503
MatheusJardimB Avatar asked Feb 02 '13 15:02

MatheusJardimB


1 Answers

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.

like image 118
MatheusJardimB Avatar answered Nov 02 '22 05:11

MatheusJardimB