Hello,
I am currently trying to use the “categoryUser.addFromBulkUpload()” function to upload a CSV file. I am using the Kaltura Python Client Library (http://www.kaltura.com/api_v3/testme/client-libs.php) to access the Kaltura API on the SaaS (www.kaltura.com) server.
When I tested this on the API Test Console (https://developer.kaltura.com/console/#/categoryUser.addFromBulkUpload), it worked fine. I then adapted the provided sample code to Python. However, when I try to test it, I get the following error:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Users\ccrowe3\GitHub\mediahopper\hopper_project\users_upload\helpers.py", line 35, in bulk_upload_kaltura
return client.categoryUser.addFromBulkUpload(filename, bulk_upload_data, category_user_data)
File "C:\Users\ccrowe3\venv3\lib\site-packages\KalturaClient\Plugins\Core.py", line 48588, in addFromBulkUpload
resultNode = self.client.doQueue()
File "C:\Users\ccrowe3\venv3\lib\site-packages\KalturaClient\Client.py", line 327, in doQueue
resultNode = self.parsePostResult(postResult)
File "C:\Users\ccrowe3\venv3\lib\site-packages\KalturaClient\Client.py", line 301, in parsePostResult
self.throwExceptionIfError(resultNode)
File "C:\Users\ccrowe3\venv3\lib\site-packages\KalturaClient\Client.py", line 375, in throwExceptionIfError
raise exceptionObj
KalturaException: Upload failed (UPLOAD_ERROR)
Here is the code I am using for the upload:
from KalturaClient import *
def bulk_upload_kaltura(client, filename):
bulk_upload_data = Plugins.Core.KalturaBulkUploadJobData()
category_user_data = Plugins.Core.KalturaBulkUploadCategoryUserData()
return client.categoryUser.addFromBulkUpload(filename, bulk_upload_data, category_user_data)
Where client is a KalturaClient object (correctly formed as far as I can tell, as it works for other API calls) and filename is the path to the CSV file I want to upload.
I can’t figure out what is causing this error, or even if my code is entirely incorrect. Does anybody know what is going wrong?
Thanks!