You are not permitted to access this resource.Function xxxx.api.... is not whitelisted

i had try and this is error

{
    "exception": "frappe.exceptions.PermissionError",
    "exc_type": "PermissionError",
    "_exc_source": "it_asset_management (app)",
    "exc": "[\"Traceback (most recent call last):\\n  File \\\"apps/frappe/frappe/app.py\\\", line 114, in application\\n    response = frappe.api.handle(request)\\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/api/__init__.py\\\", line 49, in handle\\n    data = endpoint(**arguments)\\n           ^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/api/v1.py\\\", line 36, in handle_rpc_call\\n    return frappe.handler.handle()\\n           ^^^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/handler.py\\\", line 49, in handle\\n    data = execute_cmd(cmd)\\n           ^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/handler.py\\\", line 85, in execute_cmd\\n    return frappe.call(method, **frappe.form_dict)\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 1768, in call\\n    return fn(*args, **newargs)\\n           ^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/utils/typing_validations.py\\\", line 31, in wrapper\\n    return func(*args, **kwargs)\\n           ^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/it_asset_management/it_asset_management/api.py\\\", line 27, in update_or_create_computer_activity\\n    log.save()\\n  File \\\"apps/frappe/frappe/model/document.py\\\", line 337, in save\\n    return self._save(*args, **kwargs)\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/model/document.py\\\", line 363, in _save\\n    self.check_permission(\\\"write\\\", \\\"save\\\")\\n  File \\\"apps/frappe/frappe/model/document.py\\\", line 220, in check_permission\\n    self.raise_no_permission_to(permtype)\\n  File \\\"apps/frappe/frappe/model/document.py\\\", line 241, in raise_no_permission_to\\n    raise frappe.PermissionError\\nfrappe.exceptions.PermissionError\\n\"]",
    "_server_messages": "[\"{\\\"message\\\": \\\"User <strong>Guest</strong> does not have doctype access via role permission for document <strong>Computer Activity Logs</strong><br>User <strong>Guest</strong> does not have access to this document\\\", \\\"title\\\": \\\"Message\\\"}\"]",
    "_error_message": "Insufficient Permission for Computer Activity Logs (<strong>write</strong>)"
}

thank you

Hi @biz1990:

Are you using token?
Note that it should be provided as Base64 encoded

https://frappeframework.com/docs/user/en/guides/integration/rest_api/token_based_authentication#basic

Hope this helps.

1 Like

Thank you Jeel, vijayasuriyan, avc

i found error in api call. because i put method and function wrong. Therforce, can not call insert database. Again, Thank you very much