API Updates: New Import Endpoints

Published on 25 July 2018

The Smartsheet API recently added new endpoints for importing CSV or XLSX data into a new sheet, and the SDKs for Java, C#, Python, JavaScript, and Ruby have all been updated to support this new feature. 

To show how you can take advantage of this new functionality, let's discuss how to use the import endpoint with the Python SDK.

We'll start with a simple Excel spreadsheet named "Sample Sheet.xlsx" with three columns of data -- Name, Status, and Remaining.

Excel spreadsheet sample image. Columns Name, Status and Remaining

To import this data into a new sheet, using the Python SDK, you'll call the Sheets.import_xlsx_sheet function, passing the following arguments:

  • Relative Path to the Excel file
  • Name of the new sheet
  • Header_row_index

For our example, the function call would look something like this:

imported_sheet = ss_client.Sheets.import_xlsx_sheet(
    'Sample Sheet.xlsx',
    'Python Sheet Import', #sheet_name
    header_row_index=0
)

For details about these new endpoints, and more examples for how to use them, check out the Smartsheet API documentation.
In addition to adding the import endpoint, some of the SDKs also added other features. Here is a list of more detailed additions to the SDKs.

Java SDK
The update for the Java SDK introduced the ability to import sheets, as well as provide limited support for Chart widget types in Dashboards. For more details on the latest changes to the SDK view the changelog.

C# SDK
The additions for version 2.3.0 of the C# SDK are extensive. Among the high points are support for working with automation rules, cross-sheet references, and import sheets from xlsx and csv files. These are only a few of the many changes made to the SDK. For a complete list, take a look at the changelog for the SDK.

Python SDK
In addition to being able to import sheets from xlsx and csv files, the Python SDK added some support for dashboard chart objects where the chart contents read into JSON strings. For more details on this update of the Python SDK, check out the changelog

JavaScript SDK
The JavaScript SDK added support for creating favorites in bulk, as well as importing sheets. More details for this latest version of the SDK can be found in the SDK changelog.

Ruby SDK
The latest version of the Ruby SDK introduced an with the Smartsheet SDK test suite. With the addition of Ruby, the test suite now provides mock testing for every one of Smartsheet's SDKs. The Ruby SDK also added support for automation rules. See the changelog for the Ruby SDK for details on the other changes in this release.

comment

Comments