Hi,
I have faced internal server error, while calling “api/resource/Website Chat Session”
$.ajax({
type: "POST",
url: "api/resource/Website Chat Session",
data: {
doclist: JSON.stringify([
{
"doctype":"Website Chat Session",
"client_name": name,
"client_email_id": email,
"client_question": question,
"status": (chat.agent_status==="active" ? "New" : "Lost")
}
])
}
})
ref: https://github.com/frappe/website_chat/blob/master/website_chat/templates/includes/chat.js Line:72
I find out the cause of Error:
frappe/api.py line: 97
data = json.loads(frappe.local.form_dict.data)
actually the key data
is not exists. please have a look up.
Error Message: ["Traceback (innermost last):\n File \"/home/nislam/www/python/ProjectCentimani/Centimani4School/lib/frappe/frappe/app.py\", line 52, in application\n response = frappe.api.handle()\n File \"/home/nislam/www/python/ProjectCentimani/Centimani4School/lib/frappe/frappe/api.py\", line 97, in handle\n data = json.loads(frappe.local.form_dict.data)\n File \"/usr/lib/python2.7/json/__init__.py\", line 338, in loads\n return _default_decoder.decode(s)\n File \"/usr/lib/python2.7/json/decoder.py\", line 366, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n TypeError: expected string or buffer\n"]
Please suggest me the way of solution.
Special tag: @rmehta
Best Regards
Nazrul