Fields available when retrieving all DocTypes via Rest API

Hey guys, I have been working on an integration to add and retrieve data from ERPNext. Right now I want to retrieve all DocTypes available, which works with the endpoint https://mysubdomain.erpnext.com/api/resource/DocType?fields=["name", "description"]. However, I want to know all the fields that can be retrieved for each item, so far I know just of the existence of name and description. Is there some sort of all wildcard to retrieve all fields? or is there a place where I can see all the fields I can set on the fields array?

Thanks in advance.

Hey guys, any update here?

fields=[“*”]

We have a json schema api endpoint whereby you send a doctype name and it sends back the field names and types… could be more if you would want to do that too.

We could merge it into our CSF TZ open source app for you to pick up.

e.g.

{
"message": {
"type": "object",
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"parent": {
"type": "string"
},
"parentfield": {
"type": "string"
},
"parenttype": {
"type": "string"
},
"doctype": {
"type": "string"
},
"creation": {
"type": "string",
"format": "date-time"
},
"modified": {
"type": "string",
"format": "date-time"
},
"modified_by": {
"type": "string"
},
"owner": {
"type": "string"
},
"idx": {
"type": "integer"
},
"docstatus": {
"type": "integer"
},
"__onload": {
"type": "integer"
},
"module": {
"type": "string"
},
"is_submittable": {
"type": "boolean"
},
"istable": {
"type": "boolean"
},
"issingle": {
"type": "boolean"
},
"is_tree": {
"type": "boolean"
},
"editable_grid": {
"type": "boolean"
},
"quick_entry": {
"type": "boolean"
},
"track_changes": {
"type": "boolean"
},
"track_seen": {
"type": "boolean"
},
"track_views": {
"type": "boolean"
},
"custom": {
"type": "boolean"
},
"beta": {
"type": "boolean"
},
"is_virtual": {
"type": "boolean"
},
"fields": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"parent": {
"type": "string"
},
"parentfield": {
"type": "string"
},
"parenttype": {
"type": "string"
},
"doctype": {
"type": "string"
},
"creation": {
"type": "string",
"format": "date-time"
},
"modified": {
"type": "string",
"format": "date-time"
},
"modified_by": {
"type": "string"
},
"owner": {
"type": "string"
},
"idx": {
"type": "integer"
},
"docstatus": {
"type": "integer"
},
"__onload": {
"type": "integer"
},
"label": {
"type": "string"
},
"fieldtype": {
"type": "string"
},
"fieldname": {
"type": "string"
},
"precision": {
"type": "string"
},
"length": {
"type": "integer"
},
"non_negative": {
"type": "boolean"
},
"hide_days": {
"type": "boolean"
},
"hide_seconds": {
"type": "boolean"
},
"reqd": {
"type": "boolean"
},
"search_index": {
"type": "boolean"
},
"in_list_view": {
"type": "boolean"
},
"in_standard_filter": {
"type": "boolean"
},
"in_global_search": {
"type": "boolean"
},
"in_preview": {
"type": "boolean"
},
"allow_in_quick_entry": {
"type": "boolean"
},
"bold": {
"type": "boolean"
},
"translatable": {
"type": "boolean"
},
"collapsible": {
"type": "boolean"
},
"collapsible_depends_on": {
"type": "string"
},
"options": {
"type": "string"
},
"default": {
"type": "string"
},
"fetch_from": {
"type": "string"
},
"fetch_if_empty": {
"type": "boolean"
},
"depends_on": {
"type": "string"
},
"hidden": {
"type": "boolean"
},
"read_only": {
"type": "boolean"
},
"unique": {
"type": "boolean"
},
"set_only_once": {
"type": "boolean"
},
"allow_bulk_edit": {
"type": "boolean"
},
"permlevel": {
"type": "integer"
},
"ignore_user_permissions": {
"type": "boolean"
},
"allow_on_submit": {
"type": "boolean"
},
"report_hide": {
"type": "boolean"
},
"remember_last_selected_value": {
"type": "boolean"
},
"ignore_xss_filter": {
"type": "boolean"
},
"hide_border": {
"type": "boolean"
},
"mandatory_depends_on": {
"type": "string"
},
"read_only_depends_on": {
"type": "string"
},
"in_filter": {
"type": "boolean"
},
"no_copy": {
"type": "boolean"
},
"print_hide": {
"type": "boolean"
},
"print_hide_if_no_value": {
"type": "boolean"
},
"print_width": {
"type": "string"
},
"width": {
"type": "string"
},
"columns": {
"type": "integer"
},
"description": {
"type": "string"
},
"oldfieldname": {
"type": "string"
},
"oldfieldtype": {
"type": "string"
},
"__unsaved": {
"type": "integer"
}
}
}
},
"autoname": {
"type": "string"
},
"name_case": {
"type": "string"
},
"allow_rename": {
"type": "boolean"
},
"description": {
"type": "string"
},
"documentation": {
"type": "string"
},
"image_field": {
"type": "string"
},
"timeline_field": {
"type": "string"
},
"nsm_parent_field": {
"type": "string"
},
"max_attachments": {
"type": "integer"
},
"hide_toolbar": {
"type": "boolean"
},
"allow_copy": {
"type": "boolean"
},
"allow_import": {
"type": "boolean"
},
"allow_events_in_timeline": {
"type": "boolean"
},
"allow_auto_repeat": {
"type": "boolean"
},
"title_field": {
"type": "string"
},
"search_fields": {
"type": "string"
},
"default_print_format": {
"type": "string"
},
"sort_field": {
"type": "string"
},
"sort_order": {
"type": "string"
},
"document_type": {
"type": "string"
},
"icon": {
"type": "string"
},
"color": {
"type": "string"
},
"show_preview_popup": {
"type": "boolean"
},
"show_name_in_global_search": {
"type": "boolean"
},
"default_email_template": {
"type": "string"
},
"email_append_to": {
"type": "boolean"
},
"sender_field": {
"type": "string"
},
"subject_field": {
"type": "string"
},
"permissions": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"parent": {
"type": "string"
},
"parentfield": {
"type": "string"
},
"parenttype": {
"type": "string"
},
"doctype": {
"type": "string"
},
"creation": {
"type": "string",
"format": "date-time"
},
"modified": {
"type": "string",
"format": "date-time"
},
"modified_by": {
"type": "string"
},
"owner": {
"type": "string"
},
"idx": {
"type": "integer"
},
"docstatus": {
"type": "integer"
},
"__onload": {
"type": "integer"
},
"role": {
"type": "string"
},
"if_owner": {
"type": "boolean"
},
"permlevel": {
"type": "integer"
},
"select": {
"type": "boolean"
},
"read": {
"type": "boolean"
},
"write": {
"type": "boolean"
},
"create": {
"type": "boolean"
},
"delete": {
"type": "boolean"
},
"submit": {
"type": "boolean"
},
"cancel": {
"type": "boolean"
},
"amend": {
"type": "boolean"
},
"report": {
"type": "boolean"
},
"export": {
"type": "boolean"
},
"import": {
"type": "boolean"
},
"set_user_permissions": {
"type": "boolean"
},
"share": {
"type": "boolean"
},
"print": {
"type": "boolean"
},
"email": {
"type": "boolean"
},
"__unsaved": {
"type": "integer"
}
}
}
},
"restrict_to_domain": {
"type": "string"
},
"read_only": {
"type": "boolean"
},
"in_create": {
"type": "boolean"
},
"actions": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"parent": {
"type": "string"
},
"parentfield": {
"type": "string"
},
"parenttype": {
"type": "string"
},
"doctype": {
"type": "string"
},
"creation": {
"type": "string",
"format": "date-time"
},
"modified": {
"type": "string",
"format": "date-time"
},
"modified_by": {
"type": "string"
},
"owner": {
"type": "string"
},
"idx": {
"type": "integer"
},
"docstatus": {
"type": "integer"
},
"__onload": {
"type": "integer"
},
"label": {
"type": "string"
},
"action_type": {
"type": "string"
},
"action": {
"type": "string"
},
"group": {
"type": "string"
},
"hidden": {
"type": "boolean"
},
"custom": {
"type": "boolean"
},
"__unsaved": {
"type": "integer"
}
}
}
},
"links": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"parent": {
"type": "string"
},
"parentfield": {
"type": "string"
},
"parenttype": {
"type": "string"
},
"doctype": {
"type": "string"
},
"creation": {
"type": "string",
"format": "date-time"
},
"modified": {
"type": "string",
"format": "date-time"
},
"modified_by": {
"type": "string"
},
"owner": {
"type": "string"
},
"idx": {
"type": "integer"
},
"docstatus": {
"type": "integer"
},
"__onload": {
"type": "integer"
},
"link_doctype": {
"type": "string"
},
"link_fieldname": {
"type": "string"
},
"parent_doctype": {
"type": "string"
},
"table_fieldname": {
"type": "string"
},
"group": {
"type": "string"
},
"hidden": {
"type": "boolean"
},
"is_child_table": {
"type": "boolean"
},
"custom": {
"type": "boolean"
},
"__unsaved": {
"type": "integer"
}
}
}
},
"has_web_view": {
"type": "boolean"
},
"allow_guest_to_view": {
"type": "boolean"
},
"index_web_pages_for_search": {
"type": "boolean"
},
"route": {
"type": "string"
},
"is_published_field": {
"type": "string"
},
"engine": {
"type": "string"
}
}
}
}
}
}

To retrieve all the data fields inside a resource, you can use the following URL format:

https://mysubdomain.erpnext.com/api/resource/Customer?fields=["*"]

To retrieve the all the form fields from a resource, e.g. retrieve all the form fields under Customer resource:

https://mysubdomain.erpnext.com/api/resource/DocType/Customer

Then you can access the all the form fields from the JSON result:
data: { fields: [...] }