Java – Magento rest “admin role not found” error
•
Java
I'm playing with the transcription library( https://github.com/fernandezpablo85/scribe-java ), I tried to access Magento store products, but I faced some problems (this may be Magento configuration)
I use 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 always get this response:
{"messages":{"error":[{"code":0,"message":"Admin role not found"}]}}
I'm missing what
Solution
I found a solution
You should go to Magento admin – > system – > permissions – > users – > edit your users and grant them "Administrator" permission in the "rest role" tab
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码