我试图从Python SDK API中检索Users.list_org_sheets(include_all = True)表。如何使用Smartsheets API检索文件夹树Python
与我可以看到所有我需要的东西:
lstorg = ss.Users.list_org_sheets(include_all=True)
for entry in lstorg.data:
print(entry.id)
print(entry.name)
ss是smartsheet.Smartsheet(标记)。 所以与我可以看到所有的表在我的领域,但是当我尝试与get_sheet_as_excel(ID,路径)下载,我得到的错误:
print(ss.Sheets.get_sheet('6157394402142084'))
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
print(ss.Sheets.get_sheet('6157394402142084')
File "E:\Python\lib\site-packages\smartsheet\sheets.py", line 525, in get_sheet
response = self._base.request(prepped_request, expected, _op)
File "E:\Python\lib\site-packages\smartsheet\smartsheet.py", line 218, in request
raise the_ex(native, str(native.result.code) + ': ' + native.result.message)
smartsheet.exceptions.ApiError: {"requestResponse": null, "result": {"code": 1006, "message": "Not Found", "name": "ApiError", "recommendation": "Do not retry without fixing the problem. ", "refId": null, "shouldRetry": false, "statusCode": 404}}
我想,这个错误意味着他没有” t找到文件(错误404),但我不知道为什么,就在我使命令获得所有工作表的清单之后,然后当我选择其中一个时(我不是拥有此令牌的所有者,而是令牌是系统管理员)
感谢您的帮助