Permission Error (Not Whitelisted)

Sorry I am just a beginner with very little coding experience. I keep getting whitelisted errors when calling functions which say they are whitelisted. For example when I call /api/method/erpnext.stock.get_item_details.get_item_details I get:

{
“exc_type”: “PermissionError”,
“exception”: “frappe.exceptions.PermissionError:

You are not permitted to access this resource.Function erpnext.stock.get_item_details.get_item_details is not whitelisted.
”,
“exc”: “["Traceback (most recent call last):\n File \"apps/frappe/frappe/app.py\", line 66, in application\n response = frappe.api.handle()\n File \"apps/frappe/frappe/api.py\", line 54, in handle\n return frappe.handler.handle()\n File \"apps/frappe/frappe/handler.py\", line 45, in handle\n data = execute_cmd(cmd)\n File \"apps/frappe/frappe/handler.py\", line 80, in execute_cmd\n is_whitelisted(method)\n File \"apps/frappe/frappe/init.py\", line 772, in is_whitelisted\n throw(msg, PermissionError, title=\"Method Not Allowed\")\n File \"apps/frappe/frappe/init.py\", line 525, in throw\n msgprint(\n File \"apps/frappe/frappe/init.py\", line 493, in msgprint\n _raise_exception()\n File \"apps/frappe/frappe/init.py\", line 442, in _raise_exception\n raise raise_exception(msg)\nfrappe.exceptions.PermissionError:
You are not permitted to access this resource.Function erpnext.stock.get_item_details.get_item_details is not whitelisted.
\n"]”,
“_server_messages”: “["{\"message\": \"
You are not permitted to access this resource.Function erpnext.stock.get_item_details.get_item_details is not whitelisted.
\", \"title\": \"Method Not Allowed\", \"indicator\": \"red\", \"raise_exception\": 1}"]”
}

I can access /api/method/erpnext.stock.utils.get_stock_balance

Is there any reason for this?

I am using erpnext hosted on frappe.cloud, could that be the reason. (I have no clue about hosting and benches)

Thank you in advance

1 Like