Issue with get_sheet_as_excel() – KeyError: 'content-disposition'

I am using Python smartsheet sdk to connect to smartsheet. The line
smartsheet_client.Sheets.get_sheet_as_excel(sheet_id, folder_path)
was working fine until yesterday. Now it's failing with KeyError: 'content-disposition'. No changes were made to the code or permissions. Please advise on how to resolve this.
Thanks,
Liam
Comments
-
If the sheet was deleted, moved to another workspace, or you lost access, the API might not return a proper file stream (and instead return an error response — but your code still tries to parse it as a file).
PMO & Smartsheet Consultant
naeemejaz@hotmail.com
00923455332351
-
Hi Naeem,
I am also facing the same issue since 06/27/25. No changes to the workspace or the access. Could you please advise if there was been any upgrade to the Smartsheet? -
Hey everyone,
I ran into this issue today with get_sheet_as_csv() and was able to resolve by updating smartsheet's python SDK to the most recent version:
pip install smartsheet-python-sdk==3.0.5 -
Also just found out that for me the get_sheet_as_csv method slightly changed:
Before this would save as a CSV using the sheet name as the filename (on version 2.105.1):smart = smartsheet.Smartsheet()
smart.Sheets.get_sheet_as_csv(SHEET_ID, os.path.dirname(os.path.realpath(file)))
Now to get the same behavior, I do this (on version 3.0.5)smart = smartsheet.Smartsheet()
csv_file = smart.Sheets.get_sheet_as_csv(SHEET_ID, os.path.dirname(os.path.realpath(file)), CSV_FILENAME)
csv_file.save_to_file() -
The documentation shows that:
smartsheet package — Smartsheet Python SDK 3.0.5 documentation
get_sheet_as_csv(sheet_id, download_path, alternate_file_name=None)
Get the specified Sheet as a CSV file.
Parameters:
- sheet_id (int) – Sheet ID
- download_path (str) – Directory path on local machine to save file.
- alternate_file_name (str) – Filename to use instead of name suggested by Content-Disposition.
Returns:
DownloadedFile