我試圖從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),但我不知道爲什麼,就在我使命令獲得所有工作表的清單之後,然後當我選擇其中一個時(我不是擁有此令牌的所有者,而是令牌是系統管理員)
感謝您的幫助