Closed jmpb closed 4 years ago
thanks for this, I will investigate it.
It is a bug in the zoho library. The database row is being passed a payload to the POST request, but in fact the API is expecting the row to be passed as query parameters.
this works:
def addRow(self, tableURI, columnValues, config=None):
payLoad = ReportClientHelper.getAsPayLoad([columnValues, config], None, None)
url = ReportClientHelper.addQueryParams(tableURI, self.token, "ADDROW", "XML")
url += "&" + payLoad
return self.__sendRequest(url, "POST", payLoad=None, action="ADDROW", callBackData=None)
I will fix this in my next upload
Closed in Pypi v 0.5.99
Firstly, I realised this is an issue in the modified library from Zoho/adventnet but your package has helped me a lot so I thought I would point this bug out here rather than it falling on deaf ears.
The ReportClient.addRow method, when given a dictionary of column names/values then appears to pass it to the ReportClientHelper.getAsPayLoad method which proceeds to urlencode the data.
This then causes a 400 response with error code 8016.
An easy enough workaround for me has been to comment this line in the addRow method:
and below that add:
Essentially bypassing the urlencoding of the data.
Not sure if this causes any issues if using the addRow method in other ways. I am using it in it's basic form without any config values set.