How to create custom api/route in hooks.py?

I have this api
http://erp.pie16.com:8000/api/method/subcontractor_account.api.support_ticket.get_tickets

I want coustom route or api for this in
http://erp.pie16.com:8000/api/v1/support_ticket

how to achieve this?

Using server script

  • Create an API server script support _ticket
  • inside that method use frappe.call(“path to your original method”)

@vijaywm could you explain or show me in code?

closest you can get I think is

this will be available in /api/method/support_ticket …
if you need exactly /api/v1/support_ticket try redirect rules in hooks.py

1 Like

/api/v1/support_ticket is my priority api