سؤال

I am trying to add a lead to a Zoho CRM module with Python. I keep getting:

< response>< error>< code>4600< /code>< message>Unable to process your request. Please verify if the name and value is appropriate for the "xmlData" parameter.< /message>< /error>< /response>

from the server. I have no idea if I am posting correctly or if it is a problem with our Xml Data. I am using urllib and urllib2 to format the post request.

The post request looks like this.

    url = ("https://crm.zoho.com/crm/private/xml/Leads/insertRecords?authtoken="
            ""+str(self.authToken)+"&scope=crmapi")

    params = {"xmlData":self.xml}
    data = urllib.urlencode(params)
    request = urllib2.Request(url = url, data =data)
    request.add_header("Content-Type",'application/xml')
    response = urllib2.urlopen(request)
هل كانت مفيدة؟

المحلول

You cannot combine HTTP GET query parameters (ones in URL) and HTTP POST parameters.

This is limitation on the HTTP protocol level, not in Python or Zoho.

Most likely you are doing it wrong. Revisit Zoho documentation how it should be done.

Here is another old library doing Zoho + CRM, written in Python. You might want to check it for inspiration: https://github.com/miohtama/mfabrik.zoho

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top