Hi friends,
- How to retrieve a single type doctype document using rest API?
- In which table Frappe store data of single type doctypes?
Hi friends,
api/resource/Doctype
/Doctype
for example:
api/resource/Dropbox Settings/Dropbox Settings
It is called Singles,
You can retrieve data from it as following:
Using Query:
Select * from `tabSingles` where doctype = 'Dropbox Settings'
Using frappe ORM:
Either
frappe.get_single(doctype)
frappe.get_single('Dropbox Settings')
OR
frappe.get_doc(doctype,doctype)
frappe.get_doc('Dropbox Settings','Dropbox Settings')
There’s also this …
curl -L -X GET 'https://dev.erpnext.host/api/method/frappe.client.get_single_value' \
-H 'Authorization: token 72d0badbad9e010:0261badbad0ce2190' \
-H 'Content-Type: application/json' \
--data-raw '{
"doctype": "Website Settings",
"field": "chat_welcome_message"
}'
… which’ll get you this …
{
"message": "Hi, how may I help you?"
}