Table of Contents

Interface AttachmentVersioningResources

Namespace
Smartsheet.Api
Assembly
smartsheet-csharp-sdk.dll

This interface provides methods to access Versioning resources that are associated to an Attachment resource.

Thread Safety: Implementation of this interface must be thread safe.

public interface AttachmentVersioningResources

Methods

AttachNewVersion(long, long, string, string?)

Uploads a new version of a file to a Sheet or Row. This operation can be performed using a simple upload or a multipart upload. For more information, see Posting an Attachment.

It mirrors to the following Smartsheet REST API method:
POST /sheets/{sheetId}/attachments/{attachmentId}/versions

Uploading new versions is not supported for attachments on Comments or for URL attachments.

This is a resource-intensive operation and incurs 10 additional requests against the rate limit.

Attachment AttachNewVersion(long sheetId, long attachmentId, string file, string? fileType = null)

Parameters

sheetId long

the sheet id

attachmentId long

the attachment id

file string

the file path

fileType string

the file type, can be null

Returns

Attachment

Attachment object for the newly created attachment

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

DeleteAllVersions(long, long)

Deletes all versions of the attachment corresponding to the specified Attachment ID. For attachments with multiple versions, this will effectively delete the attachment from the object that it’s attached to.

It mirrors to the following Smartsheet REST API method: DELETE /sheets/{sheetId}/attachments/{attachmentId}/versions

void DeleteAllVersions(long sheetId, long attachmentId)

Parameters

sheetId long

the sheetId

attachmentId long

the attachment id

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

ListVersions(long, long, PaginationParameters?)

Gets a list of all versions of the given Attachment ID, in order from newest to oldest.

This operation supports pagination of results. For more information, see Paging.

to retrieve a download URL for a file attachment, use the Get Attachment operation for the specific version you want to download.

It mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/attachments/{attachmentId}/versions

PaginatedResult<Attachment> ListVersions(long sheetId, long attachmentId, PaginationParameters? paging = null)

Parameters

sheetId long

the sheet id

attachmentId long

the attachment id

paging PaginationParameters

the pagination

Returns

PaginatedResult<Attachment>

list of all versions of the given Attachment ID.

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