0

Does anyone know if Smartsheet SDK is compatible with Amazon's AWS Lambda? I have a ticket in for Smartsheet but haven't heard from them yet so I thought I would give it a try here.

I'm getting a time-out when running this command on AWS "sheet = smartsheet.sheets.get(SHEET_ID)".

AWS Lambda error message:

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

Thanks!

Python (version 3.8) Code:

  # 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)

Runs fine on Ubuntu latest version.

1 Answers1

0

You're using an invalid statement. Sheets (capital 'S') requires a numeric sheet ID, not the name of a sheet. See the documentation for a details. This is why an error is occurring.

sheet = smartsheet.Sheets.get_sheet(4583173393803140)  

Why the time out error?

You are enabling errors_as_exceptions after you've already made the call. So you aren't getting useful information from the error. Revise your code to something like this:

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)
Software2
  • 2,358
  • 1
  • 18
  • 28
  • Great, I'll give it a try. Thank you! – Michael Tuccillo Mar 01 '21 at 15:11
  • That took care of the syntax. Still got the time-out error at 50 seconds. I don't want to go over that since billing is being closely watched. And so, I made a smaller file on Smartsheet and downloaded that within 20 seconds. Its a stub Smartsheet (a sub-portion of the original Smartsheet) with the columns that I actually use. – Michael Tuccillo Mar 04 '21 at 15:42