as I am using erpnext and I have created vue js form, from where am calling the erpnext api’s which are working fine
but I am having custom requirement for addition api’s , so I have created on folder as custom_api user erpnext app and inside it I have created a subfolder name as Items which contains python file which is use for api call
but as per the documentation
Remote Method Calls
GET /api/method/erp.auth.get_logged_user
example /api/method/erpnext.custom_api.items.item_api.get_all_items
but I want to call it like /api/v1/items
to the get_all_items
for which I have made the changes in
hooks.py
under
override_whitelisted_methods
override_whitelisted_methods = {
“frappe.www.contact.send_message”: “erpnext.templates.utils.send_message”,
“erpnext.custom_api.items.item_api.get_all_items”: “erpnext.custom_api.items.item_api.get_all_items”
}
and also made changes in
website_route_rules
website_route_rules = [
{“from_route”: “/api/v1/items”, “to_route”: “erpnext.custom_api.items.item_api.get_all_items”}
]
but I am getting not found error when calling /api/v1/items
to the get_all_items