0

I am using Magento 2.4.5  I created an Integration for my custom module. I am successful in generating the oauth_token & oauth_token_secret. But when I want to see an order using API, I get a 401 error.  API endpoint:

http://dev.magento.com/rest/V1/orders/5

API response:

"message": "The consumer isn't authorized to access %resources.",
    "parameters": {
        "resources": "Magento_Sales::actions_view"
    },

My etc/integration/api.xml & etc/integration/acl.xml is:

        <resource name="Magento_Customer::customer" />
        <resource name="Magento_Log::online" />

        <resource name="Magento_Sales::sales" />
        <resource name="Magento_Sales::sales_operation" />
        <resource name="Magento_Sales::sales_order" />
        <resource name="Magento_Sales::actions" />
        <resource name="Magento_Sales::create" />
        <resource name="Magento_Sales::actions_view" />
        <resource name="Magento_Sales::actions_edit" />

        <resource name="Magento_Catalog::catalog" />
        <resource name="Magento_Catalog::catalog_inventory" />
        <resource name="Magento_Catalog::products" />

        <resource name="Magento_Backend::stores" />
        <resource name="Magento_Backend::stores_settings" />
        <resource name="Magento_Config::config" />
        <resource name="Magento_Cms::config_cms" />
        <resource name="Magento_Catalog::config_catalog" />
        <resource name="Magento_CatalogSearch::config_catalog_search" />
        <resource name="Magento_CatalogInventory::cataloginventory" />
        <resource name="Magento_Sales::order_statuses" />

        <resource name="Magento_InventoryApi::inventory" />
        <resource name="Magento_InventoryApi::source" />
        <resource name="Magento_InventoryApi::source_edit" />
        <resource name="Magento_InventoryApi::ship_source_selection" />
        <resource name="Magento_InventoryApi::stock" />
        <resource name="Magento_InventoryApi::stock_edit" />
        <resource name="Magento_InventoryApi::stock_delete" />
        <resource name="Magento_InventorySalesApi::stock" />
        <resource name="Magento_CurrencySymbol::system_currency" />

        <resource name="Magento_Backend::stores_attributes" />
        <resource name="Magento_Catalog::attributes_attributes" />
        <resource name="Magento_Catalog::attributes_attributes" />
        <resource name="Magento_Catalog::sets" />
        <resource name="Magento_Backend::system" />
        <resource name="Magento_AdobeStockAsset::adobe_stock_asset" />
        <resource name="Magento_AdobeStockAsset::actions" />
        <resource name="Magento_AdobeStockAsset::actions_delete" />
        <resource name="Magento_AdobeStockAsset::actions_save" />
        <resource name="Magento_AdobeStockAsset::actions_view" />
        <resource name="Magento_AdobeStockAsset::actions_get" />
    </resources>
</integration>
Can anyone help me to get the order data properly?
4

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.