Interface WorkspaceSheetResources
- Namespace
- Smartsheet.Api
- Assembly
- smartsheet-csharp-sdk.dll
This interface provides methods to access sheet resources that are associated to a Workspace object.
Thread Safety: Implementation of this interface must be thread safe.
public interface WorkspaceSheetResources
Methods
CreateSheet(long, Sheet)
Creates a sheet in the given workspace.
Mirrors to the following Smartsheet REST API method: POST /workspaces/{workspaceId}/Sheets
Sheet CreateSheet(long workspaceId, Sheet sheet)
Parameters
Returns
- Sheet
the created sheet
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
CreateSheetFromTemplate(long, Sheet, IEnumerable<TemplateInclusion>?)
Creates a sheet at the top-level of the specified workspace, from the specified template.
Mirrors to the following Smartsheet REST API method: POST /workspaces/{workspaceId}/Sheets
Sheet CreateSheetFromTemplate(long workspaceId, Sheet sheet, IEnumerable<TemplateInclusion>? includes = null)
Parameters
workspaceIdlongthe workspace Id
sheetSheetthe sheet to create
includesIEnumerable<TemplateInclusion>used to specify the optional objects to include
Returns
- Sheet
the created sheet
Exceptions
- InvalidOperationException
if any argument is null or an empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
ImportCsvSheet(long, string, string?, int?, int?)
Imports a sheet at the top level of the specified workspace (from CSV).
Mirrors to the following Smartsheet REST API method: POST /workspaces/{workspaceId}/sheets/import
Sheet ImportCsvSheet(long workspaceId, string file, string? sheetName = null, int? headerRowIndex = null, int? primaryColumnIndex = null)
Parameters
workspaceIdlongthe workspace Id
filestringpath to the CSV file
sheetNamestringdestination sheet name
headerRowIndexint?index (0 based) of row to be used for column names
primaryColumnIndexint?index (0 based) of primary column
Returns
- Sheet
the created sheet
Exceptions
- InvalidOperationException
if any argument is null or an empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
ImportXlsSheet(long, string, string?, int?, int?)
Imports a sheet at the top level of the specified workspace (From XLSX).
Mirrors to the following Smartsheet REST API method: POST /workspaces/{workspaceId}/sheets/import
Sheet ImportXlsSheet(long workspaceId, string file, string? sheetName = null, int? headerRowIndex = null, int? primaryColumnIndex = null)
Parameters
workspaceIdlongthe workspace Id
filestringpath to the image file
sheetNamestringdestination sheet name
headerRowIndexint?index (0 based) of row to be used for column names
primaryColumnIndexint?index (0 based) of primary column
Returns
- Sheet
the created sheet
Exceptions
- InvalidOperationException
if any argument is null or an empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation