Interface SheetResources
- Namespace
- Smartsheet.Api
- Assembly
- smartsheet-csharp-sdk.dll
This interface provides methods to access sheet resources.
Thread Safety: Implementation of this interface must be thread safe.
public interface SheetResources
Properties
AttachmentResources
Returns the SheetAttachmentResources object that provides access to attachment resources associated with sheet resources.
SheetAttachmentResources AttachmentResources { get; }
Property Value
- SheetAttachmentResources
the SheetAttachmentResources object
AutomationRuleResources
Returns the AutomationRuleResources object that provides access to automation rules resources associated with sheet resources.
SheetAutomationRuleResources AutomationRuleResources { get; }
Property Value
- SheetAutomationRuleResources
the AutomationRuleResources object
ColumnResources
Returns the SheetColumnResources object that provides access to column resources associated with sheet resources.
SheetColumnResources ColumnResources { get; }
Property Value
- SheetColumnResources
the SheetColumnResources object
CommentResources
Returns the SheetCommentResources object that provides access to comment resources associated with sheet resources.
SheetCommentResources CommentResources { get; }
Property Value
- SheetCommentResources
the SheetCommentResources object
CrossSheetReferenceResources
Returns the CrossSheetReferenceResources object that provides access to cross-sheet reference resources associated with sheet resources.
SheetCrossSheetReferenceResources CrossSheetReferenceResources { get; }
Property Value
- SheetCrossSheetReferenceResources
the CrossSheetReferenceResources object
DiscussionResources
Returns the SheetDiscussionResources object that provides access to discussion resources associated with sheet resources.
SheetDiscussionResources DiscussionResources { get; }
Property Value
- SheetDiscussionResources
the SheetDiscussionResources object
FilterResources
Returns the FilterResources object that provides access to filter resources associated with sheet resources.
SheetFilterResources FilterResources { get; }
Property Value
- SheetFilterResources
the FilterResources object
RowResources
Returns the SheetRowResources object that provides access to row resources associated with sheet resources.
SheetRowResources RowResources { get; }
Property Value
- SheetRowResources
the SheetRowResources object
ShareResources
Returns the ShareResources object that provides access to share resources associated with sheet resources.
ShareResources ShareResources { get; }
Property Value
- ShareResources
the ShareResources object
SummaryResources
Returns the SheetSummaryResources object that provides access to sheet summary resources associated with sheet resources.
SheetSummaryResources SummaryResources { get; }
Property Value
- SheetSummaryResources
the SheetSummaryResources object
UpdateRequestResources
Returns the SheetUpdateRequestResources object that provides access to update request resources associated with sheet resources.
SheetUpdateRequestResources UpdateRequestResources { get; }
Property Value
- SheetUpdateRequestResources
the SheetUpdateRequestResources object
Methods
CopySheet(long, ContainerDestination, IEnumerable<SheetCopyInclusion>?, IEnumerable<SheetCopyExclusion>?)
Creates a copy of the specified sheet.
Mirrors to the following Smartsheet REST API method:
POST /sheets/{sheetId}/copy
Sheet CopySheet(long sheetId, ContainerDestination destination, IEnumerable<SheetCopyInclusion>? include = null, IEnumerable<SheetCopyExclusion>? exclude = null)
Parameters
sheetId
longthe sheet Id
destination
ContainerDestinationthe destination to copy to
include
IEnumerable<SheetCopyInclusion>the elements to copy. Note: Cell history will not be copied, regardless of which include parameter values are specified.
exclude
IEnumerable<SheetCopyExclusion>optional elements to exclude
Returns
- Sheet
the created folder
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
CreateSheet(Sheet)
Creates a sheet in default "Sheets" collection.
Mirrors to the following Smartsheet REST API method:
POST /Sheets
Sheet CreateSheet(Sheet sheet)
Parameters
sheet
Sheetthe sheet to create
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
CreateSheetFromTemplate(Sheet, IEnumerable<TemplateInclusion>?)
Creates a sheet (from existing sheet or template) in default "Sheets" collection.
Mirrors to the following Smartsheet REST API method: POST /Sheets
Sheet CreateSheetFromTemplate(Sheet sheet, IEnumerable<TemplateInclusion>? include = null)
Parameters
sheet
Sheetthe sheet to create
include
IEnumerable<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
DeleteSheet(long)
Deletes a sheet.
Mirrors to the following Smartsheet REST API method: DELETE /sheets/{sheetId}
void DeleteSheet(long sheetId)
Parameters
sheetId
longthe sheet Id
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
GetPublishStatus(long)
Gets the status of the publish settings of the sheet, including the URLs of any enabled publishings.
Mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/publish
SheetPublish GetPublishStatus(long sheetId)
Parameters
sheetId
longthe sheet Id
Returns
- SheetPublish
the publish status (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null)
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
GetSheet(long, IEnumerable<SheetLevelInclusion>?, IEnumerable<SheetLevelExclusion>?, IEnumerable<long>?, IEnumerable<int>?, IEnumerable<long>?, long?, long?, DateTime?, long?, int?)
Gets a sheet.
Mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}
Sheet GetSheet(long sheetId, IEnumerable<SheetLevelInclusion>? includes = null, IEnumerable<SheetLevelExclusion>? excludes = null, IEnumerable<long>? rowIds = null, IEnumerable<int>? rowNumbers = null, IEnumerable<long>? columnIds = null, long? pageSize = null, long? page = null, DateTime? rowsModifiedSince = null, long? ifVersionAfter = null, int? level = null)
Parameters
sheetId
longthe Id of the sheet
includes
IEnumerable<SheetLevelInclusion>used to specify the optional objects to include.
excludes
IEnumerable<SheetLevelExclusion>used to specify the optional objects to include.
rowIds
IEnumerable<long>used to specify the optional objects to include.
rowNumbers
IEnumerable<int>used to specify the optional objects to include.
columnIds
IEnumerable<long>used to specify the optional objects to include.
pageSize
long?used to specify the optional objects to include.
page
long?used to specify the optional objects to include.
rowsModifiedSince
DateTime?ifVersionAfter
long?level
int?
Returns
- Sheet
the sheet resource (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
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
GetSheetAsCSV(long, BinaryWriter)
Gets a sheet as a CSV file.
Mirrors to the following Smartsheet REST API method:
GET /sheets/{sheetId} with "text/csv" Accept HTTP header
void GetSheetAsCSV(long sheetId, BinaryWriter outputStream)
Parameters
sheetId
longthe Id of the sheet
outputStream
BinaryWriterthe output stream to which the CSV file will be written.
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
GetSheetAsExcel(long, BinaryWriter)
Gets a sheet as an Excel file.
Mirrors to the following Smartsheet REST API method:
GET /sheets/{sheetId} with "application/vnd.ms-excel" Accept HTTP header
void GetSheetAsExcel(long sheetId, BinaryWriter outputStream)
Parameters
sheetId
longthe Id of the sheet
outputStream
BinaryWriterthe output stream to which the Excel file will be written.
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
GetSheetAsPDF(long, BinaryWriter, PaperSize?)
Gets a sheet as a PDF file.
Mirrors to the following Smartsheet REST API method:
GET /sheets/{sheetId} with "application/pdf" Accept HTTP header
void GetSheetAsPDF(long sheetId, BinaryWriter outputStream, PaperSize? paperSize = null)
Parameters
sheetId
longthe Id of the sheet
outputStream
BinaryWriterthe output stream to which the PDF file will be written.
paperSize
PaperSize?the paper size
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
GetSheetVersion(long)
Gets the sheet version without loading the entire sheet.
Mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/version
int? GetSheetVersion(long sheetId)
Parameters
sheetId
longthe sheet Id
Returns
- int?
the sheet version (note that if there is no such resource, this method will throw ResourceNotFoundException)
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(string, string?, int?, int?)
Imports a sheet (from CSV).
Mirrors to the following Smartsheet REST API method: POST /sheets/import
Sheet ImportCsvSheet(string file, string? sheetName = null, int? headerRowIndex = null, int? primaryColumnIndex = null)
Parameters
file
stringpath to the CSV file
sheetName
stringdestination sheet name
headerRowIndex
int?index (0 based) of row to be used for column names
primaryColumnIndex
int?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(string, string?, int?, int?)
Imports a sheet (from XLSX).
Mirrors to the following Smartsheet REST API method: POST /sheets/import
Sheet ImportXlsSheet(string file, string? sheetName = null, int? headerRowIndex = null, int? primaryColumnIndex = null)
Parameters
file
stringpath to the XLSX file
sheetName
stringdestination sheet name
headerRowIndex
int?index (0 based) of row to be used for column names
primaryColumnIndex
int?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
ListSheets(IEnumerable<SheetInclusion>?, PaginationParameters?, DateTime?)
Gets the list of all sheets that the user has access to, in alphabetical order, by name.
Mirrors to the following Smartsheet REST API method: GET /Sheets
PaginatedResult<Sheet> ListSheets(IEnumerable<SheetInclusion>? includes = null, PaginationParameters? paging = null, DateTime? modifiedSince = null)
Parameters
includes
IEnumerable<SheetInclusion>elements to include in response
paging
PaginationParametersthe pagination
modifiedSince
DateTime?only return sheets modified on or after the specified date
Returns
- PaginatedResult<Sheet>
A list of all sheets (note that an empty list will be returned if there are none) limited to the following attributes:
- id
- name
- accessLevel
- permalink
- source (included only if "source" is specified with the include parameter)
- owner (included only if "ownerInfo" is specified with the include parameter)
- ownerId (included only if "ownerInfo" is specified with the include parameter)
- createdAt
- modifiedAt
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
MoveSheet(long, ContainerDestination)
Moves the specified sheet to a new location.
Mirrors to the following Smartsheet REST API method:
POST /sheets/{sheetId}/move
Sheet MoveSheet(long sheetId, ContainerDestination destination)
Parameters
sheetId
longthe sheet Id
destination
ContainerDestinationthe destination to copy to
Returns
- Sheet
the moved 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
SendSheet(long, SheetEmail)
Sends a sheet as a PDF attachment via email to the designated recipients.
Mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/emails
void SendSheet(long sheetId, SheetEmail email)
Parameters
sheetId
longthe sheet Id
email
SheetEmailthe email
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
SortSheet(long, SortSpecifier, int?)
Sorts a sheet according to the sort criteria.
Mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/sort
Sheet SortSheet(long sheetId, SortSpecifier sortSpecifier, int? level = null)
Parameters
sheetId
longthe sheet Id
sortSpecifier
SortSpecifierthe sort criteria
level
int?compatibility level
Returns
- Sheet
the Sheet (note that if there is no such resource, this method will throw a ResourceNotFoundException rather than returning null).
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
UpdatePublishStatus(long, SheetPublish)
Sets the publish status of a sheet and returns the new status, including the URLs of any enabled publishings.
Mirrors to the following Smartsheet REST API method: PUT /sheets/{sheetId}/publish
SheetPublish UpdatePublishStatus(long sheetId, SheetPublish publish)
Parameters
sheetId
longthe sheet Id
publish
SheetPublishthe SheetPublish object limited.
Returns
- SheetPublish
the update SheetPublish object (note that if there is no such resource, this method will throw a ResourceNotFoundException rather than returning null).
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
UpdateSheet(Sheet)
Updates a sheet.
To modify sheet contents, see Add Rows, Update Rows, and Update Column.
This operation can be used to update an individual users sheet settings. If the request body contains only the userSettings attribute, this operation may be performed even if the user only has read-only access to the sheet (i.e., the user has viewer permissions, or the sheet is read-only).
Mirrors to the following Smartsheet REST API method: PUT /sheets/{sheetId}
Sheet UpdateSheet(Sheet sheet)
Parameters
sheet
Sheetthe sheet to update
Returns
- Sheet
the updated 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