smartsheet-platform/smartsheet-python-sdk

Is there function to Upload a File to SmartSheet URL?

SieSiongWong opened this issue · 1 comments

Currently, I go to the SmartSheet URL and drag and drop a file and click submit without any login.

Which function in this smartsheet package can put a file into the URL?

RCoff commented

It sounds like you're wanting to use the API to mimic Smartsheet's feature of uploading a file from your own computer.
Check out the documentation for attachments here: https://smartsheet.redoc.ly/tag/attachments#operation/attachments-attachToSheet

The code to do this should look something like:
updated_attachment = smartsheet_client.Attachments.attach_file_to_sheet( 9283173393803140, # sheet_id ('ProgressReport.docx', open('/path/to/ProgressReport.docx', 'rb'), 'application/msword') )

(This code is taken directly from the above documentation)