Consistent 4600 error with Python API implementation

Consistent 4600 error with Python API implementation

I'm trying to insert a new lead via the API and I keep getting a 4600 error. I think it has something to do with the xmlData string. Would really appreciate some help with this.

This is the endpoint I am using:

https://crm.zoho.com/crm/private/xml/Leads/insertRecords

Attached is an image of the query string that's getting appended to the endpoint.

And this is the function I am executing (the string formatting is working properly):

  1. import urllib
  2. import urllib2

  3. def send_to_zoho(inquiry):

  4. authtoken = 'AUTHTOKENGOINGHERE'
  5. scope = 'crmapi'

  6. xmlData = "<Leads>"
  7. xmlData += "<row no='1'>"
  8. xmlData += "<FL val='First Name'>Dylan</FL>"
  9. xmlData += "<FL val='Last Name'>Faux</FL>"
  10. # xmlData += "<FL val='Zip Code'>{0}</FL>".format(inquiry.zipcode)
  11. # xmlData += "<FL val='Street'>{0}</FL>".format(inquiry.street_address)
  12. # xmlData += "<FL val='City'>{0}</FL>".format(inquiry.city)
  13. # xmlData += "<FL val='Phone'>{0}</FL>".format(inquiry.phone_number)
  14. # xmlData += "<FL val='Email'>{0}</FL>".format(inquiry.email)
  15. xmlData += "</row>"
  16. xmlData += "</Leads>"

  17. params = {
  18. 'newFormat': '1',
  19. 'authtoken':authtoken,
  20. 'scope':scope,
  21. 'xmlData':xmlData,
  22. }

  23. endpoint = "https://crm.zoho.com/crm/private/xml/Leads/insertRecords"

  24. data = urllib.urlencode(params)
  25. print data

  26. request = urllib2.Request(endpoint,data)
  27. response = urllib2.urlopen(request)
  28. xml_response = response.read()
  29. print xml_response