MatheusJardimB MatheusJardimB - 1 year ago 350
Java Question

Magento Rest "Admin role not found" error

I'm playing with scribe library (, 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();

But I'm always receiving this response:

{"messages":{"error":[{"code":0,"message":"Admin role not found"}]}}

What am I missing?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download