when we fetch product, error exist like this ‘Invalid auth/bad request (got a 403, expected HTTP/1.1 20X or a redirect)’ in magento.
My code is below.
$resourceUrl = "http://localhost/magento/api/rest/products";
$oauthClient->fetch($resourceUrl, array(), 'GET', array('Content-Type' => 'application/json'));
$productsList = json_decode($oauthClient->getLastResponse());
I was completed the user authentication by this url
http://www.magentocommerce.com/api/rest/authentication/oauth_authentication.html.
please solve my problem..
You want to give access permission to Customer/Guest.
Follow this step..
Go to magento admin panel System->Webservice->RESt Roles->Customer->Resources Access ->SET ALL
and also Go to System->Webservice->RESt Roles->Guest->Resources Access ->SET ALL
Similarly Go to System->Webservice->RESt Attribute->Customer->Resources Access ->SET ALL
and also Go to System->Webservice->RESt Attribute->Guest->Resources Access ->SET ALL
Now check that there is product in your magento and also assign Websites(e.g Main Website) to product.
now print $productsList that is display in question and you will see all product array.