HI,
All of a sudden i'm getting this error "magento Consumer is not authorized to access resources". Before it worked nicely. I have made rest api callout to get the data. suddenly it is throwing the Error
{ "message": "Consumer is not authorized to access %resources", "parameters": { "resources": "Magento_Catalog:roducts" } }
Requested Query:-
http://host/magento2/rest/V1/products?searchCriteria=0
please help me... Thanks in advance...!
Hello,
How are you trying to access, Postman or curl? Please share details.
Issue you are facing any specific API or facing in all API's. Please try to run get token api and check token is expired or working.
Click on Kudos if it works for you. Cheers coding
The main reason behind this is , your accesstoken gets expired - so kindly generate a new accesstoken and add it again to that rest api !
Then it will start working again same like previously it works !
Hope it helps
thanks for the reply.... I have created integration through admin panel and generated Access token, Access token secret, Consumer key Consumer secret. So I have pulled all the products data using this Query "http://xxx/xxx/rest/V1/products?searchCriteria=0". it works fine. when I try to Query products by updated using the query
http://XXXXXXXXXX/XXXXXXX/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=updated_at&searchCriteria[filter_groups][0][filters][0][value]=2018-08-24 08:35:37"
I can't able to get the data with it.
So using this searchCriteria you are still facing the same error ? consumer is not authorized access ? -
Hi @Manthan Dave,
In the postman, I tried to make a callout with filter criteria and search criteria then it returns me
{ "message": "Consumer is not authorized to access %resources", "parameters": { "resources": "Magento_Catalog::products" }
But from salesforce when I make callout with only search criteria it gives me data with no error. But when I included the filter criteria it returns me
{"message":"Invalid signature"}
}
So in the POSTMAN , have you passed the access token - on the header part ?
Like bearer your-access-token ? - because i have tested this with POSTMAN and its working at my end !
Hi @Manthan Dave,
I have tested in the postman now. it's working. but when I made callout from salesforce it gives me invalid signature. without filter criteria it is working fine in salesforce. I dont understand why it causing error with filter criteria.
Hello @harish_padala,
Please make sure you have given access catalog resource in API tab for api user. Check here
--
If my answer is useful, please Accept as Solution & give Kudos
ok i understand , if its working in postman that something is missing in the parameters on your curl API call.
Invalid signature - means something you have wrong pass in parameters or something is missing !