Table of Contents

Interface CommentAttachmentResources

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

This interface provides methods to access Attachment resources that are associated to Comment resources.

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

public interface CommentAttachmentResources

Methods

AttachFile(long, long, string, string)

Attaches a file to the Comment.

This operation will always create a new attachment. to upload a new version of the same attachment, use the Attach New Version operation.

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

Attachment AttachFile(long sheetId, long commentId, string file, string fileType)

Parameters

sheetId long

the sheetId

commentId long

the comment Id

file string

the file path

fileType string

the file type, can be null

Returns

Attachment

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

AttachUrl(long, long, Attachment)

Attaches a URL to the Comment.

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

attachmentSubType is valid only for GOOGLE_DRIVE attachments which are Google Docs. It can optionally be included to indicate the type of a file. The following attachmentSubTypes are valid for GOOGLE_DRIVE attachments "DOCUMENT", "SPREADSHEET", "PRESENTATION", "PDF", "DRAWING".

When the attachment type is BOX_COM, DROPBOX, or GOOGLE_DRIVE (without an attachmentSubType specified), the mimeType will be derived by the file extension specified on the “name”.

Attachment AttachUrl(long sheetId, long commentId, Attachment attachment)

Parameters

sheetId long

the sheetId

commentId long

the comment Id

attachment Attachment

the attachment object

Returns

Attachment

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