Smartsheet SDK compatible on Amazon AWS Lambda?



有人知道Smartsheet SDK是否与亚马逊的AWS Lambda兼容吗?我有一张Smartsheet的票,但还没有收到他们的消息,所以我想我应该在这里试一试。

在AWS上运行此命令时超时;sheet = smartsheet.sheets.get(SHEET_ID)"。

AWS Lambda错误消息:

{
"errorMessage": "2021-02-19T18:33:11.477Z cbad2464-4195-4a54-ac72-ea53c2786b75 Task timed out after 10.01 seconds"
}

谢谢!

Python (version 3.8)代码:
# Name of the Smartsheet being updated
SHEET_ID = "CENIC Circuit Master Sheet Current"
smartsheet = Smartsheet(TOKEN)
#  print("DeBug 3 sheet = ", smartsheet) 
# This is the problem below.
**sheet = smartsheet.sheets.get(SHEET_ID)**
# Make sure we don't miss any errors
smartsheet_client.errors_as_exceptions(True)

在Ubuntu最新版本上运行良好。

您正在使用无效的语句。Sheets(大写'S')需要一个数字工作表ID,而不是工作表的名称。有关详细信息,请参阅文档。这就是出现错误的原因。

sheet = smartsheet.Sheets.get_sheet(4583173393803140)  

为什么出现超时错误?

您已经拨打了电话,您正在使能errors_as_exceptions。所以你没有从误差中得到有用的信息。像这样修改你的代码:

smartsheet.errors_as_exceptions(True)
SHEET_ID = 4583173393803140  # You must retrieve the Sheet ID first, names are not allowed
try:
sheet = smartsheet.Sheets.get_sheet(sheet_ID)
print(sheet)
except Exception as e: 
print(e.message)

最新更新