How to retrieve nested field values in a single Frappe API request?

I’m trying to retrieve nested field values from a Frappe API endpoint in a single request.

When I call:

/api/resource/Evenement?fields=[“qualification.nom”, “status.nom”]&limit=10&as_dict=true

I only get:

{
“data”: [
{“nom”: “Draft”},
{“nom”: “Draft”},
{“nom”: “Draft”}
]
}

It seems like it’s returning the nom field, but not indicating whether it’s from qualification or status, and the nested fields don’t appear to be resolved properly. It looks like only the top-level fields are returned correctly.

What I’m trying to achieve:
Get the values of qualification.nom and status.nom for each Evenement in one request.

Questions:

Is there a way to get the values of linked documents' fields (like qualification.nom and status.nom) directly from the main /api/resource/Evenement endpoint?

If not, what's the recommended way to get those values efficiently without doing a separate request for each document?

Any help appreciated!

If you have a custom app, create a custom whitelisted method in your doctype or api.py in your app directory

If you are customizing Frappe then you can use Server Script to create custom api endpoints

(Check the documentation at the Server Script doctype in the UI to understand how to retrieve params)

Hello :wave:,

You cannot retrive that nested details using frappe inbuilt APIs, at the place of that create your own API in the frappe using @frappe.whitelist()

And return the as nested as much you need in that API