Error While using REST Api

49 views
Skip to first unread message

Pranali Khatode

unread,
Aug 20, 2014, 10:40:58 AM8/20/14
to erpnext-dev...@googlegroups.com
Hello,

While using REST API for creating Support Ticket From one setup instance to another instance,
I am getting following error while tracing the response.text

File "/home/saurabh/Documents/alek/erpnext-bench/apps/frappe/frappe/app.py", line 49, in application response = frappe.api.handle() File "/home/saurabh/Documents/alek/erpnext-bench/apps/frappe/frappe/api.py", line 42, in handle return frappe.handler.handle() File "/home/saurabh/Documents/alek/erpnext-bench/apps/frappe/frappe/handler.py", line 66, in handle execute_cmd(cmd) File "/home/saurabh/Documents/alek/erpnext-bench/apps/frappe/frappe/handler.py", line 72, in execute_cmd method = get_attr(cmd) File "/home/saurabh/Documents/alek/erpnext-bench/apps/frappe/frappe/handler.py", line 95, in get_attr method = globals()[cmd] KeyError: u'Support Ticket'


My code for calling REST is

import json
import requests
data = {}
data['raised_by'] = self.raised_by
data['subject']= self.subject
data['status']= self.status
data['company']= self.company

headers = {'content-type': 'application/json'}
response = requests.post(url, data=json.dumps(data) ,headers=headers)
frappe.errprint(response.text)

Nguyen Do Le Bao

unread,
Aug 20, 2014, 10:38:56 PM8/20/14
to erpnext-dev...@googlegroups.com
from https://frappe.io/developers/api/rest_api
I think it should be /api/resource  not /api/method
Reply all
Reply to author
Forward
0 new messages