Skip to content

magento 2.4.3 api “the consumer isn’t authorized to access %resources” error”

I’m trying to call magento api from an external chat bot for customer service.
For testing purposes, I’m using default magento get call on order (/V1/orders/{id} ).

If I create an admin (or customer) token (POST /V1/integration/admin/token), then my GET /V1/orders/{id} call is successful and I can see the order details for the given order id.

But if instead of using an admin/customer token I try to use an integration token, then my GET call gives an error “consumer is not authorized to access % resource” and the resource in question is “magento_sales::action_view”.

I’ve also edit my integration token to select ALL api from resource access — not ideal but just to test if it works — but it doesn’t work either, I get the same error.

My question is:

how can I use the integration token only (which means: without calling the admin/customer token, which I cannot do from the external chatbot) ?

and what’s the use of the integration token if I have to call the admin/customer token anyway (which can work without the integration token so if I could I would just call them instead of the integration token) ?

Do I have to create a module/etc/webapi.xml? shouldn’t be already fine, since it is a magento default api?

Thanks

PS: my current magento version is 2.4.3