tableau / rest-api-samples

Samples for the Tableau REST API
MIT License
394 stars 273 forks source link

"Move workbooks" sample doesn't work for large workbooks #28

Open vikpos opened 6 years ago

vikpos commented 6 years ago

Hi team,

I spotted an issue in this sample script: https://github.com/tableau/rest-api-samples/blob/master/python/move_workbook_sites.py

When running it with a large workbook (over 64MB) the script fails with: Traceback (most recent call last): File "C:\Python27\Lib\site-packages\move_DS_sample.py", line 405, in main() File "C:\Python27\Lib\site-packages\move_DS_sample.py", line 392, in main workbook_content, dest_project_id) File "C:\Python27\Lib\site-packages\move_DS_sample.py", line 299, in publish_workbook upload_id = start_upload_session(server, site_id, auth_token) File "C:\Python27\Lib\site-packages\move_DS_sample.py", line 173, in start_upload_session _check_status(server_response, 201) File "C:\Python27\Lib\site-packages\move_DS_sample.py", line 106, in _check_status raise ApiCallError(error_message) main.ApiCallError: 401002: Unauthorized Access - Invalid authentication credentials were provided.

I found this happens because of line 288: upload_id = start_upload_session(server, site_id, auth_token)

the code should be: upload_id = start_upload_session(server, auth_token, site_id)

Otherwise it uses "site id" as auth token and fails... Could you please fix? NB: Same issue could be affecting other samples...

aaroncarey commented 6 years ago

This looks like a clear-cut fix to me. Any concerns from @RussTheAerialist or @irwando ?

alibbird commented 4 years ago

Confirming this issue is still not resolved in the sample script