Unable to upload a file using python

Unable to upload a file using python

Hi Team,

I have tried the below method to upload a file in ZOHO using python.

======================================================
import MultipartPostHandler, urllib2
 
ID ='put the accounts zoho id here '
authtoken = 'your zoho authtoken here'
fileName = "your file name here - i use the full path and filename"
 
opener = urllib2.build_opener(MultipartPostHandler.MultipartPostHandler)
 
params = {'authtoken':authtoken,'scope':'crmapi','newFormat':'1','id':ID, 'content':open(fileName,"rb")}
 
 
rslts = opener.open(final_URL, params)
 
print rslts.read()
======================================================


But, I am getting error " {"response":{"error":{"code":"4834","message":"Invalid Ticket Id"},"uri":"/crm/private/json/Accounts/uploadFile"}}" , I change my  authtoken: 5 time Stil there is no change.

Thanks in advance.