Hi how you call an api from custom server script? I create a server script but when I call it inside script in web page is not working?
Here’s an example
and when I tried from my local http://localhost:8006/api/method/get_item the response were message: "oke"
when I tried to call it inside a script in web page through api call the message were
I need to get an item price for guest and display it in web that’s why I need a frappe call. Here’s what I’ve tried
frappe.call({
method: “frappe.client.get_list”,
args: {
doctype: “Item”,
fields: [“item_code”, “item_name”, “description”]
},
callback: function (r) {
var data = r.message;
console.log(data)}
})
But frappe.client.get_list is not allowed for guest. Anyone can help?