You get the consumer isn’t authorized to access resources in the REST API response. This issue is due the Magento version upgrade from Magento 2.3.x to Magento 2.4.5 and above. We also faced the same issue when we upgraded one of the out Adobe Commerce Cloud clients’ website from Magento 2.3.5 to Magento 2.4.5 like Magento website data stopped syncing with the ERP. If you are facing the same issue then this blog post has a solution to this REST API access problem.
Below is the response data when trying to access data using the REST API.
[message] => The consumer isn't authorized to access %resources.
[parameters] => Array
[resources] => Magento_Sales::actions_view
How to fix REST API error consumer isn’t authorized to access resources
To fix this issue just set “Yes” to “Allow OAuth Access Tokens to be used as standalone Bearer tokens”. Below is the location of this setting in the Magento admin.
Magento 2 Admin > STORES > Configuration > SERVICES > Oauth > Consumer Settings > Allow OAuth Access Tokens to be used as standalone Bearer tokens