Smartsheet.Api.Internal.SheetAttachmentResourcesImpl.GetAttachment C# (CSharp) Method

GetAttachment() public method

public GetAttachment ( long sheetId, long attachmentId ) : Attachment
sheetId long
attachmentId long
return Smartsheet.Api.Models.Attachment
        public virtual Attachment GetAttachment(long sheetId, long attachmentId)
        {
            return this.GetResource<Attachment>("sheets/" + sheetId + "/attachments/" + attachmentId, typeof(Attachment));
        }

Usage Example

        public virtual void TestGetAttachment()
        {
            server.setResponseBody("../../../TestSDK/resources/getAttachment.json");
            Attachment attachment = sheetAttachmentResource.GetAttachment(56545654, 56464654);

            Assert.IsTrue(attachment.AttachmentType == AttachmentType.FILE);
            Assert.IsTrue(attachment.MimeType == "image/png");
            Assert.IsTrue(attachment.Id == 4583173393803140);
            Assert.IsTrue(attachment.Description == null);
            Assert.IsTrue(attachment.Name == "at3.png");
            Assert.IsTrue(attachment.Url == "URL_TO_ATTACHMENT");
            Assert.IsTrue(attachment.UrlExpiresInMillis == 120000);
        }