Finding records using doctype and field names of models

How to find by some field from tables ? Please point to api’s with some example.

thanks!

Set Up > Doc Type page has the data you are looking for, is there any specific purpose you need an API?

wanted to search for Lead by either email / phone / or any other field for now. But might need the same for other docTypes. Guessing should be same for all of them.

let me know what is the API for that. The page you mentioned have the table details, not the api I need to call to fetch the lead using mobile/email/ etc…

thanks!

Here is the link to ERPNext API’s.

https://frappe.github.io/erpnext/current/api/frappe.client

The one you are looking for is:
frappe.client.get (doctype, name=None, filters=None)

if I want to search by email, is this the only change ?

frappe.client.get(“Lead”, email="some@email.com", filters = None)

frappe.client.get("Lead", frm.doc.name, filters = {email:"some@email.com"})

Something like this.

what will be format (of parameters) if want to hit the rest end point ( /api/method/frappe.client.get ) ?

You could refer to this link and see if it helps.

What exactly do you mean by this?