Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
116 views
in Technique[技术] by (71.8m points)

python - How to get Smartsheet published sheet's url?

I'd like to get url from a Smartsheet published sheet by Python.

Below is my code but it gives me error message.

 # Publish the sheet

sheetToPublish = smartsheet_client.Sheets.set_publish_status(

sheet.id,       # sheet_id

smartsheet.models.SheetPublish({

  'readOnlyFullEnabled': True

})

)

publish_sheet = smartsheet_client.Sheets.get_publish_status(

  sheet.id)       # sheet_id
?
?print(publish_sheet.readOnlyFullUrl)

Here is the error message,

AttributeError: 'SheetPublish' object has no attribute 'readOnlyFullUrl'
question from:https://stackoverflow.com/questions/65947774/how-to-get-smartsheet-published-sheets-url

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

When troubleshooting property names in situations like this, it's often helpful to look at the SDK source code on GitHub. In this case, the sheet_publish.py model that's defined in the SDK source code shows that the correct syntax for this property name is: read_only_full_url (not readOnlyFullUrl).

sheet_publish.py property definition


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...